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/NEWS | |
parent | 2f47f48fe55eb72bfe4d3c5291a74f4a53121c5e (diff) | |
download | gdb-13cd9bceea3c3a3081c463597146a11ade765e39.zip gdb-13cd9bceea3c3a3081c463597146a11ade765e39.tar.gz gdb-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/NEWS')
-rw-r--r-- | gdb/NEWS | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -100,6 +100,10 @@ show remote thread-options-packet objects can still be obtained through calling other API functions, for example 'gdb.current_progspace()'. + ** User defined attributes can be added to a gdb.Inferior object, + these will be stored in the object's new Inferior.__dict__ + attribute. + * Debugger Adapter Protocol changes ** GDB now emits the "process" event. |