+2004-07-26 Nick Clifton <nickc@redhat.com>
+
+ * gdb.asm/asm-source.exp (debug-flags): New variable. If a known
+ good default value for a specific architecture is available then
+ set it to that value. Otherwise default to the -gstabs switch.
+ Remove the -g... switches from the asm-flags variable. Allow the
+ target board info to override the value if it wants to. Pass the
+ switch on the assembler command line.
+
2004-07-23 Mark Kettenis <kettenis@gnu.org>
* gdb.arch/i386-prologue.exp: Add testcase for PR backtrace/1718.
set asm-note "empty"
set asm-flags ""
set link-flags "--entry _start"
+set debug-flags ""
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 "-gdwarf2 -no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
}
"*arm-*-*" {
set asm-arch arm
}
"x86_64-*-*" {
set asm-arch x86_64
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
}
"i\[3456\]86-*-*" {
set asm-arch i386
}
"sh*-*-*" {
set asm-arch sh
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
}
"sparc-*-*" {
set asm-arch sparc
}
"sparc64-*-*" {
set asm-arch sparc64
- set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-xarch=v9 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
}
"xstormy16-*-*" {
set asm-arch xstormy16
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
}
"v850-*-*" {
set asm-arch v850
}
"ia64-*-*" {
set asm-arch ia64
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
}
"hppa*-linux-*" {
set asm-arch pa
- set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
}
}
remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
if { "${asm-flags}" == "" } {
- set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gstabs"
}
-if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags}"] != ""} then {
+# Allow the target board to override the debug flags
+if { [board_info $dest exists debug_flags] } then {
+ set debug-flags "[board_info $dest debug_flags]"
+}
+
+# The GNU assembler does not support STABS+
+if { ${debug-flags} == "-gstabs+" } then {
+ set debug-flags "-gstabs"
+}
+
+if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-flags} ${debug-flags}"] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
-if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags}"] != ""} then {
+if {[target_assemble ${srcdir}/${subdir}/${srcfile2} asmsrc2.o "${asm-flags} ${debug-flags}"] != ""} then {
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}