This is the mail archive of the gdb-patches@sourceware.cygnus.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]

[rfa/rfc] testsuite/gdb.asm without GCC


Hello,

The attatched patch rewrites removes any assumption that there is a
compiler from testsuite/gdb.asm.  It instead only tries to use AS and
LD.  If you're bringing up a new GDB then often this is all you get.

Thoughts,

	Andrew

PS: It affects one target - the d10v.
Tue Jul  4 03:43:49 2000  Andrew Cagney  <cagney@b1.cygnus.com>

	* gdb.asm/asm-source.exp: Use raw AS/LD instead of CC to
 	compile/link program.
	* gdb.asm/d10v.inc: Define ``startup''.
	* gdb.asm/asmsrc1.s: Add definition of _start.
	
Index: gdb.asm/asm-source.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 asm-source.exp
*** asm-source.exp	1999/04/16 01:34:29	1.1.1.1
--- asm-source.exp	2000/07/03 17:46:13
*************** if $tracelevel then {
*** 31,39 ****
  set prms_id 0
  set bug_id 0
  
  if [istarget "d10v-*-*"] then {
      set asm-arch d10v
! } else {
      verbose "Skipping assembly source test -- not implemented for this target."
      return 
  }
--- 31,43 ----
  set prms_id 0
  set bug_id 0
  
+ set asm-arch ""
+ set asm-flags ""
+ 
  if [istarget "d10v-*-*"] then {
      set asm-arch d10v
! }
! if { "${asm-arch}" == "" } {
      verbose "Skipping assembly source test -- not implemented for this target."
      return 
  }
*************** set binfile ${objdir}/${subdir}/${testfi
*** 43,58 ****
  set src1 ${srcdir}/${subdir}/asmsrc1.s
  set src2 ${srcdir}/${subdir}/asmsrc2.s
  
! set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
  
! if {[gdb_compile ${src1} asmsrc1.o object "additional_flags=${asm-flags}"] != ""} then {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
! if {[gdb_compile ${src2} asmsrc2.o object "additional_flags=${asm-flags}"] != ""} then {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
! if  { [gdb_compile "asmsrc1.o asmsrc2.o" ${binfile} executable "ldflags=-nodefaultlibs"] != "" } {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
--- 47,65 ----
  set src1 ${srcdir}/${subdir}/asmsrc1.s
  set src2 ${srcdir}/${subdir}/asmsrc2.s
  
! if { "${asm-flags}" == "" } {
!     #set asm-flags "-Wa,-gstabs,-I${srcdir}/${subdir},-I${objdir}/${subdir}"
!     set asm-flags "-gstabs -I${srcdir}/${subdir} -I${objdir}/${subdir}"
! }
  
! if {[target_assemble ${src1} asmsrc1.o "${asm-flags}"] != ""} then {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
! if {[target_assemble ${src2} asmsrc2.o "${asm-flags}"] != ""} then {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
! if  { [target_link "asmsrc1.o asmsrc2.o" ${binfile} ""] != "" } {
       gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
  }
  
*************** if ![runto_main] then {
*** 72,81 ****
  }
  
  # Execute the `f' command and see if the result includes source info.
! gdb_test "f" "asmsrc1\[.\]s:18.*several_nops" "f at main"
  
  # See if we properly `next' over a macro with several insns.
! gdb_test "n" "22\[ 	\]*.*foo2" "next over macro"
  
  # See if we can properly `step' into a subroutine call.
  gdb_test "s" "8\[ 	\]*.*" "step into foo2"
--- 79,88 ----
  }
  
  # Execute the `f' command and see if the result includes source info.
! gdb_test "f" "asmsrc1\[.\]s:29.*several_nops" "f at main"
  
  # See if we properly `next' over a macro with several insns.
! gdb_test "n" "33\[ 	\]*.*foo2" "next over macro"
  
  # See if we can properly `step' into a subroutine call.
  gdb_test "s" "8\[ 	\]*.*" "step into foo2"
*************** gdb_test "f" ".*asmsrc2\[.\]s:8.*" "f in
*** 85,93 ****
  
  # `next' one insn (or macro) to set up our stackframe (for the following bt).
  gdb_test "n" "12\[ 	\]*.*foo3" "n in foo2"
  
! # See if `bt' prints the right source files.
! gdb_test "bt" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:22" "bt in foo2"
  
  # Step into another subroutine which lives back in the first source file.
  gdb_test "s" "" "s 2"
--- 92,103 ----
  
  # `next' one insn (or macro) to set up our stackframe (for the following bt).
  gdb_test "n" "12\[ 	\]*.*foo3" "n in foo2"
+ 
+ # See if a simple `bt' prints the right source files and doesn't fall off the stack.
+ gdb_test "bt 10" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33" "bt ALL in foo2"
  
! # See if a capped `bt' prints the right source files.
! gdb_test "bt 2" "\#0.*foo2.*asmsrc2\[.\]s:12.*\#1.*main.*asmsrc1\[.\]s:33.*" "bt 2 in foo2"
  
  # Step into another subroutine which lives back in the first source file.
  gdb_test "s" "" "s 2"
*************** gdb_test "s" "" "s 2"
*** 95,99 ****
  # Next over insns to set up the stack frame.
  gdb_test "n" "" "n 2"
  
! # Now see if `bt' is correct.
! gdb_test "bt" "\#0.*foo3.*asmsrc1\[.\]s:33.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:22" "bt in foo3"
--- 105,109 ----
  # Next over insns to set up the stack frame.
  gdb_test "n" "" "n 2"
  
! # Now see if a capped `bt' is correct.
! gdb_test "bt 3" "\#0.*foo3.*asmsrc1\[.\]s:44.*\#1.*foo2.*asmsrc2\[.\]s:12.*\#2.*main.*asmsrc1\[.\]s:33.*" "bt 3 in foo3"
Index: gdb.asm/asmsrc1.s
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asmsrc1.s,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 asmsrc1.s
*** asmsrc1.s	1999/04/16 01:34:30	1.1.1.1
--- asmsrc1.s	2000/07/03 17:46:13
***************
*** 1,13 ****
  	.include "common.inc"
  	.include "arch.inc"
  
  comment "main routine for assembly source debugging test"
  comment "This particular testcase uses macros in <arch>.inc to achieve"
! comment "machine independence.  This file must be compiled with -Darch=foo."
! 
! comment "WARNING: asm-source.exp checks for line numbers printed by gdb,"
! comment "therefore be careful about changing this file without also changing"
! comment "asm-source.exp."
  
  	.global main
  main:
--- 1,24 ----
  	.include "common.inc"
  	.include "arch.inc"
  
+ comment "WARNING: asm-source.exp checks for line numbers printed by gdb."
+ comment "Be careful about changing this file without also changing"
+ comment "asm-source.exp."
+ 
+ 	
+ comment	"This file is not linked with crt0."
+ comment	"Provide very simplistic equivalent."
+ 	
+ 	.global _start
+ _start:
+ 	startup
+ 	call main
+ 	exit0
+ 
+ 
  comment "main routine for assembly source debugging test"
  comment "This particular testcase uses macros in <arch>.inc to achieve"
! comment "machine independence."
  
  	.global main
  main:
Index: gdb.asm/d10v.inc
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/d10v.inc,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 d10v.inc
*** d10v.inc	1999/04/16 01:34:30	1.1.1.1
--- d10v.inc	2000/07/03 17:46:13
***************
*** 26,28 ****
--- 26,32 ----
  	ldi r0, 0
  	trap 15
  	.endm
+ 
+ 	comment "crt0 startup"
+ 	.macro startup
+ 	.endm

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