public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* gdb backtrace include library as well as symbol name
@ 2011-09-25 22:30 Jon Grant
  2011-09-26  6:33 ` Jan Kratochvil
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Grant @ 2011-09-25 22:30 UTC (permalink / raw)
  To: gdb

Hello

Is there a way to get the "bt" command to output the library or ELF 
binary file that the symbol orginates in? Would be handy if this could 
even be the default:

Short example follows where I kill a process to show the backtrace 
feature in use on my Ubuntu machine.

GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2


$ ulimit -c unlimited

$ /usr/bin/totem &
[1] 3581

$ kill -11 3581
[1]+  Segmentation fault      (core dumped) totem
$ gdb /usr/bin/totem core


<snip>
Core was generated by `totem'.
Program terminated with signal 11, Segmentation fault.
#0  0xb7817424 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7773424 in __kernel_vsyscall ()
#1  0xb665ff76 in poll () from /lib/i386-linux-gnu/libc.so.6
#2  0xb688084b in g_poll () from /lib/i386-linux-gnu/libglib-2.0.so.0
#3  0xb68701af in ?? () from /lib/i386-linux-gnu/libglib-2.0.so.0
#4  0xb687092b in g_main_loop_run () from 
/lib/i386-linux-gnu/libglib-2.0.so.0
#5  0xb6e6bc39 in gtk_main () from /usr/lib/libgtk-x11-2.0.so.0
#6  0xb77ada5f in main ()


#0 Doesn't show lib. I think this is glibc.

#6 Doesn't show the totem binary "/usr/bin/totem"

Please include my email address in any replies.

Best regards, Jon

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

* Re: gdb backtrace include library as well as symbol name
  2011-09-25 22:30 gdb backtrace include library as well as symbol name Jon Grant
@ 2011-09-26  6:33 ` Jan Kratochvil
  2011-09-26 15:36   ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kratochvil @ 2011-09-26  6:33 UTC (permalink / raw)
  To: Jon Grant; +Cc: gdb

On Mon, 26 Sep 2011 00:29:50 +0200, Jon Grant wrote:
> Is there a way to get the "bt" command to output the library or ELF
> binary file that the symbol orginates in? Would be handy if this
> could even be the default:

Yes, this is common RFE.  It was discussed in the thread:
	Re: [patch] GDB 7.2: new feature for "backtrace" that cuts path to file (remain filename)
	http://sourceware.org/ml/gdb-patches/2011-07/msg00796.html


> #0  0xb7773424 in __kernel_vsyscall ()
> #0 Doesn't show lib. I think this is glibc.

It is Linux kernel provided [vdso], it has DWARF info.


Regards,
Jan

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

* Re: gdb backtrace include library as well as symbol name
  2011-09-26  6:33 ` Jan Kratochvil
@ 2011-09-26 15:36   ` Joel Brobecker
  2011-10-05 18:47     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Joel Brobecker @ 2011-09-26 15:36 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: Jon Grant, gdb

> > Is there a way to get the "bt" command to output the library or ELF
> > binary file that the symbol orginates in? Would be handy if this
> > could even be the default:
> 
> Yes, this is common RFE.  It was discussed in the thread:
> 	Re: [patch] GDB 7.2: new feature for "backtrace" that cuts path to file (remain filename)
> 	http://sourceware.org/ml/gdb-patches/2011-07/msg00796.html

I understood that thread as being something slightly different.
But what's being asked here is that the name of the exe being
debugged be printed for symbols in the main exe. This is the only
time as far as I known when the name of the objfile is not
printed, so I think that the current output is fine.

There has been a project of decorated backtraces, which allows
a user to enhance them via Python. Have you looked at this project?
Not sure if this project made it to the main repository, of if
it is still only in Archer, though.

> > #0  0xb7773424 in __kernel_vsyscall ()
> > #0 Doesn't show lib. I think this is glibc.
> 
> It is Linux kernel provided [vdso], it has DWARF info.

To complete what Jan said, it is in memory, but does not have
a corresponding file.

-- 
Joel

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

* Re: gdb backtrace include library as well as symbol name
  2011-09-26 15:36   ` Joel Brobecker
@ 2011-10-05 18:47     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2011-10-05 18:47 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Jan Kratochvil, Jon Grant, gdb

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Jan> Yes, this is common RFE.  It was discussed in the thread:
Jan> Re: [patch] GDB 7.2: new feature for "backtrace" that cuts
Jan> path to file (remain filename)
Jan> http://sourceware.org/ml/gdb-patches/2011-07/msg00796.html

Joel> I understood that thread as being something slightly different.
Joel> But what's being asked here is that the name of the exe being
Joel> debugged be printed for symbols in the main exe. This is the only
Joel> time as far as I known when the name of the objfile is not
Joel> printed, so I think that the current output is fine.

I think it would be a decent addition.

What happened to the patch which Jan references?  It also seemed like a
good idea, or at least a good one once minor changes were made.

Joel> There has been a project of decorated backtraces, which allows
Joel> a user to enhance them via Python. Have you looked at this project?
Joel> Not sure if this project made it to the main repository, of if
Joel> it is still only in Archer, though.

Phil is reimplementing this in a better way.

Tom

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

end of thread, other threads:[~2011-10-05 18:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-25 22:30 gdb backtrace include library as well as symbol name Jon Grant
2011-09-26  6:33 ` Jan Kratochvil
2011-09-26 15:36   ` Joel Brobecker
2011-10-05 18:47     ` Tom Tromey

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).