aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-01-24 15:19:43 +0000
committerAndrew Burgess <aburgess@redhat.com>2022-01-26 21:58:12 +0000
commit30a87e90be195dcce555a0904cc5dbd960349271 (patch)
tree0d2c98c5a8416afabe6a39e141928b1fb15d0a56 /gdb/value.h
parent51d185a65f3679f887d456e20d22475ac8586938 (diff)
downloadgdb-30a87e90be195dcce555a0904cc5dbd960349271.zip
gdb-30a87e90be195dcce555a0904cc5dbd960349271.tar.gz
gdb-30a87e90be195dcce555a0904cc5dbd960349271.tar.bz2
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/value.h')
-rw-r--r--gdb/value.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h
index f91c5a5..0de4b5f 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -948,6 +948,10 @@ extern void binop_promote (const struct language_defn *language,
extern struct value *access_value_history (int num);
+/* Return the number of items in the value history. */
+
+extern ULONGEST value_history_count ();
+
extern struct value *value_of_internalvar (struct gdbarch *gdbarch,
struct internalvar *var);