aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorSteve Chamberlain <sac@cygnus>1994-11-24 05:33:47 +0000
committerSteve Chamberlain <sac@cygnus>1994-11-24 05:33:47 +0000
commitd2fd61a812e28231f53812a02934de33bc2eec2d (patch)
tree01d43cd6b68e386568ba8e2614dd5f0c466ee85c /sim
parent3f67e000289c164137514a6419c7cc75dd26c7d7 (diff)
downloadgdb-d2fd61a812e28231f53812a02934de33bc2eec2d.zip
gdb-d2fd61a812e28231f53812a02934de33bc2eec2d.tar.gz
gdb-d2fd61a812e28231f53812a02934de33bc2eec2d.tar.bz2
* interp.c ([wr][bwl]at): New functions.
(trap): Cope with both byte modes.
Diffstat (limited to 'sim')
-rw-r--r--sim/sh/.Sanitize23
-rw-r--r--sim/sh/ChangeLog28
-rw-r--r--sim/sh/Makefile.in62
-rw-r--r--sim/sh/configure.in6
-rw-r--r--sim/sh/run.c20
5 files changed, 110 insertions, 29 deletions
diff --git a/sim/sh/.Sanitize b/sim/sh/.Sanitize
index 3ad8665..989238d 100644
--- a/sim/sh/.Sanitize
+++ b/sim/sh/.Sanitize
@@ -39,4 +39,27 @@ Things-to-lose:
Do-last:
+# Don't try to clean directories here, as the 'mv' command will fail.
+# Also, grep fails on NFS mounted directories.
+if ( echo $* | grep keep\-sh3 > /dev/null ) ; then
+ for i in * ; do
+ if test ! -d $i && (grep sanitize-sh3 $i > /dev/null) ; then
+ echo Keeping SH3 stuff in $i
+ fi
+ done
+else
+ for i in * ; do
+ if test ! -d $i && (grep sanitize-sh3 $i > /dev/null) ; then
+ echo Cleaning the \"SH3\" out of $i...
+ cp $i new
+ sed '/start\-sanitize\-sh3/,/end-\sanitize\-sh3/d' < $i > new
+ if [ -n "${safe}" -a ! -f .Recover/$i ] ; then
+ echo Caching $i in .Recover...
+ mv $i .Recover
+ fi
+ mv new $i
+ fi
+ done
+fi
+
# End of file.
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index eb3c1f5..a9f0c5c 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,31 @@
+Wed Nov 23 21:31:55 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * interp.c ([wr][bwl]at): New functions.
+ (trap): Cope with both byte modes.
+
+Thu Sep 8 17:35:07 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * gencode.c (tab): Simulate T bit after a negc insn right.
+ * interp.c (RSBAT): Sign extend the arg.
+ (ACE_FAST): New macro.
+ (sim_resume): Remove obsolete test of sim_timeout.
+
+Fri Aug 5 14:12:31 1994 Steve Chamberlain (sac@jonny.cygnus.com)
+
+ * interp.c (IOMEM): New function, simulates very basic I/O area of
+ the SH.
+ (WBAT, RBAT) : Call I/O functions.
+ * gencode.c (tab): Special case trapa #3.
+
+Mon Jun 27 18:04:54 1994 Steve Chamberlain (sac@cirdan.cygnus.com)
+
+ * run.c (main): Specify the file type again.
+
+Thu May 26 19:04:37 1994 Steve Chamberlain (sac@thepub.cygnus.com)
+
+ * interp.c (trap): Fix irix incompatibility.
+ * run.c (main): open without specifying file type.
+
Wed May 18 14:18:53 1994 Doug Evans (dje@canuck.cygnus.com)
* interp.c (sim_*): Make result void where there isn't one.
diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
index a270062..6bfb402 100644
--- a/sim/sh/Makefile.in
+++ b/sim/sh/Makefile.in
@@ -17,12 +17,16 @@
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
srcdir = .
+srcroot = $(srcdir)/../../
+
prefix = /usr/local
+
program_transform_name =
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
+tooldir = $(libdir)/$(target_alias)
datadir = $(prefix)/lib
mandir = $(prefix)/man
@@ -42,43 +46,56 @@ docdir = $(srcdir)/doc
SHELL = /bin/sh
-INSTALL = install -c
+
+
+INSTALL = $(srcroot)/install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
+INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
+INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1
+
+
+CC_FOR_BUILD = cc
AR = ar
AR_FLAGS = qc
CFLAGS = -g
BISON = bison
MAKEINFO = makeinfo
RANLIB = ranlib
-
+X=xstuff.o
+XL=-lX11
+X=
+XL=
INCDIR = $(srcdir)/../../include
-CSEARCH = -I.-I$(srcdir) -I../../include -I../../bfd -I$(INCDIR) -I$(srcdir)/../../bfd
+CSEARCH = -I. -I$(srcdir) -I../../include -I../../bfd -I$(INCDIR) -I$(srcdir)/../../bfd -I$(srcdir)/../../gdb
DEP = mkdep
#### host, target, and site specific Makefile frags come in here.
-all: run
+all: run libsim.a
-run: interp.o run.o table.o
- $(CC) -o run interp.o table.o run.o ../../bfd/libbfd.a ../../libiberty/libiberty.a
+run: interp.o $(X) run.o table.o
+ $(CC) $(CFLAGS) -o run $(X) interp.o table.o run.o ../../bfd/libbfd.a ../../libiberty/libiberty.a $(XL)
interp.o:interp.c code.c table.c
run.o:run.c
+libsim.a:interp.o table.o
+ $(AR) $(ARFLAGS) libsim.a interp.o table.o
+ $(RANLIB) libsim.a
+
code.c:gencode
./gencode -x >code.c
- indent code.c
+# indent code.c
table.c:gencode
./gencode -s >table.c
- indent table.c
+# indent table.c
-gencode.o:gencode.c
-
-gencode:gencode.o
+gencode:gencode.c
+ $(CC_FOR_BUILD) -o gencode $<
#### host and target dependent Makefile fragments come in here.
@@ -148,17 +165,20 @@ roll:
#
force:
+# Copy the files into directories where they will be run.
install:
- -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
- if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
- -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
- -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
- if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
- -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
- -n=`t='$(program_transform_name)'; echo run | sed -e "" $$t`; \
- $(INSTALL_PROGRAM) run $(bindir)/$$n; \
- $(M_INSTALL)
-
+ srcroot=`cd $(srcroot); pwd`; export srcroot; \
+ $(INSTALL_XFORM) run $(bindir)/run ; \
+ n=`t='$(program_transform_name)'; echo run | sed -e "" $$t`; \
+ if [ -d $(tooldir) ] ; then \
+ if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
+ rm -f $(tooldir)/bin/run; \
+ ln $(bindir)/$$n $(tooldir)/bin/run \
+ || $(INSTALL_PROGRAM) run $(tooldir)/bin/run; \
+ else true; fi
+
+install-man: run.1
+ $(INSTALL_XFORM1) $(srcdir)/run.1 $(man1dir)/run.1
Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
diff --git a/sim/sh/configure.in b/sim/sh/configure.in
index 1cba932..26b6195 100644
--- a/sim/sh/configure.in
+++ b/sim/sh/configure.in
@@ -31,3 +31,9 @@ fi
# per-target:
+case "${target}" in
+ sh-*-*) sim_target=sh ;;
+ shl-*-*) sim_target=shl ;;
+esac
+
+target_makefile_frag=${sim_target}.mt
diff --git a/sim/sh/run.c b/sim/sh/run.c
index fae062c..d85cee5 100644
--- a/sim/sh/run.c
+++ b/sim/sh/run.c
@@ -27,6 +27,8 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "sysdep.h"
#include "remote-sim.h"
+int target_byte_order;
+
int
main (ac, av)
int ac;
@@ -39,7 +41,7 @@ main (ac, av)
int verbose = 0;
int trace = 0;
char *name = "";
-
+
for (i = 1; i < ac; i++)
{
if (strcmp (av[i], "-v") == 0)
@@ -52,17 +54,17 @@ main (ac, av)
}
else if (strcmp (av[i], "-p") == 0)
{
- sim_set_profile(atoi(av[i+1]));
+ sim_set_profile (atoi (av[i + 1]));
i++;
}
else if (strcmp (av[i], "-s") == 0)
{
- sim_set_profile_size(atoi(av[i+1]));
+ sim_set_profile_size (atoi (av[i + 1]));
i++;
}
else if (strcmp (av[i], "-m") == 0)
{
- sim_size(atoi(av[i+1]));
+ sim_size (atoi (av[i + 1]));
i++;
}
else
@@ -74,10 +76,9 @@ main (ac, av)
{
printf ("run %s\n", name);
}
- abfd = bfd_openr (name, "coff-sh");
+ abfd = bfd_openr (name, 0);
if (abfd)
{
-
if (bfd_check_format (abfd, bfd_object))
{
@@ -94,6 +95,9 @@ main (ac, av)
start_address = bfd_get_start_address (abfd);
sim_create_inferior (start_address, NULL, NULL);
+
+ target_byte_order = abfd->xvec->byteorder_big_p ? 4321 : 1234;
+
if (trace)
{
int done = 0;
@@ -112,10 +116,10 @@ main (ac, av)
/* Find out what was in r0 and return that */
{
unsigned char b[4];
- sim_fetch_register(0, b);
+ sim_fetch_register (0, b);
return b[3];
}
-
+
}
}