Bug 9838 - Add "friendly stack view" feature
Summary: Add "friendly stack view" feature
Status: UNCONFIRMED
Alias: None
Product: gdb
Classification: Unclassified
Component: backtrace (show other bugs)
Version: 6.8
: P2 enhancement
Target Milestone: 6.8
Assignee: Not yet assigned to anyone
URL:
Keywords: archer
: 15225 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-02-12 00:55 UTC by Daniel Santos
Modified: 2013-05-31 18:16 UTC (History)
2 users (show)

See Also:
Host: all
Target: all
Build: all
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Santos 2009-02-12 00:55:50 UTC
For C and C++, a friendly stack view feature could really be handy, especially
when troubleshooting odd issues where the need to examine the stack and
disassembly more closely is required.  I haven't tried the /m feature yet for
the new enhanced disassembly (src + disassembly), but here's my basic idea.

The command would be something like "info friendly-frame" or "info ff", whatever
(or maybe a modified "info frame" output).  The output would be the contents of
the stack in a format something like the following:

sp+0x<offset> <raw bytes in hex> <alignment padding>[<C/C++ type>] <C/C++
variable name>=<value>[<additional value information>]

So if I happen to have some C code that looks like this and I break on line 4:
1 int main(int argc, char *argv[]) {
2     int jack = 1;
3     int *pjack = &jack;
4     printf("stuff\n");
5 }

if I'm debuging at line  4 and I invoke this command ("info ff" or something),
this would be a possible output format (and I don't know the real order these
would appear in the assembly, so ignore any errors there)
sp+

(gdb) info friendly-stack (or just "stack" after specifying something to say it
should be friendly)

sp+0x00: ef be ad de 00 00 00 00 int* pjack=0xdeadbeef
sp+0x08: 01 00 00 00             int  jack =1

So here, "0x00000000deadbeef" a fictional pointer.  This could be helpful in a
lot of debugging situations.
Comment 1 Tom Tromey 2013-05-31 18:16:41 UTC
*** Bug 15225 has been marked as a duplicate of this bug. ***