From 4b435828276de07db3ad8dc208cbb188b3413991 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Tue, 27 Jul 2004 09:28:42 +0000 Subject: [PATCH] Use -gdwarf2 in preference to -gstabs for Sparc64. --- gdb/testsuite/ChangeLog | 9 +++++++++ gdb/testsuite/gdb.asm/asm-source.exp | 39 +++++++++++++++++++++++++++--------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 67e0809cf5..b11ec2be2b 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2004-07-26 Nick Clifton + + * 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 * gdb.arch/i386-prologue.exp: Add testcase for PR backtrace/1718. diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp index 8839349522..b620a1a784 100644 --- a/gdb/testsuite/gdb.asm/asm-source.exp +++ b/gdb/testsuite/gdb.asm/asm-source.exp @@ -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." } -- 2.11.0