This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


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

PATCH: running sid from the build tree during "make check"




[ not sure exactly who owns all these parts. ]


hi folks.


this allows one to run the testsuites using `sid' from the build tree,
rather than an installed version as is currently required.  i've been
testing this for some months.  it is fully backwards compatible with
the current method, and requires that the `baseboard' description ask
for this way of starting the simulator by setting `sim,protocol' for
the target to the string "sid".


OK to commit?


.mrg.



[dejagnu/ChangeLog]
2001-04-07  matthew green  <mrg@redhat.com>

	* config/sim.exp (sim_load): Handle sim,protocol of `sid.'

[gdb/testsuite/ChangeLog]
2001-04-07  matthew green  <mrg@redhat.com>

	* config/sid.exp (sid_start): Handle sim,protocol of `sid.'

[sim/testsuite/ChangeLog]
2001-02-16  matthew green  <mrg@redhat.com>

	* lib/sim-defs.exp (sim_run): Handle sim,protocol of `sid.'

Index: dejagnu/config/sim.exp
===================================================================
RCS file: /cvs/src/src/dejagnu/config/sim.exp,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 sim.exp
*** sim.exp	1999/11/09 01:28:42	1.1.1.1
--- sim.exp	2001/04/07 05:24:01
*************** proc sim_spawn { dest cmdline args } {
*** 48,56 ****
  	# download the program to remote.
  	# we're assuming the program is the first word in the command.
  	# FIXME: "prog < infile" won't work until we download infile.
! 	set prog [lindex $cmdline 0]
! 	set prog [remote_download host $prog a.out];
! 	set cmdline [lreplace $cmdline 0 0 $prog]
      }
  
      return [eval remote_spawn host \{ $sim $simflags $cmdline \} $args];
--- 48,67 ----
  	# download the program to remote.
  	# we're assuming the program is the first word in the command.
  	# FIXME: "prog < infile" won't work until we download infile.
! 
! 	if { [board_info target sim,protocol] == "sid" } {
! 	    # ick, we have to decode ``-e "set loader file /path/to/foo.x"''
! 	    if { [lindex $cmdline 0] == "-e" } {
! 		set line [lindex $cmdline 1]
! 		set prog [lindex $line 3]
! 	        set prog [remote_download host $prog a.out];
! 	        set cmdline [lreplace $cmdline 0 1]
! 	    }
! 	} else {
! 	    set prog [lindex $cmdline 0]
! 	    set prog [remote_download host $prog a.out];
! 	    set cmdline [lreplace $cmdline 0 0 $prog]
!         }
      }
  
      return [eval remote_spawn host \{ $sim $simflags $cmdline \} $args];
