RFA/RFC: Change Sparc64 gdb.asm tests to use -gdwarf2 instead of -gstabs

Nick Clifton nickc@redhat.com
Mon Jul 26 17:31:00 GMT 2004


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.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: asm-source.exp.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20040726/c1b3e550/attachment.ksh>


More information about the Gdb-patches mailing list