C++ Typedefs and symbol tables

Daniel Jacobowitz drow@false.org
Mon Aug 20 18:23:00 GMT 2007


On Mon, Aug 20, 2007 at 07:11:52PM +0100, Andrew STUBBS wrote:
> Daniel Jacobowitz wrote:
> > Symbols come from .debug_info and have type information.  minsyms come
> > from the ELF .symtab section, and do not.
> 
> Ah, OK. How do I determine this, and how do I get it to use the proper symbols 
> if it has chosen the wrong ones?

Sorry, there's no easy answer to either of these questions.

> I know that the debug info contains the definition given in the source - at 
> least for one example I looked at, anyway. It couldn't have arrived at the 
> version given by 'info functions' without canonicalizing the debug info, so I 
> assume it must be using the (already canonical) minsyms only.

Often the minsym's name is used even when dealing with the full
symbol.  I worked on stopping this, and I hope I will have a chance to
try again soon.  You can find more information by searching for
DW_AT_MIPS_linkage_name.

> > 2-3 typenames is not typical, in C++ programs.  It added around 30%
> > time in my testing.
> 
> Oh? I'm talking about converting something like
> 
> 	Int32 f(Bp,Int16)
>  to
> 	int f(B*,short)
> 
> (where Bp is an example of a typedef), and only for parameters given to 
> breakpoint commands and the like.
> 
> There's only 3 types in that (four if you count the function type), and 
> breakpoint commands wouldn't come up _too_ often, so surely it couldn't take 
> that much time?
> 
> Surely we are talking at cross-purposes?

That is not at all a typical function name for a typical C++ program
:-)  In my experience most programs that bother to write in C++ do it
with intention of taking advantage of templates, and this blows up the
number of type signatures in function names dramatically.  Even
namespaces and classes do so.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb mailing list