summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.asm/asm-source.exp
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/testsuite/gdb.asm/asm-source.exp')
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp32
1 files changed, 21 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 6c2cab9472c..b5178279de6 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -31,9 +31,13 @@ if $tracelevel then {
set prms_id 0
set bug_id 0
+set asm-arch ""
+set asm-flags ""
+
if [istarget "d10v-*-*"] then {
set asm-arch d10v
-} else {
+}
+if { "${asm-arch}" == "" } {
verbose "Skipping assembly source test -- not implemented for this target."
return
}
@@ -43,16 +47,19 @@ set binfile ${objdir}/${subdir}/${testfile}
set src1 ${srcdir}/${subdir}/asmsrc1.s
set src2 ${srcdir}/${subdir}/asmsrc2.s
-set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
+if { "${asm-flags}" == "" } {
+ #set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
+ set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+}
-if {[gdb_compile ${src1} asmsrc1.o object "additional_flags=${asm-flags}"] != ""} then {
+if {[target_assemble ${src1} asmsrc1.o "${asm-flags}"] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if {[gdb_compile ${src2} asmsrc2.o object "additional_flags=${asm-flags}"] != ""} then {
+if {[target_assemble ${src2} asmsrc2.o "${asm-flags}"] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if { [gdb_compile "asmsrc1.o asmsrc2.o" ${binfile} executable "ldflags=-nodefaultlibs"] != "" } {
+if { [target_link "asmsrc1.o asmsrc2.o" ${binfile} ""] != "" } {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
@@ -72,10 +79,10 @@ if ![runto_main] then {
}
# Execute the `f' command and see if the result includes source info.
-gdb_test "f" "asmsrc1\[.\]s:18.*several_nops" "f at main"
+gdb_test "f" "asmsrc1\[.\]s:29.*several_nops" "f at main"
# See if we properly `next' over a macro with several insns.
-gdb_test "n" "22\[ \]*.*foo2" "next over macro"
+gdb_test "n" "33\[ \]*.*foo2" "next over macro"
# See if we can properly `step' into a subroutine call.
gdb_test "s" "8\[ \]*.*" "step into foo2"
@@ -86,8 +93,11 @@ gdb_test "f" ".*asmsrc2\[.\]s:8.*" "f in foo2"
# `next' one insn (or macro) to set up our stackframe (for the following bt).
gdb_test "n" "12\[ \]*.*foo3" "n in foo2"
-# See if `bt' prints the right source files.
-gdb_test "bt" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:22" "bt in foo2"
+# See if a simple `bt' prints the right source files and doesn't fall off the stack.
+gdb_test "bt 10" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33" "bt ALL in foo2"
+
+# See if a capped `bt' prints the right source files.
+gdb_test "bt 2" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33.*" "bt 2 in foo2"
# Step into another subroutine which lives back in the first source file.
gdb_test "s" "" "s 2"
@@ -95,5 +105,5 @@ gdb_test "s" "" "s 2"
# Next over insns to set up the stack frame.
gdb_test "n" "" "n 2"
-# Now see if `bt' is correct.
-gdb_test "bt" "\#0.*foo3.*asmsrc1\[.\]s:33.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:22" "bt in foo3"
+# Now see if a capped `bt' is correct.
+gdb_test "bt 3" "\#0.*foo3.*asmsrc1\[.\]s:44.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:33.*" "bt 3 in foo3"