public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* can I check out the class definition from binary?
@ 2005-05-03 17:09 lin q
  2005-05-05  9:51 ` Nick Clifton
  0 siblings, 1 reply; 3+ messages in thread
From: lin q @ 2005-05-03 17:09 UTC (permalink / raw)
  To: binutils

Hi,
  I have a program built on Linux and having problem in debuging it in GDB. 
I am suspecting that its symbol table is not built as expected, meaning the 
debug info is not complete.

  I wonder how to use the binutils to check that. For example I now there is 
a class C1 defined in lib1.so, then how I can print out the definition? I 
just run "nm", but it only print out the names of the symbol table, it does 
not list the class definition.

Thanks.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/

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

* Re: can I check out the class definition from binary?
  2005-05-03 17:09 can I check out the class definition from binary? lin q
@ 2005-05-05  9:51 ` Nick Clifton
  2005-05-05 10:03   ` Dave Korn
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Clifton @ 2005-05-05  9:51 UTC (permalink / raw)
  To: lin q; +Cc: binutils

Hi Lin,

>  I have a program built on Linux and having problem in debuging it in 
> GDB. I am suspecting that its symbol table is not built as expected, 
> meaning the debug info is not complete.

Why do you think that it is not complete ?

>  I wonder how to use the binutils to check that. For example I now there 
> is a class C1 defined in lib1.so, then how I can print out the 
> definition? I just run "nm", but it only print out the names of the 
> symbol table, it does not list the class definition.

If you are using the DWARF debug format then the answer is no.  The 
"readelf" program does have the ability to decode and display DWARF 
debug information, but it will do so at a very low level, rather than 
reconstructing high level information like class types.

If you are using the STABS debug format then you may be in luck.  Try 
using the "objdump" program with the "-g" switch.  This may give you the 
information that you are looking for, although you should be aware that 
the STABS format has some limitations with respect to complex C++ 
classes and so it may not be able to provide you with all of the 
information that you want.

Cheers
   Nick


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

* RE: can I check out the class definition from binary?
  2005-05-05  9:51 ` Nick Clifton
@ 2005-05-05 10:03   ` Dave Korn
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Korn @ 2005-05-05 10:03 UTC (permalink / raw)
  To: 'Nick Clifton', 'lin q'; +Cc: binutils

----Original Message----
>From: Nick Clifton
>Sent: 05 May 2005 10:49

>>  I wonder how to use the binutils to check that. For example I now there
>> is a class C1 defined in lib1.so, then how I can print out the
>> definition? I just run "nm", but it only print out the names of the
>> symbol table, it does not list the class definition.
> 
> If you are using the DWARF debug format then the answer is no.  The
> "readelf" program does have the ability to decode and display DWARF
> debug information, but it will do so at a very low level, rather than
> reconstructing high level information like class types.
> 
> If you are using the STABS debug format then you may be in luck.  Try
> using the "objdump" program with the "-g" switch.  This may give you the
> information that you are looking for, although you should be aware that
> the STABS format has some limitations with respect to complex C++
> classes and so it may not be able to provide you with all of the
> information that you want.


  Or how about using GDB to display the type information ?  The "ptype
CLASSNAME" command should help; at any rate, it should show what class info
appears to be there.


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....

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

end of thread, other threads:[~2005-05-05 10:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-03 17:09 can I check out the class definition from binary? lin q
2005-05-05  9:51 ` Nick Clifton
2005-05-05 10:03   ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).