GDB 7.0 released
GDB 7.0 released
Posted Oct 8, 2009 19:47 UTC (Thu) by quotemstr (subscriber, #45331)In reply to: GDB 7.0 released by ikm
Parent article: GDB 7.0 released
* which is practically identical to the fastcall convention used by some C code.
Posted Oct 8, 2009 20:23 UTC (Thu)
by oak (guest, #2786)
[Link]
For example exception handling. Exception handler can crash when stack
Project Archer's devel branch page lists some other issues they deal with.
Posted Oct 8, 2009 21:59 UTC (Thu)
by ikm (guest, #493)
[Link]
Posted Oct 8, 2009 22:33 UTC (Thu)
by nix (subscriber, #2304)
[Link] (4 responses)
Posted Oct 9, 2009 1:50 UTC (Fri)
by quotemstr (subscriber, #45331)
[Link] (3 responses)
But what's this double-constructor thing?
Posted Oct 9, 2009 9:05 UTC (Fri)
by nix (subscriber, #2304)
[Link] (1 responses)
Regarding the constructors, the C++ ABI defines three types of constructor: complete object constructors, base object constructors, and complete object allocating constructors (but the latter type is optional and GCC never generates them). GCC somewhat confusingly calls the former two types 'in-charge' and 'not-in-charge' constructors, and these are the names GDB uses for them.
Complete object constructors are supposed to dig out the appropriate VTT pointer during virtual inheritance and call the base object constructor: however, released GCCs instead just clone the entire function body (see gcc/cp/class.c:build_clone()). When he implemented this, Mark Mitchell mentioned that
(Mind you, GDB has to handle this anyway even if the in-charge constructor does change to call the not-in-charge one: GCC can do cloning of arbitrary functions now to aid constant propagation and inlining, even across translation unit boundaries if whole-program optimization is on, and I'd expect that to confuse GDB in exactly the same way as in-charge/not-in-charge constructors always have. I haven't checked to see if this has been fixed in the last year.)
Posted Oct 9, 2009 9:38 UTC (Fri)
by sspr (guest, #39636)
[Link]
Posted Oct 9, 2009 15:07 UTC (Fri)
by bronson (subscriber, #4806)
[Link]
Not true. An exception unwinds the stack calling destructors as it goes. Longjmp just restores registers and jumps up the stack. They're very different beasts.
C++ Exception handling is actually quite complex with a number of unintuitive gotchas. Sadly, it's been a great source of compiler bugs too.
Posted Oct 9, 2009 5:14 UTC (Fri)
by njs (subscriber, #40338)
[Link] (4 responses)
IIRC the new Python scripting stuff is supposed to help with this.
Posted Oct 9, 2009 9:07 UTC (Fri)
by nix (subscriber, #2304)
[Link] (3 responses)
Posted Oct 15, 2009 8:26 UTC (Thu)
by elanthis (guest, #6227)
[Link] (2 responses)
GDB needs a big push in the debug info department. It could use a big push in the compile time error quality, too, for that matter.
Posted Oct 15, 2009 8:56 UTC (Thu)
by jwakely (subscriber, #60262)
[Link] (1 responses)
GCC has to "slap in" the full type name for the linker, typedefs do not affect the name the linker uses.
GDB needs a big push in the debug info department.
You mean GCC, right? It's getting a big push, see http://gcc.gnu.org/wiki/Var_Tracking_Assignments
It could use a big push in the compile time error quality, too, for that matter.
See http://gcc.gnu.org/wiki/Better_Diagnostics - although it's easy to say diagnostics should be better, it's a lot harder to suggest specific improvements.
Posted Oct 15, 2009 11:33 UTC (Thu)
by jwakely (subscriber, #60262)
[Link]
... and this isn't true. GDB can show a more useful representation of data structures than simply listing all the bases and members, and that's exactly what the new python pretty printing does.
GDB 7.0 released
C++ ones have funny symbol names. Assuming you can get past the name
mangling (and the thiscall calling convention*), what's the difference?
has been unwound. A bit tricker to show callers then...
GDB 7.0 released
GDB 7.0 released
overloaded functions, the magic duplicate of every constructor that the
C++ ABI dictates (put a breakpoint on it and likely as not it'd land on
the wrong one)...
Fair enough on exception handling (though if gdb has trouble with that, it'll have trouble with GDB 7.0 released
longjmp
too.)
Forget longjmp. With the debugging information currently supplied in all released GCCs, GDB has trouble with variables that transition between registers and memory more than once (i.e. most of them in complex functions). The var-tracking branch for GCC should fix this, hopefully.
GDB 7.0 released
It would be better to have multiple entry points
into a single routine, but we don't have support for that yet in the
back-end, and we can always change the method used later without
breaking the ABI.
but nobody ever implemented this, so when you set a breakpoint in a constructor it ends up in two places, not one, and this confuses the hell out of most GDBs.
GDB 7.0 released
GDB 7.0 released
GDB 7.0 released
GDB 7.0 released
GDB 7.0 released
A lot of that is GCC's fault, really. GDB can only present the information present in the debug info, so if GCC is just slapping in the fully expanded instantiated types, then that's all GDB can give the user.
GDB 7.0 released
GDB can only present the information present in the debug info, so if GCC is just slapping in the fully expanded instantiated types, then that's all GDB can give the user.
GDB 7.0 released