binutils-gdb/gdb/testsuite/gdb.python
Andrew Burgess b1f3973b9c gdb/testsuite: more testing of pretty printer 'array' display_hint
This commit adds a couple of tests to the python pretty printer
testing.

I've added a test for the 'array' display hint.  This display hint is
tested by gdb.python/py-mi.exp, however, the MI testing is done via
the varobj interface, and this code makes its own direct calls to the
Python pretty printers from gdb/varobj.c.  What this means is that the
interface to the pretty printers in gdb/python/py-prettyprint.c is not
tested for the 'array' display hint path.

I also added a test for what happens when the display_hint method
raises an exception.  There wasn't a bug that inspired this test, just
while adding the previous test I thought, I wonder what happens if...

The current behaviour of GDB seems reasonable, GDB displays the Python
exception, and then continues printing the value as if display_hint
had returned None.  I added a test to lock in this behaviour.

gdb/testsuite/ChangeLog:

	* gdb.python/py-prettyprint.c (struct container): Add 'is_array_p'
	member.
	(make_container): Initialise is_array_p.
	* gdb.python/py-prettyprint.exp: Add new tests.
	* gdb.python/py-prettyprint.py (ContainerPrinter.display_hint):
	Check is_array_p and possibly return 'array'.
2021-03-26 17:43:14 +00:00
..
amd64-py-framefilter-invalidarg.S
compare-enum-type-a.c
compare-enum-type-b.c
compare-enum-type.exp
compare-enum-type.h
lib-types.cc
lib-types.exp gdb/testsuite: check the correct Python variable in test 2021-03-12 12:18:33 +00:00
py-arch-reg-groups.exp
py-arch-reg-names.exp
py-arch.c
py-arch.exp
py-as-string.c
py-as-string.exp
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: use make_scoped_restore to restore gdbpy_current_objfile 2021-03-15 09:21:37 +00: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: use make_scoped_restore to restore gdbpy_current_objfile 2021-03-15 09:21:37 +00: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-bad-printers.c
py-bad-printers.exp gdb/testsuite: resolve remaining duplicate test names in gdb.python/*.exp 2021-03-12 12:18:34 +00:00
py-bad-printers.py
py-block.c
py-block.exp gdb/testsuite: make test names unique in gdb.python/py-block.exp 2021-03-12 12:18:33 +00:00
py-breakpoint-create-fail.c
py-breakpoint-create-fail.exp
py-breakpoint-create-fail.py
py-breakpoint.c
py-breakpoint.exp
py-caller-is.c
py-caller-is.exp
py-cmd.c
py-cmd.exp
py-completion.exp
py-completion.py
py-error.exp
py-error.py
py-events-shlib.c
py-events.c
py-events.exp gdb/testsuite: resolve remaining duplicate test names in gdb.python/*.exp 2021-03-12 12:18:34 +00:00
py-events.py
py-evsignal.exp
py-evthreads.c
py-evthreads.exp
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
py-explore.cc
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
py-finish-breakpoint2.exp gdb/testsuite: resolve remaining duplicate test names in gdb.python/*.exp 2021-03-12 12:18:34 +00:00
py-finish-breakpoint2.py
py-finish-breakpoint.c
py-finish-breakpoint.exp gdb/testsuite: make test names unique in gdb.python/py-finish-breakpoint.exp 2021-03-12 12:18:33 +00:00
py-finish-breakpoint.py
py-format-string.c
py-format-string.exp
py-format-string.py
py-frame-args.c
py-frame-args.exp
py-frame-args.py
py-frame-inline.c
py-frame-inline.exp gdb/testsuite: resolve remaining duplicate test names in gdb.python/*.exp 2021-03-12 12:18:34 +00:00
py-frame.c
py-frame.exp gdb/testsuite: resolve remaining duplicate test names in gdb.python/*.exp 2021-03-12 12:18:34 +00: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/python: fix FrameDecorator regression on Python 2 2021-03-16 09:31:56 +00:00
py-framefilter-gdb.py.in
py-framefilter-invalidarg-gdb.py.in
py-framefilter-invalidarg.exp
py-framefilter-invalidarg.py
py-framefilter-mi.c
py-framefilter-mi.exp
py-framefilter.c
py-framefilter.exp
py-framefilter.py
py-function.exp
py-inferior.c
py-inferior.exp
py-infthread.c
py-infthread.exp gdb/testsuite: resolve remaining duplicate test names in gdb.python/*.exp 2021-03-12 12:18:34 +00:00
py-lazy-string.c
py-lazy-string.exp
py-linetable.c
py-linetable.exp
py-linetable.S
py-lookup-type.exp gdb/testsuite: remove a duplicate test 2021-03-12 12:18:33 +00:00
py-mi-events-gdb.py
py-mi-events.c
py-mi-events.exp
py-mi-objfile-gdb.py
py-mi-objfile.c
py-mi-objfile.exp
py-mi-var-info-path-expression.c
py-mi-var-info-path-expression.exp
py-mi-var-info-path-expression.py
py-mi.exp
py-nested-maps.c
py-nested-maps.exp
py-nested-maps.py
py-objfile-script-gdb.py
py-objfile-script.c
py-objfile-script.exp
py-objfile.c
py-objfile.exp
py-parameter.exp
py-pp-integral.c
py-pp-integral.exp
py-pp-integral.py
py-pp-maint.c
py-pp-maint.exp gdb/testsuite: make test names unique in gdb.python/py-pp-maint.exp 2021-03-12 12:18:33 +00:00
py-pp-maint.py
py-pp-re-notag.c
py-pp-re-notag.exp
py-pp-re-notag.py
py-pp-registration.c
py-pp-registration.exp
py-pp-registration.py
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/testsuite: more testing of pretty printer 'array' display_hint 2021-03-26 17:43:14 +00:00
py-prettyprint.py gdb/testsuite: more testing of pretty printer 'array' display_hint 2021-03-26 17:43:14 +00:00
py-progspace.c
py-progspace.exp
py-prompt.c
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
py-rbreak.c
py-rbreak.exp
py-record-btrace-threads.c
py-record-btrace-threads.exp
py-record-btrace.c
py-record-btrace.exp
py-record-full.c
py-record-full.exp
py-recurse-unwind.c
py-recurse-unwind.exp
py-recurse-unwind.py
py-rvalue-ref-value-cc.cc
py-rvalue-ref-value-cc.exp
py-section-script.c
py-section-script.exp
py-section-script.py
py-shared-sl.c
py-shared.c
py-shared.exp
py-strfns.c
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
py-symbol.c
py-symbol.exp
py-symtab.exp gdb/testsuite: make test names unique in gdb.python/py-symtab.exp 2021-03-12 12:18:33 +00:00
py-sync-interp.c
py-sync-interp.exp
py-template.cc
py-template.exp
py-thrhandle.c
py-thrhandle.exp
py-type.c
py-type.exp
py-typeprint.cc
py-typeprint.exp
py-typeprint.py
py-unwind-inline.c
py-unwind-inline.exp
py-unwind-inline.py
py-unwind-maint.c
py-unwind-maint.exp
py-unwind-maint.py
py-unwind.c
py-unwind.exp
py-unwind.py
py-value-cc.cc
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
py-value.exp
py-xmethods.cc
py-xmethods.exp
py-xmethods.py
python-1.c
python.c
python.exp
source1
source2.py
tui-window-disabled.c
tui-window-disabled.exp
tui-window-disabled.py
tui-window.exp
tui-window.py