public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
* PATCH: running sid from the build tree during "make check"
@ 2001-04-06 22:35 matthew green
  2001-04-07  6:20 ` Frank Ch. Eigler
  0 siblings, 1 reply; 2+ messages in thread
From: matthew green @ 2001-04-06 22:35 UTC (permalink / raw)
  To: gdb-patches, sid; +Cc: binutils

[ 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]
  

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

* Re: PATCH: running sid from the build tree during "make check"
  2001-04-06 22:35 PATCH: running sid from the build tree during "make check" matthew green
@ 2001-04-07  6:20 ` Frank Ch. Eigler
  0 siblings, 0 replies; 2+ messages in thread
From: Frank Ch. Eigler @ 2001-04-07  6:20 UTC (permalink / raw)
  To: matthew green; +Cc: sid

Hi -

On Sat, Apr 07, 2001 at 03:35:13PM +1000, matthew green wrote:
: [ not sure exactly who owns all these parts. ]

No problem - broadcasting is okay.

: this allows one to run the testsuites using `sid' from the build tree,
: rather than an installed version as is currently required.  [...]

One change idea:  Instead of using the "set loader file FOO" mechanism,
(and suffering some need to parse it), how about getting the test suite
to rename/copy target executables to the a.out name before execution?


- FChE
-- 
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE6zxP/VZbdDOm/ZT0RAoINAJ0d35OGQNrNOerMZ7x69o+CBwnAPQCff1oi
s3H4qYitxMFtYZ8sXqLAYts=
=rbfE
-----END PGP SIGNATURE-----

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

end of thread, other threads:[~2001-04-07  6:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-06 22:35 PATCH: running sid from the build tree during "make check" matthew green
2001-04-07  6:20 ` Frank Ch. Eigler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).