diff options
author | Andrew Burgess <aburgess@redhat.com> | 2022-01-24 15:19:43 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2022-01-26 21:58:12 +0000 |
commit | 30a87e90be195dcce555a0904cc5dbd960349271 (patch) | |
tree | 0d2c98c5a8416afabe6a39e141928b1fb15d0a56 /gdb/doc | |
parent | 51d185a65f3679f887d456e20d22475ac8586938 (diff) | |
download | binutils-gdb-30a87e90be195dcce555a0904cc5dbd960349271.tar.gz |
gdb/python: add gdb.history_count function
Add a new function gdb.history_count to the Python api, this function
returns an integer, the number of items in GDB's value history.
This is useful if you want to pull items from the history by their
absolute number, for example, if you wanted to show a complete history
list. Previously we could figure out how many items are in the
history list by trying to fetch the items, and then catching the
exception when the item is not available, but having this function
seems nicer.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/python.texi | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi index 39bf6e8884d..f1d18272963 100644 --- a/gdb/doc/python.texi +++ b/gdb/doc/python.texi @@ -387,6 +387,11 @@ as its result, then placing the value into the history will allow the user convenient access to those values via CLI history facilities. @end defun +@defun gdb.history_count () +Return an integer indicating the number of values in @value{GDBN}'s +value history (@pxref{Value History}). +@end defun + @findex gdb.convenience_variable @defun gdb.convenience_variable (name) Return the value of the convenience variable (@pxref{Convenience |