public inbox for sid@sourceware.org
 help / color / mirror / Atom feed
From: matthew green <mrg@cygnus.com>
To: gdb-patches@sources.redhat.com, sid@sources.redhat.com
Cc: binutils@sources.redhat.com
Subject: PATCH: running sid from the build tree during "make check"
Date: Fri, 06 Apr 2001 22:35:00 -0000	[thread overview]
Message-ID: <6256.986621713@cygnus.com> (raw)

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

             reply	other threads:[~2001-04-06 22:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-06 22:35 matthew green [this message]
2001-04-07  6:20 ` Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6256.986621713@cygnus.com \
    --to=mrg@cygnus.com \
    --cc=binutils@sources.redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=sid@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).