aboutsummaryrefslogtreecommitdiff
path: root/gdb/NEWS
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2023-03-08 16:11:30 +0000
committerAndrew Burgess <aburgess@redhat.com>2023-03-30 10:25:46 +0100
commit6bf5f25bb150c0fbcb125e3ee466ba8f9680310b (patch)
tree55b9ff5bdae08c05721ef8f5030759e4f1fd864d /gdb/NEWS
parentc22d38baefc5a7a1e1f5cdc9dbb556b1f0ec5c57 (diff)
downloadgdb-6bf5f25bb150c0fbcb125e3ee466ba8f9680310b.zip
gdb-6bf5f25bb150c0fbcb125e3ee466ba8f9680310b.tar.gz
gdb-6bf5f25bb150c0fbcb125e3ee466ba8f9680310b.tar.bz2
gdb/python: make the gdb.unwinder.Unwinder class more robust
This commit makes a few related changes to the gdb.unwinder.Unwinder class attributes: 1. The 'name' attribute is now a read-only attribute. This prevents user code from changing the name after registering the unwinder. It seems very unlikely that any user is actually trying to do this in the wild, so I'm not very worried that this will upset anyone, 2. We now validate that the name is a string in the Unwinder.__init__ method, and throw an error if this is not the case. Hopefully nobody was doing this in the wild. This should make it easier to ensure the 'info unwinder' command shows sane output (how to display a non-string name for an unwinder?), 3. The 'enabled' attribute is now implemented with a getter and setter. In the setter we ensure that the new value is a boolean, but the real important change is that we call 'gdb.invalidate_cached_frames()'. This means that the backtrace will be updated if a user manually disables an unwinder (rather than calling the 'disable unwinder' command). It is not unreasonable to think that a user might register multiple unwinders (relating to some project) and have one command that disables/enables all the related unwinders. This command might operate by poking the enabled attribute of each unwinder object directly, after this commit, this would now work correctly. There's tests for all the changes, and lots of documentation updates that both cover the new changes, but also further improve (I think) the general documentation for GDB's Unwinder API. Reviewed-By: Eli Zaretskii <eliz@gnu.org> Reviewed-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/NEWS')
-rw-r--r--gdb/NEWS14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/NEWS b/gdb/NEWS
index d729aa2..a3f7e1c 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -106,6 +106,20 @@ show always-read-ctf
without a thread restriction. The same is also true for the 'task'
field of an Ada task-specific breakpoint.
+* Python API
+
+ ** The gdb.unwinder.Unwinder.name attribute is now read-only.
+
+ ** The name argument passed to gdb.unwinder.Unwinder.__init__ must
+ now be of type 'str' otherwise a TypeError will be raised.
+
+ ** The gdb.unwinder.Unwinder.enabled attribute can now only accept
+ values of type 'bool'. Changing this attribute will now
+ invalidate GDB's frame-cache, which means GDB will need to
+ rebuild its frame-cache when next required - either with, or
+ without the particular unwinder, depending on how 'enabled' was
+ changed.
+
*** Changes in GDB 13
* MI version 1 is deprecated, and will be removed in GDB 14.