binutils-gdb/gdb/python/lib/gdb
Andrew Burgess 6bf5f25bb1 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>
2023-03-30 10:25:46 +01:00
..
command gdb: reformat Python files with black 23.1.0 2023-02-27 13:28:32 -05:00
dap Implement repl evaluation for DAP 2023-03-24 10:05:51 -06:00
function Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
printer Remove unused imports from gdb's Python code 2023-02-13 10:22:48 -07:00
__init__.py Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
disassembler.py Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
FrameDecorator.py gdb: reformat Python files with black 23.1.0 2023-02-27 13:28:32 -05:00
FrameIterator.py Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
frames.py Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
printing.py Fix formatting in gdb/printing.py 2023-03-15 13:14:14 -06:00
prompt.py Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
styling.py Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
types.py Update copyright year range in header of all files managed by GDB 2023-01-01 17:01:16 +04:00
unwinder.py gdb/python: make the gdb.unwinder.Unwinder class more robust 2023-03-30 10:25:46 +01:00
xmethod.py Remove unused imports from gdb's Python code 2023-02-13 10:22:48 -07:00