This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA/RFC: Change Sparc64 gdb.asm tests to use -gdwarf2 insteadof -gstabs


Hi Michael,

Not approved.
*sob* :-)

You stepped into one of the test suite cow pies ... sorry about that.

Instead of hard-wiring the debug format, the test should use the
value of debug_flags.  Copy this bit of code from lib/ada.exp
(which was copied from default_target_compile):

Cool - I have adapted your suggested code slightly (see attached patch).


It would be nice if the assembler supported "-g" with a good default
value.  But it doesn't.  So we have to keep all the existing
per-architecture code to choose between -gdwarf-2 and -gstabs, with the
override at the end.

Those darn lazy binutils maintainers. What do they think that they are doing ? Oh wait, I am binutils maintainer. :-) Guess I should look into this...


Also ... how did this ever work on sparc64 with stabs?  I thought that
stabs and stabs+ have never worked on 64-bit machines!  Am I missing a
clue?

Ah well now that I cannot answer. I just came into the middle of this, trying to answer my manager's question of "are these testsuite failures significant ?" I do not know if Sparc64 + STABS has ever worked, but I assumed that since it was explicitly set that way in asm-source.exp that somebody, in the past, has thought that it did work.


If there is a bug report filed for the bug, then the test can
return XFAIL or KFAIL with the PR number (XFAIL for a PR against
the assembler, KFAIL for a PR against gdb).

AFAIK there is no such bug report. Although there is a related one about the generation of aligned and unaligned relocs for the Sparc.


Lastly, you have to test the patch, and say how you tested it
(obviously by running asm-source.exp on a sparc64).
Please test with all three of:

  runtest
  runtest --target_board unix/gdb:debug_flags=dwarf-2
  runtest --target_board unix/gdb:debug_flags=stabs+

OK I ran those tests, although I changed the flags to be "-gdwarf2" and "-gstabs+". I also added "gdb.asm/asm-source.exp" to the command lines, since I assumed that it was OK to just run the assembler tests. The patch does not affect any other part of the GDB testsuite.


I ran the tests on an x86 native host and a Sparc64 native host, just to make sure that the default selection code worked as well. There was only one combination that produced any failures:

Sparc64 native with -gstabs+

Which of course was the whole point of this patch in the first place. So - can I apply this version of the patch please ?

Cheers
  Nick

gdb/testsuite/ChangeLog
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.
Index: gdb/testsuite/gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.50
diff -c -3 -p -r1.50 asm-source.exp
*** gdb/testsuite/gdb.asm/asm-source.exp	25 May 2004 04:07:05 -0000	1.50
--- gdb/testsuite/gdb.asm/asm-source.exp	26 Jul 2004 17:14:38 -0000
*************** set asm-arch ""
*** 35,47 ****
  set asm-note "empty"
  set asm-flags ""
  set link-flags "--entry _start"
  
  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}"
      }
      "*arm-*-*" {
          set asm-arch arm
--- 35,49 ----
  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 "-no-mdebug -I${srcdir}/${subdir} -I${objdir}/${subdir}"
! 	set debug-flags "-gdwarf-2"
      }
      "*arm-*-*" {
          set asm-arch arm
*************** switch -glob -- [istarget] {
*** 63,69 ****
      }
      "x86_64-*-*" {
          set asm-arch x86_64
!         set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "i\[3456\]86-*-*" {
          set asm-arch i386
--- 65,72 ----
      }
      "x86_64-*-*" {
          set asm-arch x86_64
!         set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
! 	set debug-flags "-gdwarf-2"
      }
      "i\[3456\]86-*-*" {
          set asm-arch i386
*************** switch -glob -- [istarget] {
*** 88,105 ****
      }
      "sh*-*-*" {
          set asm-arch sh
!         set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "sparc-*-*" {
          set asm-arch sparc
      }
      "sparc64-*-*" {
          set asm-arch sparc64
!         set asm-flags "-xarch=v9 -gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "xstormy16-*-*" {
          set asm-arch xstormy16
!         set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "v850-*-*" {
          set asm-arch v850
--- 91,111 ----
      }
      "sh*-*-*" {
          set asm-arch sh
!         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 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
! 	set debug-flags "-gdwarf-2"
      }
      "xstormy16-*-*" {
          set asm-arch xstormy16
!         set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
! 	set debug-flags "-gdwarf-2"
      }
      "v850-*-*" {
          set asm-arch v850
*************** switch -glob -- [istarget] {
*** 110,120 ****
      }
      "ia64-*-*" {
          set asm-arch ia64
!         set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "hppa*-linux-*" {
          set asm-arch pa
!         set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
  }
  
--- 116,128 ----
      }
      "ia64-*-*" {
          set asm-arch ia64
!         set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
! 	set debug-flags "-gdwarf-2"
      }
      "hppa*-linux-*" {
          set asm-arch pa
!         set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
! 	set debug-flags "-gdwarf-2"
      }
  }
  
*************** remote_exec build "rm -f ${subdir}/note.
*** 161,173 ****
  remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
  
  if { "${asm-flags}" == "" } {
!     set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
  }
  
! if {[target_assemble ${srcdir}/${subdir}/${srcfile1} asmsrc1.o "${asm-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 {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
--- 169,192 ----
  remote_download host ${srcdir}/${subdir}/${asm-note}.inc ${subdir}/note.inc
  
  if { "${asm-flags}" == "" } {
!     set asm-flags "-I${srcdir}/${subdir} -I${objdir}/${subdir}"
!     set debug-flags "-gstabs"
  }
  
! # 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} ${debug-flags}"] != ""} then {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]