diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-01-04 16:46:40 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-01-12 11:21:30 +0000 |
commit | 13cd9bceea3c3a3081c463597146a11ade765e39 (patch) | |
tree | 8c2a7b96be594b13b55b320d17d89468303016a2 /gdb/python/python-internal.h | |
parent | 2f47f48fe55eb72bfe4d3c5291a74f4a53121c5e (diff) | |
download | binutils-13cd9bceea3c3a3081c463597146a11ade765e39.zip binutils-13cd9bceea3c3a3081c463597146a11ade765e39.tar.gz binutils-13cd9bceea3c3a3081c463597146a11ade765e39.tar.bz2 |
gdb/python: Add gdb.Inferior.__dict__ attribute
The gdb.Objfile, gdb.Progspace, and gdb.Type Python types already have
a __dict__ attribute, which allows users to create user defined
attributes within the objects. This is useful if the user wants to
cache information within an object.
This commit adds the same functionality to the gdb.Inferior type.
After this commit there is a new gdb.Inferior.__dict__ attribute,
which is a dictionary. A user can, for example, do this:
(gdb) pi
>>> i = gdb.selected_inferior()
>>> i._user_attribute = 123
>>> i._user_attribute
123
>>>
There's a new test included.
Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/python/python-internal.h')
0 files changed, 0 insertions, 0 deletions