[0/3] Python/TUI Window Creation / Destruction Fixes

Message ID cover.1673550880.git.aburgess@redhat.com
Headers
Series Python/TUI Window Creation / Destruction Fixes |

Message

Andrew Burgess Jan. 12, 2023, 7:19 p.m. UTC
  Patch #1 started with an observation that the behaviour of
gdb.register_window_type doesn't appear to exactly match up with the
documentation.

While fixing this I observed that the destruction of Python window
factory callbacks (as used by gdb.register_window_type) is
inconsistent, and that GDB knowingly leaks some memory in this area
too.  Patches #2 and #3 fix this and make the destruction behaviour
consistent.

All feedback welcome.

Thanks,
Andrew

---

Andrew Burgess (3):
  gdb/python: allow Python TUI windows to be replaced
  gdb/python: deallocate tui window factories at Python shut down
  gdb/tui: don't leak the known_window_types map

 gdb/python/py-tui.c                           |  52 +++++++-
 gdb/python/python-internal.h                  |   1 +
 gdb/python/python.c                           |   1 +
 .../gdb.python/tui-window-factory.exp         | 112 ++++++++++++++++++
 .../gdb.python/tui-window-factory.py          |  48 ++++++++
 gdb/tui/tui-layout.c                          |  39 +++---
 6 files changed, 232 insertions(+), 21 deletions(-)
 create mode 100644 gdb/testsuite/gdb.python/tui-window-factory.exp
 create mode 100644 gdb/testsuite/gdb.python/tui-window-factory.py


base-commit: 1a26a53a0dee39106ba58fcb15496c5f13074652