[0/3] New mechanism to initialise Python components in GDB

Message ID cover.1664729134.git.aburgess@redhat.com
Headers
Series New mechanism to initialise Python components in GDB |

Message

Andrew Burgess Oct. 2, 2022, 4:53 p.m. UTC
  This series is a rewrite of how we initialise Python components within
GDB.  Patch #3 is where the actual change took place.

Patches #1 and #2 relate to dependencies between different Python
components.  Currently there are two pairs of components that have an
initialisation order dependency.  The change I propose in patch #3
revealed these dependencies which I think are otherwise pretty hidden.
In patches #1 and #2 I've tweaked things so these dependencies are now
(I think) more explicit.

This is a pure refactoring project.  I've had a rough outline of patch
#3 kicking about for a while, but I recently thought I would need to
add a new Python component finalize function (similar to
gdbpy_finalize_micommands), so took the time to finish this series
off...

... then it turned out I didn't need to add a new finalize function at
all.

Personally, I think this is an improvement, so I'm posting it, but I'd
love to hear others thoughts.

Thanks,
Andrew

---

Andrew Burgess (3):
  gdb/python: break dependencies between gdbpy_initialize_* functions
  gdb/python: break more dependencies between gdbpy_initialize_*
    functions
  gdb/python: add gdbpy_register_subsystem mechanism

 gdb/python/py-arch.c             |  11 ++-
 gdb/python/py-auto-load.c        |   9 ++-
 gdb/python/py-block.c            |   9 ++-
 gdb/python/py-breakpoint.c       |  30 ++++++--
 gdb/python/py-cmd.c              |   9 ++-
 gdb/python/py-connection.c       |   4 +-
 gdb/python/py-disasm.c           |  11 ++-
 gdb/python/py-event.c            |   9 ++-
 gdb/python/py-evtregistry.c      |   9 ++-
 gdb/python/py-finishbreakpoint.c |  14 +++-
 gdb/python/py-frame.c            |   9 ++-
 gdb/python/py-function.c         |   9 ++-
 gdb/python/py-gdb-readline.c     |  10 ++-
 gdb/python/py-inferior.c         |  11 ++-
 gdb/python/py-infthread.c        |  11 ++-
 gdb/python/py-instruction.c      |  50 +++++++++++---
 gdb/python/py-instruction.h      |  13 ++--
 gdb/python/py-lazy-string.c      |   9 ++-
 gdb/python/py-linetable.c        |   9 ++-
 gdb/python/py-membuf.c           |  11 ++-
 gdb/python/py-micmd.c            |   9 ++-
 gdb/python/py-objfile.c          |   9 ++-
 gdb/python/py-param.c            |   9 ++-
 gdb/python/py-progspace.c        |   9 ++-
 gdb/python/py-record-btrace.c    |   9 ++-
 gdb/python/py-record.c           |  11 ++-
 gdb/python/py-registers.c        |  11 ++-
 gdb/python/py-symbol.c           |   9 ++-
 gdb/python/py-symtab.c           |   9 ++-
 gdb/python/py-tui.c              |   9 ++-
 gdb/python/py-type.c             |   9 ++-
 gdb/python/py-unwind.c           |  34 +++++----
 gdb/python/py-value.c            |   9 ++-
 gdb/python/py-xmethods.c         |   9 ++-
 gdb/python/python-internal.h     | 114 ++++++++++++-------------------
 gdb/python/python.c              |  73 ++++++++++----------
 36 files changed, 427 insertions(+), 172 deletions(-)