public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug backtrace/9829] New: add switch/param to make bt/backtrace print name of binary for each frame
@ 2009-02-09 13:12 mnemo at minimum dot se
  2009-02-09 15:05 ` [Bug backtrace/9829] " mnemo at minimum dot se
  0 siblings, 1 reply; 4+ messages in thread
From: mnemo at minimum dot se @ 2009-02-09 13:12 UTC (permalink / raw)
  To: gdb-prs

When there is no symbols gdb prints backtraces as "f() in blah.so" for exported
symbols and "?? in blah.so" for non-exported symbols (I think).
Anyway, once I have symbols it instead prints "f() at utils.c:42" which is
great, however, often I still want the name of the binary that holds this function.

A pretty common use case for me is to find a SEGV in some random complex program
on Ubuntu (a program that I use a lot but that I don't do development on) and I
run it in gdb and I find a backtrace that runs through several libraries. For
example, "evolution" calling into "libmailstuff" which calls into "glib". Often
I can guess where the bug is based on the backtrace (for example I know the bug
is probably not in malloc() inside glibc and usually not in glib either).

So basically my next step is to look at the code for the function above malloc()
or whatever in the backtrace. Suppose the frame I find interesting is inside a
library which has symbols installed so it's is printed like this "f() at
utils.c:42". Now I have no way of knowing what package I should "apt-get source
PKG" to find the yadayada.c file.

If gdb instead printed "f() at utils.c:42 from some_binary.so" then I
could just do "dpkg -S some_binary.so" and quickly I would directly know
where to continue my investigation.

Basically I think there is an implicit assumption that gdb is only used to debug
programs that you wrote yourself (and hence you'd know what libraries are linked
and which functions goes into what library etc) but honestly I think gdb is
being used a lot today by people who don't really have this type of info. In
particular all the automatic crash reports in ubuntu have stacks generated by
gdb and the people triaging these bugs almost certain don't have detailed info
about each program bugs are found inside.

So, please can you add some switch/parameter to the "bt" command so
that it also prints the name of the binary?

-- 
           Summary: add switch/param to make bt/backtrace print name of
                    binary for each frame
           Product: gdb
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: backtrace
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: mnemo at minimum dot se
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=9829

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2024-03-15  9:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-9829-4717@http.sourceware.org/bugzilla/>
2013-02-01 20:49 ` [Bug backtrace/9829] add switch/param to make bt/backtrace print name of binary for each frame tromey at redhat dot com
2022-06-26 10:08 ` trass3r at gmail dot com
2024-03-15  9:17 ` sam at gentoo dot org
2009-02-09 13:12 [Bug backtrace/9829] New: " mnemo at minimum dot se
2009-02-09 15:05 ` [Bug backtrace/9829] " mnemo at minimum dot se

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