binutils-gdb/gdb/python
Andrew Burgess 8518ce5fc2 gdb/python: missing PyObject_IsTrue error check in bppy_init
As with the previous two commits, this commit fixes a location where
we called PyObject_IsTrue without including an error check, this time
in bppy_init.

The 'qualified' argument is supposed to be a bool, the docs say:

  The optional QUALIFIED argument is a boolean that allows
  interpreting the function passed in 'spec' as a fully-qualified
  name.  It is equivalent to 'break''s '-qualified' flag (*note
  Linespec Locations:: and *note Explicit Locations::).

It's not totally clear that the only valid values are True or False,
but I'm choosing to interpret the docs that way, and so I've added a
PyBool_Type check during argument parsing.  Now, if a non-bool is
passed the user will get a TypeError during argument parsing.  I've
added a test to cover this case.

This is a potentially breaking change to the Python API, but hopefully
this will not impact too many people.  I've added a NEWS entry to
highlight this change.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
2024-11-14 19:34:44 +00:00
..
lib/gdb gdb: fix missing operator % on xmethod matcher output 2024-11-11 08:49:13 -05:00
py-all-events.def Add gdb.events.tui_enabled 2024-11-01 11:06:47 -06:00
py-arch.c gdb/python: missing PyObject_IsTrue error check in py-arch.c 2024-11-14 19:34:43 +00: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 gdb/python: missing PyObject_IsTrue error check in bppy_init 2024-11-14 19:34:44 +00:00
py-cmd.c [gdb/python] Eliminate GDB_PY_SET_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-connection.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02: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 gdb/python: remove some additional PyObject_IsTrue calls 2024-11-14 19:34:43 +00:00
py-event-types.def Add gdb.events.tui_enabled 2024-11-01 11:06:47 -06: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
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 [gdb/python] Eliminate GDB_PY_SET_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-frame.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-framefilter.c Add line-number styling 2024-09-30 13:23:35 -06:00
py-function.c Call gdbpy_fix_doc_string_indentation for function help 2024-11-11 07:44:27 -07:00
py-gdb-readline.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-inferior.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-infevents.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-infthread.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-instruction.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-instruction.h
py-lazy-string.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-linetable.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-membuf.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-mi.c Require a command argument in gdb.execute_mi 2024-10-18 11:50:27 -06:00
py-micmd.c gdb/python: missing PyObject_IsTrue error check in micmdpy_set_installed 2024-11-14 19:34:44 +00:00
py-newobjfileevent.c gdb, gdbserver, gdbsupport: remove includes of early headers 2024-03-26 21:13:22 -04:00
py-objfile.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-param.c [gdb/python] Eliminate GDB_PY_SET_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-prettyprint.c Automatically add types to Python modules 2024-09-23 13:44:59 -06:00
py-progspace.c gdb/python: implement Python find_exec_by_build_id hook 2024-11-10 10:18:23 +00:00
py-record-btrace.c btrace: Add support for interrupt events. 2024-09-24 14:22:28 +02: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
py-record.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-record.h python: Introduce gdb.RecordAuxiliary class. 2024-08-14 11:20:56 +02:00
py-ref.h
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] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-stopevent.h
py-symbol.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02: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 Add gdb.events.tui_enabled 2024-11-01 11:06:47 -06:00
py-type.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-uiout.h Add line-number styling 2024-09-30 13:23:35 -06:00
py-unwind.c [gdb/python] Eliminate GDB_PY_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
py-utils.c [gdb/python] Make sure python sys.exit makes gdb exit 2024-09-25 19:29:57 +02:00
py-value.c gdb/python: remove some additional PyObject_IsTrue calls 2024-11-14 19:34:43 +00: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 [gdb/python] Eliminate GDB_PY_SET_HANDLE_EXCEPTION 2024-09-24 13:06:32 +02:00
python.c gdb/python: remove PyObject_IsTrue call in gdbpy_handle_missing_debuginfo 2024-11-14 19:34:43 +00:00
python.h