[PATCH] gdb/python: add gdb.history_count function

Tom Tromey tom@tromey.com
Wed Jan 26 15:13:11 GMT 2022


>>>>> "Andrew" == Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> writes:

Andrew> Add a new function gdb.history_count to the Python api, this function
Andrew> returns an integer, the number of items in GDB's value history.

Andrew> This is useful if you want to pull items from the history by their
Andrew> absolute number, for example, if you wanted to show a complete history
Andrew> list.  Previously we could figure out how many items are in the
Andrew> history list by trying to fetch the items, and then catching the
Andrew> exception when the item is not available, but having this function
Andrew> seems nicer.

Looks good to me, thank you.

Tom


More information about the Gdb-patches mailing list