Skip to content

Commit a496d4a

Browse files
committed
[gdb/testsuite] Enable gdb.arch/s390-disassembler-options.exp for --enable-targets=all
On s390x-linux, I run into: ... DUPLICATE: gdb.arch/s390-disassembler-options.exp: \ show disassembler-options esa ... First, reproduce this on x86_64-linux with --enable-targets=all, by replacing the test for 'istarget "s390*-*-*"' with a test for 'get_set_option_choices "set architecture" "s390"'. Fix the DUPLICATE by using with_test_prefix. Also modernize the test-case by using clean_restart instead of gdb_exit/gdb_start. Tested on x86_64-linux.
1 parent 885d864 commit a496d4a

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

gdb/testsuite/gdb.arch/s390-disassembler-options.exp

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,43 @@
1818
# This test exercises set/show disassembler-options results are preserved
1919
# across multiple set architecture calls.
2020

21-
if {![istarget "s390*-*-*"]} {
22-
verbose "Skipping S390 disassembler options."
23-
return
24-
}
25-
26-
gdb_exit
27-
gdb_start
21+
clean_restart
2822

29-
set option "esa"
23+
set archs [get_set_option_choices "set architecture" "s390"]
3024
set arch1 "s390:64-bit"
3125
set arch2 "s390:31-bit"
26+
foreach arch [list $arch1 $arch2] {
27+
if { [lsearch -exact $archs $arch] == -1 } {
28+
return
29+
}
30+
}
3231

33-
gdb_test "set architecture $arch1" \
32+
set option "esa"
33+
34+
with_test_prefix $arch1 {
35+
gdb_test "set architecture $arch1" \
3436
"The target architecture is set to \"$arch1\"\." \
3537
"set architecture $arch1"
3638

37-
gdb_test_no_output "set disassembler-options"
38-
gdb_test "show disassembler-options" \
39+
gdb_test_no_output "set disassembler-options"
40+
gdb_test "show disassembler-options" \
3941
"The current disassembler options are ''.*" \
4042
"show NULL disassembler-options"
4143

42-
gdb_test_no_output "set disassembler-options $option"
43-
gdb_test "show disassembler-options" \
44+
gdb_test_no_output "set disassembler-options $option"
45+
gdb_test "show disassembler-options" \
4446
"The current disassembler options are '$option'.*" \
4547
"show disassembler-options $option"
48+
}
4649

4750
# Change architectures and verify the disassembler options have been preserved.
4851

49-
gdb_test "set architecture $arch2" \
52+
with_test_prefix $arch2 {
53+
gdb_test "set architecture $arch2" \
5054
"The target architecture is set to \"$arch2\"\." \
5155
"set architecture $arch2"
5256

53-
gdb_test "show disassembler-options" \
57+
gdb_test "show disassembler-options" \
5458
"The current disassembler options are '$option'.*" \
5559
"show disassembler-options $option"
56-
60+
}

0 commit comments

Comments
 (0)