Changing "info frame" output?

Andrew Cagney cagney@gnu.org
Wed Nov 3 16:28:00 GMT 2004


Hello,

GDB's current info frame output looks like:

Stack level 1, frame at 0x7ffff290:
  pc = 0x1005e5f8 in fprintf_filtered 
(/home/scratch/GDB/src/gdb/utils.c:2231);
     saved pc 0x1005a6b8
  called by frame at 0x7ffff2b0, caller of frame at 0x7ffff210
  source language c.
  Arglist at 0x7ffff210, args: stream=0x10465888,
     format=0x1036fe4c "GNU gdb %s\n"
  Locals at 0x7ffff210, Previous frame's sp is 0x7ffff290
  Saved registers:
   pc at 0x7ffff294, lr at 0x7ffff294

I see several problems (some apparent, some not so):

- PC and SP as registers really no longer apply.
Phrases such as ``pc = ...'' and ``saved pc'', and ``Previous frame's 
SP'' should be worded in a more ISA netural way.

- Often there isn't an "Arglist at ..."
Modern architectures often don't push any arguments on the stack so the 
argument address isn't meaningful.

- More register info.
Modern ISAs also save registers in other registers, that should be 
displayed.  That its talking about registers saved by this frame should 
be clarified.

and with that in mind have come up with the following as a draft:

Stack level 1, frame at 0x7ffff240:
  Code at 0x1005e5f8 in fprintf_filtered (stream=0x10467888,
     format=0x10371b74 "GNU gdb %s\n")
     at /home/scratch/PENDING/2004-10-29-full-location/src/gdb/utils.c:2231
  called by frame at 0x7ffff260, caller of frame at 0x7ffff1c0
  Source language c.
  Frame base at 0x7ffff1c0.
  Registers saved by this frame:
     pc at 0x7ffff244, lr at 0x7ffff244

Notice how:

-- source location (second line) uses a more "standard" format
The one printed when switching frames using up/down.  The format 
includes the argment list.  I've also modified it to print "Code at" 
instead of "pc =".

-- the separate ``Arglist at ...'' line is dropped
The actual list is moved to "source location"; while the args address is 
moved to ...

-- a new "Frame base" line
Where applicable frame locals and args addresses are also printed.

-- /Saved registers:/Registered saved by this frame/
And the list can include registers saved in another register (but the 
example doesn't show this).

I'm still wondering:

-- Frame's ID?
Should this be printed - the frame address is the frame ID's address 
already.

-- "saved pc" dropped
Perhaphs it should print "Return address ..."?

thoughts,
Andrew
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: diffs
URL: <http://sourceware.org/pipermail/gdb/attachments/20041103/dfda5c26/attachment.ksh>


More information about the Gdb mailing list