binutils-gdb/gdb/python
Andrew Burgess 1d586eda5c gdb/python: Add gdb.InferiorThread.__dict__ attribute
The gdb.Objfile, gdb.Progspace, gdb.Type, and gdb.Inferior Python
types already have a __dict__ attribute, which allows users to create
user defined attributes within the objects.  This is useful if the
user wants to cache information within an object.

This commit adds the same functionality to the gdb.InferiorThread
type.

After this commit there is a new gdb.InferiorThread.__dict__
attribute, which is a dictionary.  A user can, for example, do this:

  (gdb) pi
  >>> t = gdb.selected_thread()
  >>> t._user_attribute = 123
  >>> t._user_attribute
  123
  >>>

There's a new test included.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
2024-01-12 11:21:31 +00:00
..
lib/gdb Avoid exception from attach in DAP 2023-12-22 09:57:49 -07:00
py-all-events.def gdb: add Python events for program space addition and removal 2023-10-02 17:06:40 +01:00
py-arch.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-auto-load.c gdb: add program_space parameters to some auto-load functions 2023-10-05 13:20:50 -04:00
py-block.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-bpevent.c Emit stop reason details in Python stop events 2023-12-11 10:51:32 -07:00
py-breakpoint.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-cmd.c gdb/python: display errors from command completion 2023-11-28 18:23:19 +00:00
py-connection.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-continueevent.c
py-dap.c [gdb/dap] Disable DAP for python <= 3.5 2023-08-02 23:14:58 +02:00
py-disasm.c gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
py-event-types.def gdb: add Python events for program space addition and removal 2023-10-02 17:06:40 +01:00
py-event.c
py-event.h gdb: add program_space parameter to emit_clear_objfiles_event 2023-10-05 13:20:50 -04:00
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c Fix gdb.FinishBreakpoint when returning to an inlined function 2023-12-12 15:57:14 +01:00
py-frame.c gdb/python: add gdb.Frame.__repr__() method 2024-01-12 11:21:27 +00:00
py-framefilter.c gdb: Replace gdb::optional with std::optional 2023-11-21 11:52:35 +00:00
py-function.c
py-gdb-readline.c gdb/python: avoid use of _PyOS_ReadlineTState 2023-12-13 10:46:44 +01:00
py-inferior.c gdb/python: Add gdb.Inferior.__dict__ attribute 2024-01-12 11:21:30 +00:00
py-infevents.c
py-infthread.c gdb/python: Add gdb.InferiorThread.__dict__ attribute 2024-01-12 11:21:31 +00:00
py-instruction.c
py-instruction.h
py-lazy-string.c Handle gdb.LazyString in DAP 2023-10-16 09:27:28 -06:00
py-linetable.c
py-membuf.c
py-mi.c Emit stop reason details in Python stop events 2023-12-11 10:51:32 -07:00
py-micmd.c gdb/python: generalize serialize_mi_result() 2023-10-10 11:22:56 +01:00
py-newobjfileevent.c gdb: add program_space parameter to emit_clear_objfiles_event 2023-10-05 13:20:50 -04:00
py-objfile.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-param.c [gdb/build] Fix enum param_types odr violation 2023-08-14 18:32:29 +02:00
py-prettyprint.c Introduce gdb.ValuePrinter 2023-09-26 09:29:14 -06:00
py-progspace.c gdb/python: remove users ability to create gdb.Progspace objects 2024-01-12 11:21:28 +00:00
py-record-btrace.c gdb: remove target_gdbarch 2023-10-10 10:44:35 -04:00
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c
py-record.h
py-ref.h
py-registers.c
py-signalevent.c Emit stop reason details in Python stop events 2023-12-11 10:51:32 -07:00
py-stopevent.c Emit stop reason details in Python stop events 2023-12-11 10:51:32 -07:00
py-stopevent.h Emit stop reason details in Python stop events 2023-12-11 10:51:32 -07:00
py-symbol.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-symtab.c
py-threadevent.c
py-tui.c Add keywords to TuiWindow.write 2023-12-30 12:21:44 -07:00
py-type.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-uiout.h Emit stop reason details in Python stop events 2023-12-11 10:51:32 -07:00
py-unwind.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-utils.c gdb/python: hoist common invalid object repr code into py-utils.c 2024-01-12 11:21:25 +00:00
py-value.c gdb/python: Add new gdb.Value.bytes attribute 2023-10-26 18:27:17 +01:00
py-varobj.c gdb: Use C++17's std::make_unique instead of gdb::make_unique 2023-11-21 11:52:35 +00:00
py-xmethods.c
python-config.py
python-internal.h gdb/python: Add gdb.InferiorThread.__dict__ attribute 2024-01-12 11:21:31 +00:00
python.c gdb: move gdbpy_gil into python-internal.h 2023-12-13 10:46:39 +01:00
python.h