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
py-all-events.def
py-arch.c
py-auto-load.c
py-block.c
py-bpevent.c
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
py-continueevent.c
py-event-types.def
py-event.c
py-event.h
py-events.h
py-evtregistry.c
py-evts.c
py-exitedevent.c
py-finishbreakpoint.c
py-frame.c
py-framefilter.c
py-function.c
py-gdb-readline.c
py-inferior.c
py-infevents.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-infthread.c
py-instruction.c
py-instruction.h
py-lazy-string.c
py-linetable.c
py-newobjfileevent.c
py-objfile.c
py-param.c
py-prettyprint.c
py-progspace.c
py-record-btrace.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-record-btrace.h
py-record-full.c
py-record-full.h
py-record.c
py-record.h
py-ref.h
py-signalevent.c
py-stopevent.c
py-stopevent.h
py-symbol.c
py-symtab.c
py-threadevent.c
py-type.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-unwind.c
py-utils.c
py-value.c Remove some unused variables 2017-12-05 16:05:50 -05:00
py-varobj.c
py-xmethods.c
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