Use -gdwarf2 in preference to -gstabs for Sparc64.
authorNick Clifton <nickc@redhat.com>
Tue, 27 Jul 2004 09:28:42 +0000 (09:28 +0000)
committerNick Clifton <nickc@redhat.com>
Tue, 27 Jul 2004 09:28:42 +0000 (09:28 +0000)
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.asm/asm-source.exp

index 67e0809cf50dc0ec8228a0ee49e14247b808a970..b11ec2be2b6901ea4dd9ac46e58b43f17c529044 100644 (file)
@@ -1,3 +1,12 @@
+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.
index 8839349522c2ecfe79fc16f93edb390eac95b7f8..b620a1a7844648fe1abbdb936a45f2eada85da18 100644 (file)
@@ -35,13 +35,15 @@ set asm-arch ""
 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
@@ -63,7 +65,8 @@ switch -glob -- [istarget] {
     }
     "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
@@ -88,18 +91,21 @@ switch -glob -- [istarget] {
     }
     "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
@@ -110,11 +116,13 @@ switch -glob -- [istarget] {
     }
     "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"
     }
 }
 
@@ -161,13 +169,24 @@ remote_exec build "rm -f ${subdir}/note.inc"
 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."
 }
 
This page took 0.037155 seconds and 4 git commands to generate.