Tighten gdb.base/disp-step-syscall.exp
This fixes several problems with this test.
E.g,. with --target_board=native-extended-gdbserver on x86_64 Fedora
20, I get:
Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/disp-step-syscall.exp ...
FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)
FAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork final pc
FAIL: gdb.base/disp-step-syscall.exp: vfork: delete break vfork insn
FAIL: gdb.base/disp-step-syscall.exp: vfork: continue to marker (vfork) (the program is no longer running)
And with --target=native-gdbserver, I get:
Running /home/pedro/gdb/mygit/src/gdb/testsuite/gdb.base/disp-step-syscall.exp ...
KPASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS server/13796)
FAIL: gdb.base/disp-step-syscall.exp: vfork: get hexadecimal valueof "$pc" (timeout)
FAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork final pc
FAIL: gdb.base/disp-step-syscall.exp: vfork: delete break vfork insn
FAIL: gdb.base/disp-step-syscall.exp: vfork: continue to marker (vfork) (the program is no longer running)
First, the lack of fork support on remote targets is supposed to be
kfailed, so the KPASS is obviously bogus. The extended-remote board
should have KFAILed too.
The problem is that the test is using "is_remote" instead of
gdb_is_target_remote.
And then, I get:
(gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
stepi
Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) PASS: gdb.base/disp-step-syscall.exp: vfork: single step over vfork
Obviously, that should be a FAIL. The problem is that the test only
expects SIGILL, not SIGSEGV. It also doesn't bail correctly if an
internal error or some other pattern caught by gdb_test_multiple
matches. The test doesn't really need to match specific exits/crashes
patterns, if the PASS regex is improved, like in ...
... this and the other "stepi" tests are a bit too lax, passing on
".*". This tightens those up to expect "x/i" and the "=>" current PC
indicator, like in:
1: x/i $pc
=> 0x3b36abc9e2 <vfork+34>: syscall
On x86_64 Fedora 20, I now get a quick KFAIL instead of timeouts with
both the native-extended-gdbserver and native-gdbserver boards:
PASS: gdb.base/disp-step-syscall.exp: vfork: delete break vfork
PASS: gdb.base/disp-step-syscall.exp: vfork: continue to syscall insn vfork
PASS: gdb.base/disp-step-syscall.exp: vfork: set displaced-stepping on
KFAIL: gdb.base/disp-step-syscall.exp: vfork: single step over vfork (PRMS: server/13796)
and a full pass with native testing.
gdb/testsuite/
2015-03-18 Pedro Alves <palves@redhat.com>
* gdb.base/disp-step-syscall.exp (disp_step_cross_syscall):
Use gdb_is_target_remote instead of is_remote. Use
gdb_test_multiple instead of gdb_expect. Exit early if
gdb_test_multiple hits its internal matches. Tighten stepi tests
expected output. Fail on exit with any signal, instead of just
SIGILL.