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:
parent
4cb771f214
commit
1a2f3d7ff1
4 changed files with 76 additions and 26 deletions
|
@ -37,6 +37,10 @@ aaa (int arg)
|
|||
int
|
||||
main ()
|
||||
{
|
||||
aaa (123);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 10; i++)
|
||||
aaa (123);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue