binutils-gdb/gdb/python
Simon Marchi 8e557e52b3 py-breakpoint: Don't use the 'p' PyArg_ParseTupleAndKeywords format specifier
In Python 3, the 'p' format specifier can be passed to
PyArg_ParseTupleAndKeywords to test the argument for truth and convert
it to a boolean value (the p stands for predicate).  However, it is not
available in Python 2, causing this error:

  Traceback (most recent call last):
    File "test.py", line 1, in <module>
      b1 = gdb.Breakpoint("foo", qualified=False)
  TypeError: argument 10 (impossible<bad format char>)

This patch changes it to the 'O' specifier, which returns the Python
object passed in without transformation, and uses PyObject_IsTrue on it.
This is what is done for the other boolean parameters of this function
(internal and temporary).

This fixes the test gdb.python/py-breakpoint.exp for Python 2.

gdb/ChangeLog:

	* python/py-breakpoint.c (bppy_init): Use 'O' format specifier
	for "qualified" and use PyObject_IsTrue.
2017-12-14 15:46:47 -05:00
..
lib/gdb Import sys in gdb/python/lib/gdb/printer/bound_registers.py 2017-03-22 11:22:07 +00:00
py-all-events.def Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-arch.c -Wwrite-strings: Add a PyArg_ParseTupleAndKeywords "const char *" overload 2017-04-05 19:21:36 +01:00
py-auto-load.c Constify add_info 2017-11-07 13:59:09 -07:00
py-block.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-bpevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-breakpoint.c py-breakpoint: Don't use the 'p' PyArg_ParseTupleAndKeywords format specifier 2017-12-14 15:46:47 -05:00
py-cmd.c Constify execute_command 2017-11-07 13:59:09 -07:00
py-continueevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-event-types.def Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-event.c Small event ownership clean up in Python layer 2017-09-11 14:15:21 -06:00
py-event.h Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-events.h Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-evtregistry.c Use gdbpy_ref to simplify some logic 2017-02-10 12:24:32 -07:00
py-evts.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-exitedevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-finishbreakpoint.c Introduce event_location_up 2017-04-12 11:16:17 -06:00
py-frame.c Remove cleanups from find_frame_funname 2017-09-11 16:15:11 -06:00
py-framefilter.c -Wwrite-strings: The Rest 2017-04-05 19:21:37 +01:00
py-function.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-gdb-readline.c Fix build with GCC 8: strncpy ->strcpy 2017-11-22 12:22:11 +00:00
py-inferior.c Add `thread_from_thread_handle' method to (Python) gdb.Inferior 2017-09-21 11:20:51 -07:00
py-infevents.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-infthread.c Make gdb.selected_thread().inferior return a new reference 2017-10-28 14:19:08 -04:00
py-instruction.c Python: Introduce gdb.Instruction class 2017-05-02 11:35:54 +02:00
py-instruction.h Python: Introduce gdb.Instruction class 2017-05-02 11:35:54 +02:00
py-lazy-string.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-linetable.c Change find_pcs_for_symtab_line to return a std::vector 2017-04-12 11:16:17 -06:00
py-newobjfileevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-objfile.c -Wwrite-strings: Add a PyArg_ParseTupleAndKeywords "const char *" overload 2017-04-05 19:21:36 +01:00
py-param.c Constify add_setshow_* 2017-11-07 13:59:09 -07:00
py-prettyprint.c Change one more spot to use gdbpy_ref 2017-02-10 12:24:33 -07:00
py-progspace.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-record-btrace.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-record-btrace.h Python: Move and rename gdb.BtraceFunction 2017-05-02 11:35:54 +02:00
py-record-full.c python: Implement btrace Python bindings for record history. 2017-02-14 10:57:56 +01:00
py-record-full.h python: Implement btrace Python bindings for record history. 2017-02-14 10:57:56 +01:00
py-record.c Python: Introduce gdb.Instruction class 2017-05-02 11:35:54 +02:00
py-record.h Python: Move and rename gdb.BtraceFunction 2017-05-02 11:35:54 +02:00
py-ref.h Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-signalevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-stopevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-stopevent.h Small event ownership clean up in Python layer 2017-09-11 14:15:21 -06:00
py-symbol.c -Wwrite-strings: Add a PyArg_ParseTupleAndKeywords "const char *" overload 2017-04-05 19:21:36 +01:00
py-symtab.c -Wwrite-strings: Wrap PyGetSetDef for construction with string literals 2017-04-05 19:21:36 +01:00
py-threadevent.c Make it simpler to add events to Python 2017-09-11 14:15:22 -06:00
py-type.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-unwind.c Python unwinder sniffer: PyExc_KeyboardInterrupt -> Quit 2017-11-16 18:44:44 +00:00
py-utils.c Turn gdbpy_ref into a template 2017-02-10 12:24:31 -07:00
py-value.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-varobj.c Avoid some manual memory management in Python 2017-08-03 07:59:07 -06:00
py-xmethods.c Support rvalue references in the gdb python module (includes doc/) 2017-03-20 13:47:52 -07:00
python-config.py
python-internal.h Add `thread_from_thread_handle' method to (Python) gdb.Inferior 2017-09-21 11:20:51 -07:00
python.c Remove some unused variables 2017-12-05 16:05:50 -05:00
python.h