+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*-*-*"".
+ * gdb.arch/arm-disp-step.exp: Likewise.
+ * gdb.arch/thumb-bx-pc.exp: Likewise.
+ * gdb.arch/thumb-prologue.exp: Likewise.
+ * gdb.arch/thumb-singlestep.exp: Likewise.
+ * gdb.base/disp-step-syscall.exp: Likewise.
+ * gdb.base/float.exp: Likewise.
+
2015-07-07 Yao Qi <yao.qi@linaro.org>
* gdb.base/catch-syscall.exp (test_catch_syscall_multi_arch):
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-if { ![istarget "arm*-*-*"] } {
+if { ![is_aarch32_target] } {
verbose "Skipping ${gdb_test_file_name}."
return
}
# Test arm displaced stepping.
-if {![istarget "arm*-*-*"]} then {
+if {![is_aarch32_target]} then {
verbose "Skipping arm displaced stepping tests."
return
}
# Test PC adjustment from Thumb-mode "bx pc" instruction.
-if {![istarget arm*-*]} then {
+if {![is_aarch32_target]} then {
verbose "Skipping ARM tests."
return
}
# Test ARM/Thumb prologue analyzer.
-if {![istarget arm*-*]} then {
+if {![is_aarch32_target]} then {
verbose "Skipping ARM prologue tests."
return
}
# Test single-stepping into incorrectly marked Thumb routine
-if {![istarget arm*-*]} then {
+if {![is_aarch32_target]} then {
verbose "Skipping ARM tests."
return
}
if { [istarget "i\[34567\]86-*-linux*"] || [istarget "x86_64-*-linux*"] } {
set syscall_insn "\[ \t\](int|syscall|sysenter)\[ \t\]"
-} elseif [istarget "arm*-*-linux*"] {
+} elseif [is_aarch32_target] {
set syscall_insn "\[ \t\](swi|svc)\[ \t\]"
} else {
return -1
gdb_test "info float" "d0.*d1.*d31.*s0.*s1.*s31.*" "info float"
} elseif { [istarget "alpha*-*-*"] } then {
gdb_test "info float" "f0.*" "info float"
-} elseif { [istarget "arm*-*-*"] } then {
+} elseif { [is_aarch32_target] } then {
gdb_test_multiple "info float" "info float" {
-re "Software FPU type.*mask:.*flags:.*$gdb_prompt $" {
pass "info float (FPA)"
return [expr [is_ilp32_target] && ![is_amd64_regs_target]]
}
+# Return 1 if this target is an arm or aarch32 on aarch64.
+
+gdb_caching_proc is_aarch32_target {
+ if { [istarget "arm*-*-*"] } {
+ return 1
+ }
+
+ if { ![istarget "aarch64*-*-*"] } {
+ return 0
+ }
+
+ set me "is_aarch32_target"
+
+ set src [standard_temp_file aarch32[pid].s]
+ set obj [standard_temp_file aarch32[pid].o]
+
+ set list {}
+ foreach reg \
+ {r0 r1 r2 r3} {
+ lappend list "\tmov $reg, $reg"
+ }
+ gdb_produce_source $src [join $list \n]
+
+ verbose "$me: compiling testfile $src" 2
+ set lines [gdb_compile $src $obj object {quiet}]
+ file delete $src
+ file delete $obj
+
+ if ![string match "" $lines] then {
+ verbose "$me: testfile compilation failed, returning 0" 2
+ return 0
+ }
+
+ verbose "$me: returning 1" 2
+ return 1
+}
+
# Return 1 if displaced stepping is supported on target, otherwise, return 0.
proc support_displaced_stepping {} {