binutils-gdb/gdb/testsuite/gdb.python
Andrew Burgess 90fe61ced1 gdb/python: don't use the 'p' format for parsing args
When running the gdb.python/py-arch.exp tests on a GDB built
against Python 2 I ran into some errors.  The problem is that this
test script exercises the gdb.Architecture.integer_type method, and
this method uses 'p' as an argument format specifier in a call to
gdb_PyArg_ParseTupleAndKeywords.

Unfortunately this specified was only added in Python 3.3, so will
cause an error for earlier versions of Python.

This commit switches to use the 'O' specifier to collect a PyObject,
and then uses PyObject_IsTrue to convert the object to a boolean.

An earlier version of this patch incorrectly switched from using 'p'
to use 'i', however, it was pointed out during review that this would
cause some changes in behaviour, for example both of these will work
with 'p', but not with 'i':

  gdb.selected_inferior().architecture().integer_type(32, None)
  gdb.selected_inferior().architecture().integer_type(32, "foo")

The new approach of using 'O' works fine with these cases.  I've added
some new tests to cover both of the above.

There should be no user visible changes after this commit.
2021-11-30 15:46:09 +00:00
..
amd64-py-framefilter-invalidarg.S Replace the symbol needs evaluator with a parser 2021-08-05 16:35:02 +01:00
compare-enum-type-a.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
compare-enum-type-b.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
compare-enum-type.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
compare-enum-type.h Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
flexible-array-member.c gdb: fix getting range of flexible array member in Python 2021-04-22 15:01:28 -04:00
flexible-array-member.exp gdb/testsuite: adjust gdb.python/flexible-array-member.exp expected pattern 2021-05-04 11:20:19 -04:00
lib-types.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
lib-types.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
libpy-autoloaded-pretty-printers-in-newobjfile-event.so-gdb.py gdb: do autoload before notifying Python side in new_objfile event 2021-04-27 11:22:32 -04:00
py-arch-reg-groups.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-arch-reg-names.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-arch.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-arch.exp gdb/python: don't use the 'p' format for parsing args 2021-11-30 15:46:09 +00:00
py-as-string.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-as-string.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-auto-load-chaining-f1.c gdb: use make_scoped_restore to restore gdbpy_current_objfile 2021-03-15 09:21:37 +00:00
py-auto-load-chaining-f1.o-gdb.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-auto-load-chaining-f2.c gdb: use make_scoped_restore to restore gdbpy_current_objfile 2021-03-15 09:21:37 +00:00
py-auto-load-chaining-f2.o-gdb.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-auto-load-chaining.c gdb: use make_scoped_restore to restore gdbpy_current_objfile 2021-03-15 09:21:37 +00:00
py-auto-load-chaining.exp gdb: use make_scoped_restore to restore gdbpy_current_objfile 2021-03-15 09:21:37 +00:00
py-autoloaded-pretty-printers-in-newobjfile-event-lib.cc gdb: do autoload before notifying Python side in new_objfile event 2021-04-27 11:22:32 -04:00
py-autoloaded-pretty-printers-in-newobjfile-event-lib.h gdb: do autoload before notifying Python side in new_objfile event 2021-04-27 11:22:32 -04:00
py-autoloaded-pretty-printers-in-newobjfile-event-main.cc gdb: do autoload before notifying Python side in new_objfile event 2021-04-27 11:22:32 -04:00
py-autoloaded-pretty-printers-in-newobjfile-event.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-autoloaded-pretty-printers-in-newobjfile-event.py gdb: do autoload before notifying Python side in new_objfile event 2021-04-27 11:22:32 -04:00
py-bad-printers.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-bad-printers.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-bad-printers.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-block.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-block.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-breakpoint-create-fail.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-breakpoint-create-fail.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-breakpoint-create-fail.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-breakpoint.c gdb/python: allow for catchpoint type breakpoints in python 2021-06-25 18:22:07 +01:00
py-breakpoint.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-caller-is.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-caller-is.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-cmd.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-cmd.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-completion.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-completion.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-connection.c gdb/python: introduce gdb.TargetConnection object type 2021-11-30 12:10:33 +00:00
py-connection.exp gdb/python: add gdb.RemoteTargetConnection.send_packet 2021-11-30 12:10:40 +00:00
py-error.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-error.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-events-shlib.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-events.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-events.exp gdb/python: add a new gdb_exiting event 2021-10-05 10:05:40 +01:00
py-events.py gdb/python: add a new gdb_exiting event 2021-10-05 10:05:40 +01:00
py-evsignal.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-evthreads.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-evthreads.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-explore-cc.exp gdb/testsuite: make test names unique in gdb.python/py-explore-cc.exp 2021-03-12 12:18:33 +00:00
py-explore.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-explore.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-explore.exp gdb/testsuite: make test names unique in gdb.python/py-explore.exp 2021-03-12 12:18:33 +00:00
py-finish-breakpoint2.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-finish-breakpoint2.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-finish-breakpoint2.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-finish-breakpoint.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-finish-breakpoint.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-finish-breakpoint.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-format-string.c gdb: fix pretty printing max depth behaviour 2021-05-14 06:51:21 +01:00
py-format-string.exp gdb: fix pretty printing max depth behaviour 2021-05-14 06:51:21 +01:00
py-format-string.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-frame-args.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-frame-args.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-frame-args.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-frame-inline.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-frame-inline.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-frame.c
py-frame.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-framefilter-addr.c gdb/python: fix FrameDecorator regression on Python 2 2021-03-16 09:31:56 +00:00
py-framefilter-addr.exp gdb/python: fix FrameDecorator regression on Python 2 2021-03-16 09:31:56 +00:00
py-framefilter-addr.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-framefilter-gdb.py gdb/testsuite: rename .py.in files to .py 2021-05-17 14:58:26 -04:00
py-framefilter-invalidarg-gdb.py gdb/testsuite: rename .py.in files to .py 2021-05-17 14:58:26 -04:00
py-framefilter-invalidarg.exp gdb/testsuite: rename .py.in files to .py 2021-05-17 14:58:26 -04:00
py-framefilter-invalidarg.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-framefilter-mi.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-framefilter-mi.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-framefilter.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-framefilter.exp gdb/testsuite: rename .py.in files to .py 2021-05-17 14:58:26 -04:00
py-framefilter.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-function.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-inferior-leak.c gdb/python: fix memory leak in python inferior code 2021-10-05 14:26:17 +01:00
py-inferior-leak.exp gdb/testsuite: check the python module is available before using it 2021-11-30 13:05:57 +00:00
py-inferior-leak.py gdb/python: fix memory leak in python inferior code 2021-10-05 14:26:17 +01:00
py-inferior.c
py-inferior.exp gdb/python: introduce gdb.TargetConnection object type 2021-11-30 12:10:33 +00:00
py-infthread.c
py-infthread.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-lazy-string.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-lazy-string.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-linetable.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-linetable.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-linetable.S Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-lookup-type.exp gdb/testsuite: remove a duplicate test 2021-03-12 12:18:33 +00:00
py-mi-events-gdb.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-mi-events.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-mi-events.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-mi-objfile-gdb.py Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-mi-objfile.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-mi-objfile.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-mi-var-info-path-expression.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-mi-var-info-path-expression.exp Avoid crash in varobj deletion 2021-08-02 07:46:30 -06:00
py-mi-var-info-path-expression.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-mi.exp [gdb/testsuite] Fix handling of nr_args < 3 in mi_gdb_test 2021-09-10 17:16:48 +02:00
py-nested-maps.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-nested-maps.exp gdb: fix pretty printing max depth behaviour 2021-05-14 06:51:21 +01:00
py-nested-maps.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-objfile-script-gdb.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-objfile-script.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-objfile-script.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-objfile.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-objfile.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-parameter.exp gdb/testsuite: split gdb.python/py-parameter.exp in procs 2021-07-23 15:38:53 -04:00
py-pending-frame-level.c gdb/python: add PendingFrame.level and Frame.level methods 2021-06-21 16:20:08 +01:00
py-pending-frame-level.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-pending-frame-level.py gdb/python: add PendingFrame.level and Frame.level methods 2021-06-21 16:20:08 +01:00
py-pp-integral.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-pp-integral.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-pp-integral.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-pp-maint.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-pp-maint.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-pp-maint.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-pp-re-notag.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-pp-re-notag.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-pp-re-notag.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-pp-registration.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-pp-registration.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-pp-registration.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-prettyprint.c gdb/testsuite: more testing of pretty printer 'array' display_hint 2021-03-26 17:43:14 +00:00
py-prettyprint.exp gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-prettyprint.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-progspace.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-progspace.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-prompt.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-prompt.exp gdb/testsuite: make test names unique in gdb.python/py-prompt.exp 2021-03-12 12:18:33 +00:00
py-rbreak-func2.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-rbreak.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-rbreak.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-record-btrace-threads.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-record-btrace-threads.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-record-btrace.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-record-btrace.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-record-full.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-record-full.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-recurse-unwind.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-recurse-unwind.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-recurse-unwind.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-rvalue-ref-value-cc.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-rvalue-ref-value-cc.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-section-script.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-section-script.exp gdb: Remove arm-symbianelf support 2021-02-11 07:23:42 +10:30
py-section-script.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-send-packet.c gdb/python: add gdb.RemoteTargetConnection.send_packet 2021-11-30 12:10:40 +00:00
py-send-packet.exp gdb/python: add gdb.RemoteTargetConnection.send_packet 2021-11-30 12:10:40 +00:00
py-send-packet.py gdb/python: add gdb.RemoteTargetConnection.send_packet 2021-11-30 12:10:40 +00:00
py-shared-sl.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-shared.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-shared.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-startup-opt.exp gdb/testsuite: update expected results in gdb.python/py-startup-opt.exp 2021-05-03 12:21:00 +01:00
py-strfns.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-strfns.exp gdb/testsuite: make test names unique in gdb.python/py-strfns.exp 2021-03-12 12:18:33 +00:00
py-symbol-2.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-symbol.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-symbol.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-symtab.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-sync-interp.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-sync-interp.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-template.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-template.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-thrhandle.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-thrhandle.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-type.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-type.exp gdb: update Type.fields doc based on actual GDB behavior 2021-05-04 22:19:05 -04:00
py-typeprint.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-typeprint.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-typeprint.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-unwind-inline.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-unwind-inline.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-unwind-inline.py Use is/is not to check for None in python code. 2021-06-08 23:49:05 +01:00
py-unwind-maint.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-unwind-maint.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-unwind-maint.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-unwind-user-regs.c gdb/python: handle saving user registers in a frame unwinder 2021-06-21 16:09:05 +01:00
py-unwind-user-regs.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-unwind-user-regs.py gdb/python: handle saving user registers in a frame unwinder 2021-06-21 16:09:05 +01:00
py-unwind.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-unwind.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-unwind.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
py-value-cc.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-value-cc.exp gdb/testsuite: remove duplicate test from gdb.python/py-value-cc.exp 2021-03-12 12:18:34 +00:00
py-value.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-value.exp gdb/testsuite: make runto_main not pass no-message to runto 2021-09-30 15:27:39 -04:00
py-xmethods.cc Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-xmethods.exp Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
py-xmethods.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
python-1.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
python.c Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
python.exp [gdb/testsuite] Require use_gdb_stub == 0 where appropriate 2021-10-13 11:06:36 +02:00
source1 Update copyright year range in all GDB files 2021-01-01 12:12:21 +04:00
source2.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
tui-window-disabled.c gdb: return true in TuiWindow.is_valid only if TUI is enabled 2021-02-08 11:56:16 +00:00
tui-window-disabled.exp [gdb/testsuite] Add missing skip_tui_tests 2021-07-14 06:52:44 +02:00
tui-window-disabled.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00
tui-window.exp [gdb/testsuite] Add missing skip_tui_tests 2021-07-14 06:52:44 +02:00
tui-window.py gdb: re-format Python files using black 21.4b0 2021-05-07 10:56:20 -04:00