binutils-gdb/gdb/testsuite/gdb.python
Kevin Buettner bb1fe4acb8 Test case to detect recursive unwinding in Python-based unwinders.
This test case verifies that GDB will not attempt to invoke a python
unwinder recursively.

At the moment, the behavior exhibited by GDB looks like this:

    (gdb) source py-recurse-unwind.py
    Python script imported
    (gdb) b ccc
    Breakpoint 1 at 0x4004bd: file py-recurse-unwind.c, line 23.
    (gdb) run
    Starting program: py-recurse-unwind
    TestUnwinder: Recursion detected - returning early.
    TestUnwinder: Recursion detected - returning early.
    TestUnwinder: Recursion detected - returning early.
    TestUnwinder: Recursion detected - returning early.

    Breakpoint 1, ccc (arg=<unavailable>) at py-recurse-unwind.c:23
    23      }
    (gdb) bt
    #-1 ccc (arg=<unavailable>) at py-recurse-unwind.c:23
    Backtrace stopped: previous frame identical to this frame (corrupt stack?)

[I've shortened pathnames for easier reading.]

The desired / expected behavior looks like this:

    (gdb) source py-recurse-unwind.py
    Python script imported
    (gdb) b ccc
    Breakpoint 1 at 0x4004bd: file py-recurse-unwind.c, line 23.
    (gdb) run
    Starting program: py-recurse-unwind

    Breakpoint 1, ccc (arg=789) at py-recurse-unwind.c:23
    23      }
    (gdb) bt
    #0  ccc (arg=789) at py-recurse-unwind.c:23
    #1  0x00000000004004d5 in bbb (arg=456) at py-recurse-unwind.c:28
    #2  0x00000000004004ed in aaa (arg=123) at py-recurse-unwind.c:34
    #3  0x00000000004004fe in main () at py-recurse-unwind.c:40

Note that GDB's problems go well beyond the fact that it invokes the
unwinder recursively.  In the process it messes up some internal state
(the frame stash) leading to display of (only) the sentinel frame in
the backtrace.

gdb/testsuite/ChangeLog:

	* gdb.python/py-recurse-unwind.c: New file.
	* gdb.python/py-recurse-unwind.py: New file.
	* gdb.python/py-recurse-unwind.exp: New file.
