Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* C++ Typedefs and symbol tables
@ 2007-08-20 17:11 Andrew STUBBS
  2007-08-20 17:18 ` Daniel Jacobowitz
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew STUBBS @ 2007-08-20 17:11 UTC (permalink / raw)
  To: GDB List

Hi,

I have encountered a problem setting breakpoints on overloaded C++ 
functions: when I specify the function signature, I have to use the 
canonical type name, not the typedef name used in the source I am 
looking at. (I am aware it prompts where no signature is given, but that 
possibility is not available to scripts, for example).

I'm using GDB 6.5 here. Apologies if this is a well known problem I've 
somehow failed to find on Google, or has been fixed since then.

E.g.

class C;
typedef C t;
void f (t);

(gdb) break f(C)    -> OK
(gdb) break f(t)    -> bad

"info functions" lists the function using the name "C". This is 
consistent with nm, so I assume it is getting this from the symbol 
table. I suppose it makes sense that the signature in the symbol table 
uses the canonical name.

The dwarf debug information, on the other hand, shows the function with 
the typedef name used in the source code. It also contains the proper 
mapping from typedef name to actual class name.

Would it not be possible to use the debug information, where available, 
to canonicalize the type names before attempting to match the function 
signatures, at least for the purposes of setting breakpoints?

Thanks

Andrew


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-08-20 18:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-20 17:11 C++ Typedefs and symbol tables Andrew STUBBS
2007-08-20 17:18 ` Daniel Jacobowitz
2007-08-20 17:35   ` Andrew STUBBS
2007-08-20 17:49     ` Daniel Jacobowitz
2007-08-20 18:12       ` Andrew STUBBS
2007-08-20 18:23         ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox