summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2015-07-07 16:58:20 +0100
committerYao Qi <yao.qi@linaro.org>2015-07-07 16:58:20 +0100
commit4931af25b8ab8f9db77c40142d52e4513762ca97 (patch)
treeb10367802fc2f055d67037bc7a220d688f42de66
parent9fcf688e800e089217ecc8a47b228be180866df8 (diff)
downloadbinutils-gdb-4931af25b8ab8f9db77c40142d52e4513762ca97.tar.gz
New proc is_aarch64_target
Some tests expect the the target is aarch64, but checking target triplet is not accurate, because target triplet can be aarch64 but the program is in arm (or aarch32) state. This patch addes a new proc is_aarch64_target which returns true if the target is on aarch64 state. gdb/testsuite: 2015-07-07 Yao Qi <yao.qi@linaro.org> * gdb.arch/aarch64-atomic-inst.exp: Check is_aarch64_target instead of istarget "aarch64*-*-*". * gdb.arch/aarch64-fp.exp: Likewise. * gdb.base/float.exp: Likewise. * gdb.reverse/aarch64.exp: Likewise. * lib/gdb.exp (is_aarch64_target): New proc.
-rw-r--r--gdb/testsuite/ChangeLog9
-rw-r--r--gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp2
-rw-r--r--gdb/testsuite/gdb.arch/aarch64-fp.exp2
-rw-r--r--gdb/testsuite/gdb.base/float.exp2
-rw-r--r--gdb/testsuite/gdb.reverse/aarch64.exp2
-rw-r--r--gdb/testsuite/lib/gdb.exp10
6 files changed, 23 insertions, 4 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 11f6424c981..c5386b28300 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,5 +1,14 @@
2015-07-07 Yao Qi <yao.qi@linaro.org>
+ * gdb.arch/aarch64-atomic-inst.exp: Check is_aarch64_target
+ instead of istarget "aarch64*-*-*".
+ * gdb.arch/aarch64-fp.exp: Likewise.
+ * gdb.base/float.exp: Likewise.
+ * gdb.reverse/aarch64.exp: Likewise.
+ * lib/gdb.exp (is_aarch64_target): New proc.
+
+2015-07-07 Yao Qi <yao.qi@linaro.org>
+
* lib/gdb.exp (is_aarch32_target): New proc.
* gdb.arch/arm-bl-branch-dest.exp: Check is_aarch32_target
instead of "istarget "arm*-*-*"".
diff --git a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
index 885cfb163b2..19a98cdb1ff 100644
--- a/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-atomic-inst.exp
@@ -19,7 +19,7 @@
# Test single stepping through atomic sequences beginning with
# a ldxr instruction and ending with a stxr instruction.
-if {![istarget "aarch64*"]} {
+if {![is_aarch64_target]} {
verbose "Skipping ${gdb_test_file_name}."
return
}
diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.exp b/gdb/testsuite/gdb.arch/aarch64-fp.exp
index 0cd734f7aea..aaf56405a68 100644
--- a/gdb/testsuite/gdb.arch/aarch64-fp.exp
+++ b/gdb/testsuite/gdb.arch/aarch64-fp.exp
@@ -19,7 +19,7 @@
# PR server/17457
# Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr
-if {![istarget "aarch64*"]} {
+if {![is_aarch64_target]} {
verbose "Skipping ${gdb_test_file_name}."
return
}
diff --git a/gdb/testsuite/gdb.base/float.exp b/gdb/testsuite/gdb.base/float.exp
index a7183cfa6d5..91c2d45a444 100644
--- a/gdb/testsuite/gdb.base/float.exp
+++ b/gdb/testsuite/gdb.base/float.exp
@@ -36,7 +36,7 @@ if ![runto_main] then {
# Test "info float".
-if { [istarget "aarch64*-*-*"] } then {
+if { [is_aarch64_target] } then {
gdb_test "info float" "d0.*d1.*d31.*s0.*s1.*s31.*" "info float"
} elseif { [istarget "alpha*-*-*"] } then {
gdb_test "info float" "f0.*" "info float"
diff --git a/gdb/testsuite/gdb.reverse/aarch64.exp b/gdb/testsuite/gdb.reverse/aarch64.exp
index 800645e02dd..1c5f181e273 100644
--- a/gdb/testsuite/gdb.reverse/aarch64.exp
+++ b/gdb/testsuite/gdb.reverse/aarch64.exp
@@ -19,7 +19,7 @@ if ![supports_reverse] {
# Test aarch64 instruction recording.
-if {![istarget "aarch64*-*-*"]} then {
+if {![is_aarch64_target]} then {
verbose "Skipping aarch64 instruction recording tests."
return
}
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index e8ae08c483e..0805de9c3e9 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -2308,6 +2308,16 @@ gdb_caching_proc is_aarch32_target {
return 1
}
+# Return 1 if this target is an aarch64, either lp64 or ilp32.
+
+proc is_aarch64_target {} {
+ if { ![istarget "aarch64*-*-*"] } {
+ return 0
+ }
+
+ return [expr ![is_aarch32_target]]
+}
+
# Return 1 if displaced stepping is supported on target, otherwise, return 0.
proc support_displaced_stepping {} {