Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [rfc/testsuite] asm-source.exp: convert debug_flags
@ 2004-07-30  5:59 Michael Chastain
  2004-07-30 11:59 ` Nick Clifton
  2004-07-30 14:02 ` Mark Kettenis
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Chastain @ 2004-07-30  5:59 UTC (permalink / raw)
  To: kettenis, gdb-patches; +Cc: nickc

Okay, how about this?

I added a comment that debug_flags is in the format that gcc expects,
and that the test script adjusts to the format that the assembler
expects.

Also I strip out "-g2" and "-g3" because as soon as I ran my testbed
I noticed that my testbed provides those.

Tested on native i686-pc-linux-gnu with gcc 3.3.4 and binutils 2.15
with the following flags:

  make check RUNTESTFLAGS="asm-source.exp"
  make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gdwarf-2 asm-source.exp"
  make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gdwarf2 asm-source.exp"
  make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gstabs+ asm-source.exp"
  make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gstabs asm-source.exp"
  make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-gstabs+\\\\\\ -g2 asm-source.exp"
  make check RUNTESTFLAGS="--target_board=unix/gdb:debug_flags=-g3\\\\\\ -gdwarf-2 asm-source.exp"

Mark, does this patch work for you too?  If it does, I'll commit it.

Michael C

2004-07-29  Michael Chastain  <mec.gnu@mindspring.com>

	* gdb.base/asm-source.exp: Properly convert target board
	debug flags from gcc format to binutils format.

Index: asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.51
diff -c -3 -p -r1.51 asm-source.exp
*** asm-source.exp	27 Jul 2004 09:28:42 -0000	1.51
--- asm-source.exp	30 Jul 2004 05:57:33 -0000
*************** switch -glob -- [istarget] {
*** 77,87 ****
      }
      "m6811-*-*" {
          set asm-arch m68hc11
!         set asm-flags "-mshort-double -m68hc11 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "m6812-*-*" {
          set asm-arch m68hc11
!         set asm-flags "-mshort-double -m68hc12 -gdwarf2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "mips*-*" {
          set asm-arch mips
--- 77,87 ----
      }
      "m6811-*-*" {
          set asm-arch m68hc11
!         set asm-flags "-mshort-double -m68hc11 -gdwarf-2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "m6812-*-*" {
          set asm-arch m68hc11
!         set asm-flags "-mshort-double -m68hc12 -gdwarf-2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
      }
      "mips*-*" {
          set asm-arch mips
*************** if { "${asm-flags}" == "" } {
*** 173,187 ****
      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."
--- 173,202 ----
      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 debug flags are in the format that gcc expects:
! # "-gdwarf-2", "-gstabs+", or "-gstabs".  To be compatible with the
! # other languages in the test suite, we accept this input format.
! # So the user can run the test suite with:
! #
! #   runtest --target_board unix/gdb:debug_flags=-gdwarf-2
! #   make check RUNTESTFLAGS="--target_board unix/gdb:debug_flags=-gdwarf-2"
! #
! # However, the GNU assembler has different spellings than gcc.
! # So I adjust the debug flags here.
! 
! # The GNU assembler spells "dwarf-2" as "dwarf2".
! regsub "--" "-gdwarf-2" "${debug-flags}" "-gdwarf2" debug-flags
! 
! # The GNU assembler before 2.15 did not support "stabs+".
! regsub "--" "-gstabs\[+\]" "${debug-flags}" "-gstabs" debug-flags
! 
! # The GNU assembler does not support level options like "-g2" or "-g3".
! regsub "--" "-g\[0-9\]" "${debug-flags}" "" debug-flags
  
  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."


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfc/testsuite] asm-source.exp: convert debug_flags
  2004-07-30  5:59 [rfc/testsuite] asm-source.exp: convert debug_flags Michael Chastain
@ 2004-07-30 11:59 ` Nick Clifton
  2004-07-30 12:18   ` Michael Chastain
  2004-07-30 14:02 ` Mark Kettenis
  1 sibling, 1 reply; 6+ messages in thread
From: Nick Clifton @ 2004-07-30 11:59 UTC (permalink / raw)
  To: Michael Chastain; +Cc: kettenis, gdb-patches

Hi Michael,

Darn - I should have read all of my email before replying to Mark.


> 2004-07-29  Michael Chastain  <mec.gnu@mindspring.com>
> 
> 	* gdb.base/asm-source.exp: Properly convert target board
> 	debug flags from gcc format to binutils format.

This patch is much better than mine, so I withdraw my patch.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfc/testsuite] asm-source.exp: convert debug_flags
  2004-07-30 11:59 ` Nick Clifton
@ 2004-07-30 12:18   ` Michael Chastain
  2004-07-30 15:17     ` Nick Clifton
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Chastain @ 2004-07-30 12:18 UTC (permalink / raw)
  To: nickc; +Cc: kettenis, gdb-patches

Nick Clifton writes:
> This patch is much better than mine, so I withdraw my patch.

Okay.

I'm feeling paranoid, so could I ask you to give my patch a spin on your
system, with whatever binutils you have?  I'd like to bury this PITA.

Michael C


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfc/testsuite] asm-source.exp: convert debug_flags
  2004-07-30  5:59 [rfc/testsuite] asm-source.exp: convert debug_flags Michael Chastain
  2004-07-30 11:59 ` Nick Clifton
@ 2004-07-30 14:02 ` Mark Kettenis
  2004-07-30 22:12   ` Michael Chastain
  1 sibling, 1 reply; 6+ messages in thread
From: Mark Kettenis @ 2004-07-30 14:02 UTC (permalink / raw)
  To: mec.gnu; +Cc: gdb-patches, nickc

   Date: Fri, 30 Jul 2004 02:00:01 -0400
   From: Michael Chastain <mec.gnu@mindspring.com>

   Okay, how about this?

   2004-07-29  Michael Chastain  <mec.gnu@mindspring.com>

	   * gdb.base/asm-source.exp: Properly convert target board
	   debug flags from gcc format to binutils format.

Works fine for me.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfc/testsuite] asm-source.exp: convert debug_flags
  2004-07-30 12:18   ` Michael Chastain
@ 2004-07-30 15:17     ` Nick Clifton
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Clifton @ 2004-07-30 15:17 UTC (permalink / raw)
  To: Michael Chastain; +Cc: kettenis, gdb-patches

Hi Michael,

> I'm feeling paranoid, so could I ask you to give my patch a spin on your
> system, with whatever binutils you have?  I'd like to bury this PITA.

I have just applied your patch locally and run several tests (x86 
native, sh-elf and xstormy16-elf crosses) - no problems whatsoever.

Cheers
   Nick



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rfc/testsuite] asm-source.exp: convert debug_flags
  2004-07-30 14:02 ` Mark Kettenis
@ 2004-07-30 22:12   ` Michael Chastain
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Chastain @ 2004-07-30 22:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: nickc, kettenis

Committed.

I hope this is a happy ending!

===

2004-07-29  Michael Chastain  <mec.gnu@mindspring.com>

	   * gdb.base/asm-source.exp: Properly convert target board
	   debug flags from gcc format to binutils format.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-07-30 22:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-30  5:59 [rfc/testsuite] asm-source.exp: convert debug_flags Michael Chastain
2004-07-30 11:59 ` Nick Clifton
2004-07-30 12:18   ` Michael Chastain
2004-07-30 15:17     ` Nick Clifton
2004-07-30 14:02 ` Mark Kettenis
2004-07-30 22:12   ` Michael Chastain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox