Extend test gdb.python/py-recurse-unwind.exp

This patch modifies the unwinder (sniffer) defined in
py-recurse-unwind.py so that, depending upon the value of one of its
class variables, it will take different paths through the code,
testing different functionality.

The original test attempted to obtain the value of an undefined
symbol.

This somewhat expanded test checks to see if 'pc' can be read via
gdb.PendingFrame.read_register() and also via gdb.parse_and_eval().

gdb/testsuite/ChangeLog:

	* gdb.python/py-recurse-unwind.c (main): Add loop.
	* gdb.python/py-recurse-unwind.py (TestUnwinder): Add calls
	to read_register() and gdb.parse_and_eval().  Make each code
	call a separate case that can be individually tested.
	* gdb.python/py-recurse-unwind.exp (cont_and_backtrace): New
	proc. Call cont_and_backtrace for each of the code paths that
	we want to test in the unwinder.
This commit is contained in:
Kevin Buettner 2016-09-26 15:00:37 -07:00
parent 4cb771f214
commit 1a2f3d7ff1
4 changed files with 76 additions and 26 deletions

View file

@ -37,6 +37,10 @@ aaa (int arg)
int
main ()
{
aaa (123);
int i;
for (i = 0; i < 10; i++)
aaa (123);
return 0;
}