Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Michael Chastain <mec.gnu@mindspring.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: RFA/RFC: Change Sparc64 gdb.asm tests to use -gdwarf2 instead of  -gstabs
Date: Mon, 26 Jul 2004 17:31:00 -0000	[thread overview]
Message-ID: <41054231.7010006@redhat.com> (raw)
In-Reply-To: <41051014.nailLY111456S@mindspring.com>

[-- Attachment #1: Type: text/plain, Size: 2942 bytes --]

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.

[-- Attachment #2: asm-source.exp.patch --]
[-- Type: text/plain, Size: 5433 bytes --]

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."
  }
  

  reply	other threads:[~2004-07-26 17:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-26 12:59 Nick Clifton
     [not found] ` <41051014 dot nailLY111456S at mindspring dot com>
2004-07-26 14:07 ` Michael Chastain
2004-07-26 17:31   ` Nick Clifton [this message]
2004-07-26 23:55     ` Michael Chastain
2004-07-29 23:03       ` Mark Kettenis
2004-07-29 23:38         ` Michael Chastain
2004-07-30  0:07           ` Mark Kettenis
2004-07-30 11:55         ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41054231.7010006@redhat.com \
    --to=nickc@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=mec.gnu@mindspring.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox