This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug backtrace/9829] New: add switch/param to make bt/backtrace print name of binary for each frame


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]