]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Automatically add types to Python modules
authorTom Tromey <tromey@adacore.com>
Wed, 11 Sep 2024 16:35:20 +0000 (10:35 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 23 Sep 2024 19:44:59 +0000 (13:44 -0600)
commit336bb2a1c1d24f5db07394a109f7cd6c5b58b10d
tree5a8d54ecc8d127a2113712203f1c66aa9c5d8c0e
parentb9155b800c6be57a7f4933a4fd8c5c5d51414e77
Automatically add types to Python modules

PR python/32163 points out that various types provided by gdb are not
added to the gdb module, so they aren't available for interactive
inspection.  I think this is just an oversight.

This patch fixes the problem by introducing a new helper function that
both readies the type and then adds it to the appropriate module.  The
patch also poisons PyType_Ready, the idea being to avoid this bug in
the future.

v2:
* Fixed a bug in original patch in gdb.Architecture registration
* Added regression test for the types mentioned in the bug

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32163
Reviewed-By: Alexandra Petlanova Hajkova <ahajkova@redhat.com>
35 files changed:
gdb/python/py-arch.c
gdb/python/py-block.c
gdb/python/py-breakpoint.c
gdb/python/py-cmd.c
gdb/python/py-connection.c
gdb/python/py-disasm.c
gdb/python/py-event.c
gdb/python/py-event.h
gdb/python/py-evtregistry.c
gdb/python/py-finishbreakpoint.c
gdb/python/py-frame.c
gdb/python/py-function.c
gdb/python/py-inferior.c
gdb/python/py-infthread.c
gdb/python/py-instruction.c
gdb/python/py-lazy-string.c
gdb/python/py-linetable.c
gdb/python/py-membuf.c
gdb/python/py-micmd.c
gdb/python/py-objfile.c
gdb/python/py-param.c
gdb/python/py-prettyprint.c
gdb/python/py-progspace.c
gdb/python/py-record-btrace.c
gdb/python/py-record.c
gdb/python/py-registers.c
gdb/python/py-symbol.c
gdb/python/py-symtab.c
gdb/python/py-tui.c
gdb/python/py-type.c
gdb/python/py-unwind.c
gdb/python/py-value.c
gdb/python/python-internal.h
gdb/python/python.c
gdb/testsuite/gdb.python/python.exp