diff options
author | Tom de Vries <tdevries@zinfandel-3.arch.suse.de> | 2021-11-02 18:55:32 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2021-11-02 18:55:32 +0100 |
commit | d74dfa8f63c2bb951609ab671773354536543ac2 (patch) | |
tree | dd823525a7ce2dd64ad3d405e41ecf67ace66456 /gdb/testsuite/gdb.arch | |
parent | bd25c6eef8f1004fe54ee9c0b964f62497c84a08 (diff) | |
download | gdb-d74dfa8f63c2bb951609ab671773354536543ac2.zip gdb-d74dfa8f63c2bb951609ab671773354536543ac2.tar.gz gdb-d74dfa8f63c2bb951609ab671773354536543ac2.tar.bz2 |
[gdb/testsuite] Handle SIGILL in two gdb.arch powerpc test-cases
On powerpc64le-linux, with test-case gdb.arch/powerpc-addpcis.exp I run into
SIGILL:
...
(gdb) PASS: gdb.arch/powerpc-addpcis.exp: get hexadecimal valueof "$r3"
stepi^M
^M
Program terminated with signal SIGILL, Illegal instruction.^M
The program no longer exists.^M
(gdb) PASS: gdb.arch/powerpc-addpcis.exp: set r4
...
because it's a power9 insn, and I'm running on a power8 machine.
Fix this by handling the SIGILL. Likewise in gdb.arch/powerpc-lnia.exp.
Tested on powerpc64le-linux.
Diffstat (limited to 'gdb/testsuite/gdb.arch')
-rw-r--r-- | gdb/testsuite/gdb.arch/powerpc-addpcis.exp | 14 | ||||
-rw-r--r-- | gdb/testsuite/gdb.arch/powerpc-lnia.exp | 14 |
2 files changed, 26 insertions, 2 deletions
diff --git a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp index d1bc7f4..ff7052c 100644 --- a/gdb/testsuite/gdb.arch/powerpc-addpcis.exp +++ b/gdb/testsuite/gdb.arch/powerpc-addpcis.exp @@ -50,7 +50,19 @@ gdb_breakpoint $bp1 gdb_breakpoint $bp2 gdb_breakpoint $bp3 -gdb_test "stepi" "" "set r3 " +set insn_supported 1 +gdb_test_multiple "stepi" "set r3" { + -re "Program received signal SIGILL, Illegal instruction\\..*" { + set insn_supported 0 + } + -re -wrap "" { + pass $gdb_test_name + } +} +if { ! $insn_supported } { + unsupported "illegal instruction" + return +} set check_r3 [get_hexadecimal_valueof "\$r3" "default0"] gdb_test "stepi" "" "set r4" set check_r4 [get_hexadecimal_valueof "\$r4" "default0"] diff --git a/gdb/testsuite/gdb.arch/powerpc-lnia.exp b/gdb/testsuite/gdb.arch/powerpc-lnia.exp index 0f56d83..4ab4f8d 100644 --- a/gdb/testsuite/gdb.arch/powerpc-lnia.exp +++ b/gdb/testsuite/gdb.arch/powerpc-lnia.exp @@ -54,7 +54,19 @@ gdb_breakpoint $bp3 # single-step through the lnia instructions, and retrieve the # register values as we proceed. -gdb_test "stepi" "" "set r3" +set insn_supported 1 +gdb_test_multiple "stepi" "set r3" { + -re "Program received signal SIGILL, Illegal instruction\\..*" { + set insn_supported 0 + } + -re -wrap "" { + pass $gdb_test_name + } +} +if { ! $insn_supported } { + unsupported "illegal instruction" + return +} set check_r3 [get_hexadecimal_valueof "\$r3" "default0"] gdb_test "stepi" "" "set r4" set check_r4 [get_hexadecimal_valueof "\$r4" "default0"] |