"Steve Ellcey " <sell...@mips.com> writes:
> While looking at some GCC testsuite failures that were occuring while
> testing with the qemu simulator I ran into a problem that I believe is
> due to a missing override of sim_exec in config/sim.exp.
>
> Basically the script in GCC (gcc/testsuite/lib/profopt.exp) was running:
>
>       remote_file build delete $execname1
>
> to remove a file and this was being translated into a rsh/ssh command
> to my simulator baseboard as if it was a remote system.  After some
> false leads I now believe that the problem is that config/sim.exp has
> overrides for load, upload, and download, but no override for exec.
>
> I made this patch to my dejagnu and now things are working, can this
> patch be checked in to the dejagnu source tree?

I agree that's probably safe in practice, but it seems a bit odd for
sim_exec to execute host binaries rather than target binaries.  The comment
for remote_exec says:

# Execute the supplied program on HOSTNAME.

which leaves it a bit vague as to what "supplied" means.  standard_file
uses it with /bin commands, but if any harnesses are building the program
for the board themselves then running on the host won't work for many
simulator setups.  I suppose it'd be OK for qemu though thanks to misc
binary support.

Maybe a safer fix would be to provide sim_file instead.  Untested patch below.

Of course, that leaves remote_exec broken, but if it gets called and fails
in other contexts then maybe it'd be clearer then whether to use host
execution or to split out most of sim_load into sim_exec.

Thanks,
Richard

diff --git a/config/sim.exp b/config/sim.exp
index ab83835..574ca72 100644
--- a/config/sim.exp
+++ b/config/sim.exp
@@ -133,6 +133,10 @@ proc sim_upload { dest srcfile args } {
     return [remote_upload host $srcfile $args]
 }
 
+proc sim_file { board args } {
+    return [eval [list remote_file host] $args]
+}
+
 set_board_info protocol  "sim"
 
 # By default, assume the simulator is slow.  This causes some tests
_______________________________________________
DejaGnu mailing list
DejaGnu@gnu.org
https://lists.gnu.org/mailman/listinfo/dejagnu

Reply via email to