Summary: | add switch/param to make bt/backtrace print name of binary for each frame | ||
---|---|---|---|
Product: | gdb | Reporter: | mnemo |
Component: | backtrace | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | enhancement | CC: | gdb-prs, sam, trass3r, tromey |
Priority: | P2 | ||
Version: | unknown | ||
Target Milestone: | 6.8 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2013-02-01 00:00:00 | |
Attachments: | patch that makes gdb always print the binary for each function |
Description
mnemo
2009-02-09 13:12:49 UTC
Created attachment 3727 [details]
patch that makes gdb always print the binary for each function
I found that it's sufficient to just remove the following if-statement from
gdb/stack.c:729 to make gdb do what I'm talking about. This is the if
statement:
if (!funname || (!sal.symtab || !sal.symtab->filename))
Granted, this does not add a parameter to "bt" it just changes the default
behavior. At least I hope this patch can serve as a starting point.
Note: The condition "(!sal.symtab || !sal.symtab->filename)" is the logical
opposite (according to de morgan's law) to "sal.symtab && sal.symtab->filename"
which should explain why it's okay to drop the !funname part.
I think having this as an optional feature would be good. Maybe we could go a bit farther and let the user specify some kind of format string that would be used when printing frames in "bt". I'm fine with always enabling it in general. Though with line wrapping the output may get a bit crowded. |