diff options
author | Carl Love <cel@us.ibm.com> | 2021-11-05 20:25:28 +0000 |
---|---|---|
committer | Carl Love <cel@us.ibm.com> | 2021-11-12 14:56:16 -0600 |
commit | b626a80342db07f3cc1dae45d40897f4cee1ac6e (patch) | |
tree | 84292b3f49d47dbad07c75ab3f6021156ac16a88 | |
parent | 1f28b70def1bea937fb9227c8346657016168456 (diff) | |
download | gdb-b626a80342db07f3cc1dae45d40897f4cee1ac6e.zip gdb-b626a80342db07f3cc1dae45d40897f4cee1ac6e.tar.gz gdb-b626a80342db07f3cc1dae45d40897f4cee1ac6e.tar.bz2 |
Fix gdb.base/sigstep.exp test for ppc
The test stops at <signal_handler called> which is the call to the handler
rather than in the handler as intended. This patch replaces the
gdb_test "$enter_cmd to handler" with a gdb_test_multiple test. The multiple
test looks for the stop at <signal_handler called>. If found, the command
is issued again. The test passes if gdb stops in the handler as expected.
(gdb) PASS: gdb.base/sigstep.exp: stepi to handler, nothing in handler, step
from handler: continue to signal
stepi
<signal handler called>
1: x/i $pc
=> 0x7ffff7f80440 <__kernel_start_sigtramp_rt64>: bctrl
(gdb) stepi
handler (sig=551) at sigstep.c:32
32 {
1: x/i $pc
=> 0x10000097c <handler>: addis r2,r12,2
(gdb) PASS: gdb.base/sigstep.exp: stepi to handler, nothing in handler,
step from handler: stepi to handler
Patch has been tested on x86_64-linux and ppc64le-linux with no test failures.
-rw-r--r-- | gdb/testsuite/gdb.base/sigstep.exp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/sigstep.exp b/gdb/testsuite/gdb.base/sigstep.exp index ea254af..176918b 100644 --- a/gdb/testsuite/gdb.base/sigstep.exp +++ b/gdb/testsuite/gdb.base/sigstep.exp @@ -79,6 +79,7 @@ validate_backtrace proc advance { enter_cmd in_handler_prefix in_handler exit_cmd } { global gdb_prompt inferior_exited_re global clear_done other_handler_location + global decimal set prefix "$enter_cmd to handler, $in_handler_prefix in handler, $exit_cmd from handler" @@ -93,7 +94,16 @@ proc advance { enter_cmd in_handler_prefix in_handler exit_cmd } { gdb_test "handle SIGVTALRM print pass stop" gdb_test "continue" "Program received signal.*" "continue to signal" } - gdb_test "$enter_cmd" ".*handler .*" "$enter_cmd to handler" + + gdb_test_multiple "$enter_cmd" "$enter_cmd to handler" { + -re -wrap "\r\n<signal handler called>.*" { + send_gdb "$enter_cmd\n" + exp_continue + } + -re -wrap "\r\n(Breakpoint $decimal, )?handler \\(sig=.*" { + pass $gdb_test_name + } + } delete_breakpoints |