*************** proc sim_load { dest prog args } {
*** 82,94 ****
  
      set output "";
  
      # Run the program with a limited amount of real time. While
      # this isn't as nice as limiting the amount of CPU time, it
      # will have to do.
      if { $inpfile != "" } {
! 	set res [remote_spawn target "${prog} < $inpfile" "readonly"];
      } else {
! 	set res [remote_spawn target "${prog}"];
      }
  
      if { $res <= 0 } {
--- 93,111 ----
  
      set output "";
  
+     if { [board_info target sim,protocol] == "sid" } {
+ 	set cmd "-e \"set loader file $prog\""
+     } else {
+ 	set cmd $prog
+     }
+ 
      # Run the program with a limited amount of real time. While
      # this isn't as nice as limiting the amount of CPU time, it
      # will have to do.
      if { $inpfile != "" } {
! 	set res [remote_spawn target "${cmd} < $inpfile" "readonly"];
      } else {
! 	set res [remote_spawn target "${cmd}"];
      }
  
      if { $res <= 0 } {
Index: gdb/testsuite/config/sid.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/config/sid.exp,v
retrieving revision 1.2
diff -p -r1.2 sid.exp
*** sid.exp	2001/03/06 08:21:48	1.2
--- sid.exp	2001/04/07 05:24:08
*************** proc sid_start {} {
*** 50,56 ****
  	    set env(MKSID) "../../sid/main/static/mksid"
  	    if {! [file exists $env(SID)]} then { error "Cannot find sid in build tree" }
  	}
! 	set spawncmd "../../sid/bsp/[target_info sim] $sidverbose $sidendian --persistent --gdb=$port [target_info sim,options]"
  	set post_spawn {
  	    global env
  	    unset env(SID_LIBRARY_PATH)
--- 50,60 ----
  	    set env(MKSID) "../../sid/main/static/mksid"
  	    if {! [file exists $env(SID)]} then { error "Cannot find sid in build tree" }
  	}
! 	if { [board_info target sim,protocol] == "sid" } {
! 	    set spawncmd "[target_info sim] [target_info sim,options] -e \"set gdb-socket sockaddr-local 0.0.0.0:$port\""
! 	} else {
! 	    set spawncmd "../../sid/bsp/[target_info sim] $sidverbose $sidendian --gdb=$port [target_info sim,options]"
! 	}
  	set post_spawn {
  	    global env
  	    unset env(SID_LIBRARY_PATH)
*************** proc sid_start {} {
*** 58,65 ****
  	    unset env(SID)
  	}
      } else {
  	set pre_spawn {}
! 	set spawncmd "[target_info sim] $sidverbose $sidendian --persistent --gdb=$port [target_info sim,options]"
  	set post_spawn {}
      }
  
--- 62,77 ----
  	    unset env(SID)
  	}
      } else {
+ 	global find_rawsid;
+ 
  	set pre_spawn {}
! 	if { [board_info target sim,protocol] == "sid" } {
! 	    # FIXME: sim,options may be from the build tree, should find
! 	    # it in the install tree.
! 	    set spawncmd "sid [target_info sim,options] -e \"set gdb-socket sockaddr-local 0.0.0.0:$port\""
! 	} else {
! 	    set spawncmd "[target_info sim] $sidverbose $sidendian --gdb=$port [target_info sim,options]"
! 	}
  	set post_spawn {}
      }
  
Index: sim/testsuite/lib/sim-defs.exp
===================================================================
RCS file: /cvs/src/src/sim/testsuite/lib/sim-defs.exp,v
retrieving revision 1.2
diff -p -r1.2 sim-defs.exp
*** sim-defs.exp	2000/11/01 15:40:17	1.2
--- sim-defs.exp	2001/04/07 05:24:08
*************** proc sim_run { prog sim_opts prog_opts r
*** 109,120 ****
  	set sim "env $testcase_env $sim"
      }
  
!     send_log "$sim $always_opts $SIMFLAGS $sim_opts $prog $prog_opts\n"
  
      if { "$redir" == "" } {
! 	remote_spawn host "$sim $always_opts $SIMFLAGS $sim_opts $prog $prog_opts"
      } else {
! 	remote_spawn host "$sim $always_opts $SIMFLAGS $sim_opts $prog $prog_opts $redir" writeonly
      }
      set result [remote_wait host $testcase_timeout]
  
--- 109,127 ----
  	set sim "env $testcase_env $sim"
      }
  
!     if { [board_info target sim,protocol] == "sid" } {
! 	set cmd ""
! 	set sim_opts "$sim_opts -e \"set loader file [list ${prog}]\""
!     } else {
! 	set cmd "$prog"
!     }
! 
!     send_log "$sim $always_opts $SIMFLAGS $sim_opts $cmd $prog_opts\n"
  
      if { "$redir" == "" } {
! 	remote_spawn host "$sim $always_opts $SIMFLAGS $sim_opts $cmd $prog_opts"
      } else {
! 	remote_spawn host "$sim $always_opts $SIMFLAGS $sim_opts $cmd $prog_opts $redir" writeonly
      }
      set result [remote_wait host $testcase_timeout]
  


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