From 70175292616118bad315296ba6180f375326bb6c Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 16 Aug 2022 16:48:01 +0100 Subject: gdb: new 'maint print frame-id' command When debugging a certain class of GDB bug, I often end up wanting to know what GDB thinks the frame-id is in a particular frame. It's not too hard to pull this from some debug output, but I thought it might be nice if there was a maintenance command that could tell us. This commit adds 'maint print frame-id' which prints the frame-id of the currently selected frame. You can also pass a frame level number to find the frame-id for a specific frame. There's a new test too. --- gdb/doc/gdb.texinfo | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gdb/doc') diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 82cb1c8..33a56e0 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -40142,6 +40142,23 @@ The program being debugged stopped while in a function called from GDB. Takes an optional file parameter. +@kindex maint print frame-id +@item maint print frame-id +@itemx maint print frame-id @var{level} +Print @value{GDBN}'s internal frame-id for the frame at relative +@var{level}, or for the currently selected frame when @var{level} is +not given. + +If used, @var{level} should be an integer, as displayed in the +@command{backtrace} output. + +@smallexample +(@value{GDBP}) maint print frame-id +frame-id for frame #0: @{stack=0x7fffffffac70,code=0x0000000000401106,!special@} +(@value{GDBP}) maint print frame-id 2 +frame-id for frame #2: @{stack=0x7fffffffac90,code=0x000000000040111c,!special@} +@end smallexample + @kindex maint print registers @kindex maint print raw-registers @kindex maint print cooked-registers -- cgit v1.1