Index: gdb/testsuite/gdb.asm/asm-source.exp |
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp |
index 18f9a7bc49b23b365a7313a05a6460b124fb70aa..db2ae2b1aa572a5e9a8f9d7bee0bea6514f10d63 100644 |
--- a/gdb/testsuite/gdb.asm/asm-source.exp |
+++ b/gdb/testsuite/gdb.asm/asm-source.exp |
@@ -15,10 +15,6 @@ |
# |
# This file was written by Kendra. |
-if $tracelevel then { |
- strace $tracelevel |
-} |
- |
# |
# Test debugging assembly level programs. |
# This file uses asmsrc[12].s for input. |
@@ -31,12 +27,14 @@ set asm-flags "" |
set link-flags "-e _start" |
set debug-flags "" |
+set obj_include -I[standard_output_file {}] |
+ |
switch -glob -- [istarget] { |
"alpha*-*-*" { |
set asm-arch alpha |
# ??? Won't work with ecoff systems like Tru64, but then we also |
# don't have any other -g flag that creates mdebug output. |
- set asm-flags "-no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}" |
+ set asm-flags "-no-mdebug -I${srcdir}/${subdir} $obj_include" |
set debug-flags "-gdwarf-2" |
} |
"arm*-*-*" { |
@@ -76,7 +74,7 @@ switch -glob -- [istarget] { |
} |
"m6811-*-*" { |
set asm-arch m68hc11 |
- set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" |
+ set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} $obj_include" |
set debug-flags "-gdwarf-2" |
# This asm test is specific and uses the linker directly. |
# We must not use the target board linker script defined for other |
@@ -87,7 +85,7 @@ switch -glob -- [istarget] { |
} |
"m6812-*-*" { |
set asm-arch m68hc11 |
- set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}" |
+ set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} $obj_include" |
set debug-flags "-gdwarf-2" |
# This asm test is specific and uses the linker directly. |
# We must not use the target board linker script defined for other |
@@ -102,11 +100,11 @@ switch -glob -- [istarget] { |
"powerpc*-*" { |
if { [is_lp64_target] } { |
set asm-arch powerpc64 |
- set asm-flags "-a64 -I${srcdir}/${subdir} -I${objdir}/${subdir}" |
+ set asm-flags "-a64 -I${srcdir}/${subdir} $obj_include" |
append link-flags " -m elf64ppc" |
} else { |
set asm-arch powerpc |
- set asm-flags "-a32 -I${srcdir}/${subdir} -I${objdir}/${subdir}" |
+ set asm-flags "-a32 -I${srcdir}/${subdir} $obj_include" |
append link-flags " -m elf32ppc" |
} |
} |
@@ -119,12 +117,12 @@ switch -glob -- [istarget] { |
} |
"sparc64-*-*" { |
set asm-arch sparc64 |
- set asm-flags "-xarch=v9 -I${srcdir}/${subdir} -I${objdir}/${subdir}" |
+ set asm-flags "-xarch=v9 -I${srcdir}/${subdir} $obj_include" |
set debug-flags "-gdwarf-2" |
} |
"spu*-*-*" { |
set asm-arch spu |
- set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir} --no-warn" |
+ set asm-flags "-I${srcdir}/${subdir} $obj_include --no-warn" |
set debug-flags "-gdwarf-2" |
} |
"xstormy16-*-*" { |
@@ -200,10 +198,7 @@ if [board_info $dest exists multilib_flags] { |
} |
} |
-set testfile "asm-source" |
-set binfile ${objdir}/${subdir}/${testfile} |
-set srcfile1 asmsrc1.s |
-set srcfile2 asmsrc2.s |
+standard_testfile asmsrc1.s asmsrc2.s |
remote_exec build "rm -f ${subdir}/arch.inc" |
remote_download host ${srcdir}/${subdir}/${asm-arch}.inc ${subdir}/arch.inc |
@@ -211,7 +206,7 @@ remote_exec build "rm -f ${subdir}/note.inc" |
remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc |
if { [string equal ${asm-flags} ""] } { |
- set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}" |
+ set asm-flags "-I${srcdir}/${subdir} $obj_include" |
} |
if { [string equal ${debug-flags} ""] } { |
@@ -243,11 +238,14 @@ regsub "--" "-gstabs\[+\]" "${debug-flags}" "-gstabs" debug-flags |
# The GNU assembler does not support level options like "-g2" or "-g3". |
regsub "--" "-g\[0-9\]" "${debug-flags}" "" debug-flags |
-if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags} ${debug-flags}"] != ""} then { |
+set asm1obj [standard_output_file asmrc1.o] |
+set asm2obj [standard_output_file asmrc2.o] |
+ |
+if {[target_assemble ${srcdir}/${subdir}/${srcfile} $asm1obj "${asm-flags} ${debug-flags}"] != ""} then { |
untested asm-source.exp |
return -1 |
} |
-if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags} ${debug-flags}"] != ""} then { |
+if {[target_assemble ${srcdir}/${subdir}/${srcfile2} $asm2obj "${asm-flags} ${debug-flags}"] != ""} then { |
untested asm-source.exp |
return -1 |
} |
@@ -258,7 +256,7 @@ if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags} ${d |
# code here that provides its own startup code. Using target_link |
# also avoids a lot of problems on many systems, most notably on |
# *-*-*bsd* and *-*-solaris2*. |
-if {[target_link "asmsrc1.o asmsrc2.o" "${binfile}" ${link-flags}] != "" } then { |
+if {[target_link [list $asm1obj $asm2obj] "${binfile}" ${link-flags}] != "" } then { |
untested asm-source.exp |
return -1 |
} |
@@ -268,8 +266,6 @@ if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } { |
set_board_info ldscript $old_ldscript |
} |
-remote_exec build "mv asmsrc1.o asmsrc2.o ${objdir}/${subdir}" |
- |
# Collect some line numbers. |
set line_main [expr [gdb_get_line_number "main start" "asmsrc1.s"] + 1] |
set line_call_foo2 [expr [gdb_get_line_number "call foo2" "asmsrc1.s"] + 1] |