|
18 | 18 | # This test exercises set/show disassembler-options results are preserved |
19 | 19 | # across multiple set architecture calls. |
20 | 20 |
|
21 | | -if {![istarget "s390*-*-*"]} { |
22 | | - verbose "Skipping S390 disassembler options." |
23 | | - return |
24 | | -} |
25 | | - |
26 | | -gdb_exit |
27 | | -gdb_start |
| 21 | +clean_restart |
28 | 22 |
|
29 | | -set option "esa" |
| 23 | +set archs [get_set_option_choices "set architecture" "s390"] |
30 | 24 | set arch1 "s390:64-bit" |
31 | 25 | set arch2 "s390:31-bit" |
| 26 | +foreach arch [list $arch1 $arch2] { |
| 27 | + if { [lsearch -exact $archs $arch] == -1 } { |
| 28 | + return |
| 29 | + } |
| 30 | +} |
32 | 31 |
|
33 | | -gdb_test "set architecture $arch1" \ |
| 32 | +set option "esa" |
| 33 | + |
| 34 | +with_test_prefix $arch1 { |
| 35 | + gdb_test "set architecture $arch1" \ |
34 | 36 | "The target architecture is set to \"$arch1\"\." \ |
35 | 37 | "set architecture $arch1" |
36 | 38 |
|
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" \ |
39 | 41 | "The current disassembler options are ''.*" \ |
40 | 42 | "show NULL disassembler-options" |
41 | 43 |
|
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" \ |
44 | 46 | "The current disassembler options are '$option'.*" \ |
45 | 47 | "show disassembler-options $option" |
| 48 | +} |
46 | 49 |
|
47 | 50 | # Change architectures and verify the disassembler options have been preserved. |
48 | 51 |
|
49 | | -gdb_test "set architecture $arch2" \ |
| 52 | +with_test_prefix $arch2 { |
| 53 | + gdb_test "set architecture $arch2" \ |
50 | 54 | "The target architecture is set to \"$arch2\"\." \ |
51 | 55 | "set architecture $arch2" |
52 | 56 |
|
53 | | -gdb_test "show disassembler-options" \ |
| 57 | + gdb_test "show disassembler-options" \ |
54 | 58 | "The current disassembler options are '$option'.*" \ |
55 | 59 | "show disassembler-options $option" |
56 | | - |
| 60 | +} |
0 commit comments