aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc/python.texi
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-05-26 22:01:59 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-06-21 16:20:08 +0100
commitd52b8007213eea4d1f33e3a604481f390d37b52a (patch)
tree07158fe01e4d4d0edc2bf3e043d13198cb21d96e /gdb/doc/python.texi
parent8b9c48b287d42d1c816f441e4273dcb8c7af1876 (diff)
downloadgdb-d52b8007213eea4d1f33e3a604481f390d37b52a.zip
gdb-d52b8007213eea4d1f33e3a604481f390d37b52a.tar.gz
gdb-d52b8007213eea4d1f33e3a604481f390d37b52a.tar.bz2
gdb/python: add PendingFrame.level and Frame.level methods
Add new methods to the PendingFrame and Frame classes to obtain the stack frame level for each object. The use of 'level' as the method name is consistent with the existing attribute RecordFunctionSegment.level (though this is an attribute rather than a method). For Frame/PendingFrame I went with methods as these classes currently only use methods, including for simple data like architecture, so I want to be consistent with this interface. gdb/ChangeLog: * NEWS: Mention the two new methods. * python/py-frame.c (frapy_level): New function. (frame_object_methods): Register 'level' method. * python/py-unwind.c (pending_framepy_level): New function. (pending_frame_object_methods): Register 'level' method. gdb/doc/ChangeLog: * python.texi (Unwinding Frames in Python): Mention PendingFrame.level. (Frames In Python): Mention Frame.level. gdb/testsuite/ChangeLog: * gdb.python/py-frame.exp: Add Frame.level tests. * gdb.python/py-pending-frame-level.c: New file. * gdb.python/py-pending-frame-level.exp: New file. * gdb.python/py-pending-frame-level.py: New file.
Diffstat (limited to 'gdb/doc/python.texi')
-rw-r--r--gdb/doc/python.texi9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index ab934a8..01a2e8b 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -2605,6 +2605,11 @@ for this @code{gdb.PendingFrame}. This represents the architecture of
the particular frame being unwound.
@end defun
+@defun PendingFrame.level ()
+Return an integer, the stack frame level for this frame.
+@xref{Frames, ,Stack Frames}.
+@end defun
+
@subheading Unwinder Output: UnwindInfo
Use @code{PendingFrame.create_unwind_info} method described above to
@@ -4813,6 +4818,10 @@ Set this frame to be the selected frame. @xref{Stack, ,Examining the
Stack}.
@end defun
+@defun Frame.level ()
+Return an integer, the stack frame level for this frame. @xref{Frames, ,Stack Frames}.
+@end defun
+
@node Blocks In Python
@subsubsection Accessing blocks from Python