aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.arch
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2020-12-04 13:36:48 +0100
committerTom de Vries <tdevries@suse.de>2020-12-04 13:36:48 +0100
commit67748e0f666f0645d7f182e1365f4d9859e55f1d (patch)
tree668feae87503d1e6a467a25fceaca2ad78bfc120 /gdb/testsuite/gdb.arch
parentb6a6aa07c5bd53d19c33db1f7c9645fc99b66e1b (diff)
downloadgdb-67748e0f666f0645d7f182e1365f4d9859e55f1d.zip
gdb-67748e0f666f0645d7f182e1365f4d9859e55f1d.tar.gz
gdb-67748e0f666f0645d7f182e1365f4d9859e55f1d.tar.bz2
[gdb/testsuite] Make gdb.arch/amd64-gs_base.exp unsupported for i386
With target board unix/-m32 I run into: ... (gdb) print /x $fs_base^M $1 = void^M (gdb) FAIL: gdb.arch/amd64-gs_base.exp: print fs_base ... The problem is that the fs_base register is not supported for i386. Fix this by making the test unsupported if fs_base/gs_base don't show up in info register sys output. Tested on x86_64-linux. gdb/testsuite/ChangeLog: 2020-12-04 Tom de Vries <tdevries@suse.de> PR testsuite/26990 * gdb.arch/amd64-gs_base.exp: Handle -m32 where fs_base and gs_base are unsupported.
Diffstat (limited to 'gdb/testsuite/gdb.arch')
-rw-r--r--gdb/testsuite/gdb.arch/amd64-gs_base.exp26
1 files changed, 25 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.arch/amd64-gs_base.exp b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
index 3e14031..d29043b 100644
--- a/gdb/testsuite/gdb.arch/amd64-gs_base.exp
+++ b/gdb/testsuite/gdb.arch/amd64-gs_base.exp
@@ -30,6 +30,31 @@ if ![runto_main] {
return -1
}
+# Test the presence of fs_base and gs_base on the system
+# register group and values.
+#
+set ws "\[\t \]+"
+set info_reg_out [multi_line "info register sys" \
+ "fs_base${ws}$hex${ws}$decimal"\
+ "gs_base${ws}$hex${ws}$decimal"\
+ "orig_rax${ws}$hex${ws}\[-\]$decimal" ]
+set info_reg_out_m32 [multi_line "info register sys" \
+ "orig_eax${ws}$hex${ws}\[-\]$decimal" ]
+
+set supported 0
+gdb_test_multiple "info register sys" "" {
+ -re -wrap $info_reg_out {
+ set supported 1
+ }
+ -re -wrap $info_reg_out_m32 {
+ }
+}
+
+if { ! $supported } {
+ unsupported "target does not support fs_base and gs_base"
+ return -1
+}
+
gdb_test "print /x \$fs_base" "= $hex" "print fs_base"
gdb_test "print /x \$gs_base" "= $hex" "print gs_base"
@@ -39,7 +64,6 @@ gdb_test "print \$gs_base = 3" "= 3" "set gs_base"
# Test the presence of fs_base and gs_base on the system
# register group and values.
#
-set ws "\[\t \]+"
set info_reg_out [multi_line "info register sys" \
"fs_base${ws}0x2${ws}2"\
"gs_base${ws}0x3${ws}3"\