2016-08-24 14:22:30 -07:00
..
amd64-py-framefilter-invalidarg.S GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
lib-types.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
lib-types.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-arch.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-arch.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-as-string.c Add $_as_string convenience function 2016-03-10 17:12:30 -05:00
py-as-string.exp Add $_as_string convenience function 2016-03-10 17:12:30 -05:00
py-bad-printers.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-bad-printers.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-bad-printers.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-block.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-block.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-breakpoint-create-fail.c Fix use of a dangling pointer for Python breakpoint objects 2016-06-27 12:11:25 +02:00
py-breakpoint-create-fail.exp Fix use of a dangling pointer for Python breakpoint objects 2016-06-27 12:11:25 +02:00
py-breakpoint-create-fail.py Fix use of a dangling pointer for Python breakpoint objects 2016-06-27 12:11:25 +02:00
py-breakpoint.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-breakpoint.exp PR python/15620, PR python/18620 - breakpoint events in Python 2016-07-13 13:59:55 -06:00
py-caller-is.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-caller-is.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-cmd.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-cmd.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-completion.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-completion.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-error.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-error.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-events-shlib.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-events.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-events.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-events.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-evsignal.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-evthreads.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-evthreads.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-explore-cc.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-explore.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-explore.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-explore.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-finish-breakpoint.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-finish-breakpoint.exp Rename gdb_load_shlibs to gdb_load_shlib 2016-04-27 18:09:14 -04:00
py-finish-breakpoint.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-finish-breakpoint2.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-finish-breakpoint2.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-finish-breakpoint2.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-frame-args.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-frame-args.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-frame-args.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-frame-inline.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-frame-inline.exp PR python/18565 - make Frame.function work for inline frames 2016-08-03 09:04:08 -06:00
py-frame.c
py-frame.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter-gdb.py.in GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter-invalidarg-gdb.py.in GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter-invalidarg.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter-invalidarg.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter-mi.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter-mi.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-framefilter.exp Fix PR python/20129 - use of non-existing variable 2016-06-29 10:18:38 -06:00
py-framefilter.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-function.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-inferior.c
py-inferior.exp Reapply: List inferiors/threads/pspaces in ascending order 2016-01-12 01:12:38 +00:00
py-infthread.c
py-infthread.exp Add Python InferiorThread.global_num attribute 2016-01-13 11:00:54 +00:00
py-lazy-string.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-lazy-string.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-linetable.S GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-linetable.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-linetable.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-lookup-type.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-mi-events-gdb.py Prepare gdb.python/mi-py-events.exp for Python/MI in separate channels 2016-06-21 01:11:43 +01:00
py-mi-events.c python: Use console format for output of gdb.execute command 2016-03-31 15:32:38 +03:00
py-mi-events.exp Prepare gdb.python/mi-py-events.exp for Python/MI in separate channels 2016-06-21 01:11:43 +01:00
py-mi-objfile-gdb.py testsuite: Update py-mi-objfile to expect console format print 2016-04-06 09:39:16 +03:00
py-mi-objfile.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-mi-objfile.exp testsuite: Update py-mi-objfile to expect console format print 2016-04-06 09:39:16 +03:00
py-mi.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-objfile-script-gdb.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-objfile-script.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-objfile-script.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-objfile.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-objfile.exp Fix PR python/19438, PR python/18393 - initialize dictionaries 2016-05-23 10:08:34 -06:00
py-parameter.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-integral.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-integral.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-integral.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-maint.c Fix sorting of enum values in FlagEnumerationPrinter 2016-01-20 13:44:33 -05:00
py-pp-maint.exp Fix sorting of enum values in FlagEnumerationPrinter 2016-01-20 13:44:33 -05:00
py-pp-maint.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-re-notag.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-re-notag.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-re-notag.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-registration.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-registration.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-pp-registration.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-prettyprint.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-prettyprint.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-prettyprint.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-progspace.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-progspace.exp Fix PR python/19438, PR python/18393 - initialize dictionaries 2016-05-23 10:08:34 -06:00
py-prompt.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-prompt.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-recurse-unwind.c Test case to detect recursive unwinding in Python-based unwinders. 2016-08-24 14:22:30 -07:00
py-recurse-unwind.exp Test case to detect recursive unwinding in Python-based unwinders. 2016-08-24 14:22:30 -07:00
py-recurse-unwind.py Test case to detect recursive unwinding in Python-based unwinders. 2016-08-24 14:22:30 -07:00
py-section-script.c [testsuite] @progbits -> %progbits 2016-01-18 14:30:23 +00:00
py-section-script.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-section-script.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-shared-sl.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-shared.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-shared.exp Fix PR python/18984 2016-06-02 13:18:42 -06:00
py-strfns.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-strfns.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-symbol.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-symbol.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-symtab.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-sync-interp.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-sync-interp.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-template.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-template.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-type.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-type.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-typeprint.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-typeprint.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-typeprint.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-unwind-maint.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-unwind-maint.exp PR python/19293 - invalidate frame cache when unwinders change 2016-07-12 13:56:07 -06:00
py-unwind-maint.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-unwind.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-unwind.exp testsuite patch: Skip py-unwind.exp on x86_64 -m32 2016-07-20 16:17:04 +02:00
py-unwind.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-value-cc.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-value-cc.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-value.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-value.exp Fix PR python/17386 - add __index__ method to gdb.Value 2016-05-24 10:05:59 -06:00
py-xmethods.cc GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-xmethods.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
py-xmethods.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
python-1.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
python.c GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
python.exp GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
source1 GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00
source2.py GDB copyright headers update after running GDB's copyright.py script. 2016-01-01 08:43:22 +04:00