* Executable's debug format
@ 2004-02-13 0:54 Bob Rossi
2004-02-13 3:03 ` Ian Lance Taylor
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Bob Rossi @ 2004-02-13 0:54 UTC (permalink / raw)
To: gdb
Hi,
Sorry if this is a beginners question ...
Is there a way to find out what debug format the debugging info in the
executable is in?
Or is it more complicated? Can a single executable be composed of object
files which each have there debugging info in a different format?
Bob Rossi
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Executable's debug format
2004-02-13 0:54 Executable's debug format Bob Rossi
@ 2004-02-13 3:03 ` Ian Lance Taylor
2004-02-16 3:32 ` Daniel Jacobowitz
2004-02-13 9:11 ` Eli Zaretskii
2004-02-13 14:48 ` Kris Warkentin
2 siblings, 1 reply; 5+ messages in thread
From: Ian Lance Taylor @ 2004-02-13 3:03 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb
Bob Rossi <bob@brasko.net> writes:
> Is there a way to find out what debug format the debugging info in the
> executable is in?
Yes, but I don't know of a trivial way.
Run objdump -h to see the sections.
If the program has a .debug it is using DWARF 1.
If the program has a .debug_info it is using DWARF 2.
If the program has .stab and .stabstr sections it is using stabs
debugging information.
There are many other possibilities, though those are the most common
these days.
> Or is it more complicated? Can a single executable be composed of object
> files which each have there debugging info in a different format?
Yes, that is possible, though very unusual.
Ian
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Executable's debug format
2004-02-13 3:03 ` Ian Lance Taylor
@ 2004-02-16 3:32 ` Daniel Jacobowitz
0 siblings, 0 replies; 5+ messages in thread
From: Daniel Jacobowitz @ 2004-02-16 3:32 UTC (permalink / raw)
To: Ian Lance Taylor; +Cc: Bob Rossi, gdb
On Thu, Feb 12, 2004 at 10:03:02PM -0500, Ian Lance Taylor wrote:
> > Or is it more complicated? Can a single executable be composed of object
> > files which each have there debugging info in a different format?
>
> Yes, that is possible, though very unusual.
It happens pretty frequently on fairly-but-not-excessively recent
GNU/Linux systems. Some system library will be built against crt*
objects built before GCC's default changed to -gstabs+ and then user
code will use a more recent GCC that prefers -gdwarf-2. In fact, GDB
has had some interesting bugs guessing the address ranges of psymtabs
in such cases.
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Executable's debug format
2004-02-13 0:54 Executable's debug format Bob Rossi
2004-02-13 3:03 ` Ian Lance Taylor
@ 2004-02-13 9:11 ` Eli Zaretskii
2004-02-13 14:48 ` Kris Warkentin
2 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2004-02-13 9:11 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb
> Date: Thu, 12 Feb 2004 19:54:32 -0500
> From: Bob Rossi <bob@brasko.net>
>
> Is there a way to find out what debug format the debugging info in the
> executable is in?
>
> Or is it more complicated? Can a single executable be composed of object
> files which each have there debugging info in a different format?
Yes, it can.
The command "info source" will show you the debug info with which the
current source file (the one where the program counter is now) was
compiled. For example, to see the debug info format for the source
file where your `main' function lives, type these commands:
(gdb) break main
(gdb) run
(gdb) info source
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Executable's debug format
2004-02-13 0:54 Executable's debug format Bob Rossi
2004-02-13 3:03 ` Ian Lance Taylor
2004-02-13 9:11 ` Eli Zaretskii
@ 2004-02-13 14:48 ` Kris Warkentin
2 siblings, 0 replies; 5+ messages in thread
From: Kris Warkentin @ 2004-02-13 14:48 UTC (permalink / raw)
To: Bob Rossi; +Cc: gdb
I usually just run it in gdb. Then 'info source' will tell you which
debug format the particular module your PC in is.
cheers,
Kris
Bob Rossi wrote:
>Hi,
>
>Sorry if this is a beginners question ...
>
>Is there a way to find out what debug format the debugging info in the
>executable is in?
>
>Or is it more complicated? Can a single executable be composed of object
>files which each have there debugging info in a different format?
>
>Bob Rossi
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-02-16 3:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-13 0:54 Executable's debug format Bob Rossi
2004-02-13 3:03 ` Ian Lance Taylor
2004-02-16 3:32 ` Daniel Jacobowitz
2004-02-13 9:11 ` Eli Zaretskii
2004-02-13 14:48 ` Kris Warkentin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox