binutils-gdb/gdb/python
Tom Tromey 336bb2a1c1 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>
2024-09-23 13:44:59 -06:00
..
lib/gdb gdb dap: introduce stopOnEntry option 2024-09-13 14:19:34 -06:00
py-all-events.def Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
py-arch.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-auto-load.c gdb: remove gdbcmd.h 2024-04-25 12:59:02 -04:00
py-block.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-bpevent.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-breakpoint.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-cmd.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-connection.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-continueevent.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-dap.c Don't allow new-ui to start the TUI 2024-05-17 09:39:41 -06:00
py-disasm.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-event-types.def Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
py-event.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-event.h Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-events.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
py-evtregistry.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-evts.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-exitedevent.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-finishbreakpoint.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-frame.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-framefilter.c gdb: drop struct keyword when using bound_minimal_symbol 2024-08-12 10:31:09 -04:00
py-function.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-gdb-readline.c [gdb/python] Use GDB_PY_HANDLE_EXCEPTION more often 2024-08-27 09:20:18 +02:00
py-inferior.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-infevents.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-infthread.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-instruction.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-instruction.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
py-lazy-string.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-linetable.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-membuf.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-mi.c [gdb/python] Use GDB_PY_HANDLE_EXCEPTION more often 2024-08-27 09:20:18 +02:00
py-micmd.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-newobjfileevent.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-objfile.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-param.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-prettyprint.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-progspace.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-record-btrace.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-record-btrace.h python: Add clear() to gdb.Record. 2024-08-14 11:20:56 +02:00
py-record-full.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-record-full.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
py-record.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-record.h python: Introduce gdb.RecordAuxiliary class. 2024-08-14 11:20:56 +02:00
py-ref.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
py-registers.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-signalevent.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-stopevent.c [gdb/python] Use GDB_PY_HANDLE_EXCEPTION more often 2024-08-27 09:20:18 +02:00
py-stopevent.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00
py-symbol.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-symtab.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-threadevent.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-tui.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-type.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-uiout.h gdb: Buffer output streams during events that might download debuginfo 2024-01-19 00:18:00 -05:00
py-unwind.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-utils.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-value.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-varobj.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-xmethods.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
python-config.py Run isort 2024-04-02 11:21:39 -06:00
python-internal.h Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
python.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
python.h Update copyright year range in header of all files managed by GDB 2024-01-12 15:49:57 +00:00