aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>1998-03-15 02:43:00 +0000
committerDoug Evans <dje@google.com>1998-03-15 02:43:00 +0000
commit84c6d152d1229e1ed22622c1981192495ccb419e (patch)
tree99693fe37e400d5707c917914028e28a5ae7927e /sim/common
parent86a60941332cd44e8fb2eb6fcba0d91a9deb44d1 (diff)
downloadgdb-84c6d152d1229e1ed22622c1981192495ccb419e.zip
gdb-84c6d152d1229e1ed22622c1981192495ccb419e.tar.gz
gdb-84c6d152d1229e1ed22622c1981192495ccb419e.tar.bz2
* dv-sockser.c, dv-sockser.h: New files.
* Make-common.in (dv-sockser.o): Add rule for. * aclocal.m4: Check for fcntl.h. * config.h: Add HAVE_FCNTL_H. * sim-break.c (remove_breakpoint): Fix thinko. * sim-hload.c (sim_load): Provide default value of SIM_HANDLES_LMA. Use SIM_HANDLES_LMA for lma_p arg to sim_load_file.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/.Sanitize2
-rw-r--r--sim/common/ChangeLog12
-rw-r--r--sim/common/Make-common.in11
-rw-r--r--sim/common/aclocal.m427
-rw-r--r--sim/common/dv-sockser.h32
-rw-r--r--sim/common/sim-break.c4
6 files changed, 81 insertions, 7 deletions
diff --git a/sim/common/.Sanitize b/sim/common/.Sanitize
index 9558757..dd1d6cf 100644
--- a/sim/common/.Sanitize
+++ b/sim/common/.Sanitize
@@ -46,6 +46,8 @@ cgen-utils.c
config.in
configure.in
configure
+dv-sockser.c
+dv-sockser.h
gdbinit.in
genmloop.sh
gennltvals.sh
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 95fefc9..d7e64d3 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,15 @@
+Sat Mar 14 18:36:12 1998 Doug Evans <devans@seba.cygnus.com>
+
+ * dv-sockser.c, dv-sockser.h: New files.
+ * Make-common.in (dv-sockser.o): Add rule for.
+ * aclocal.m4: Check for fcntl.h.
+ * config.h: Add HAVE_FCNTL_H.
+
+ * sim-break.c (remove_breakpoint): Fix thinko.
+
+ * sim-hload.c (sim_load): Provide default value of SIM_HANDLES_LMA.
+ Use SIM_HANDLES_LMA for lma_p arg to sim_load_file.
+
1998-03-13 Fred Fish <fnf@cygnus.com>
* sim-base.h (struct sim_state_base): Add prog_syms and
diff --git a/sim/common/Make-common.in b/sim/common/Make-common.in
index 485b676..759f335 100644
--- a/sim/common/Make-common.in
+++ b/sim/common/Make-common.in
@@ -408,6 +408,11 @@ nrun.o: $(srccom)/nrun.c config.h tconfig.h \
$(sim_main_headers)
$(CC) -c $(srccom)/nrun.c $(ALL_CFLAGS)
+# Devices.
+
+dv-sockser.o: $(srccom)/dv-sockser.h $(sim_main_headers)
+ $(CC) -c $(srccom)/dv-sockser.c $(ALL_CFLAGS)
+
# CGEN support.
cgen-run.o: $(srccom)/cgen-run.c $(sim_main_headers) \
@@ -448,8 +453,12 @@ MAKEOVERRIDES=
tags etags: TAGS
+# Macros like EXTERN_SIM_CORE confuse tags.
+# And the sim-n-foo.h files create functions that can't be found either.
TAGS: force
- etags --regex '/^\/[*] TAGS: .*/' *.c *.h
+ cd $(srcdir) && \
+ etags --regex '/^\([a-z_]+\) (/\1/' --regex '/^\/[*] TAGS: .*/' \
+ *.[ch] ../common/*.[ch]
clean: $(SIM_EXTRA_CLEAN)
rm -f *.[oa] *~ core
diff --git a/sim/common/aclocal.m4 b/sim/common/aclocal.m4
index 990dfa2..67c5768 100644
--- a/sim/common/aclocal.m4
+++ b/sim/common/aclocal.m4
@@ -46,7 +46,9 @@ AC_PROG_RANLIB
# Check for common headers.
# FIXME: Seems to me this can cause problems for i386-windows hosts.
# At one point there were hardcoded AC_DEFINE's if ${host} = i386-*-windows*.
-AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h sys/time.h sys/resource.h)
+AC_CHECK_HEADERS(stdlib.h string.h strings.h unistd.h time.h)
+AC_CHECK_HEADERS(sys/time.h sys/resource.h)
+AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_FUNCS(getrusage time sigaction)
. ${srcdir}/../../bfd/configure.host
@@ -60,10 +62,11 @@ dnl all shall eventually behave the same way.
dnl We don't use automake, but we still want to support
dnl --enable-maintainer-mode.
+USE_MAINTAINER_MODE=no
AC_ARG_ENABLE(maintainer-mode,
[ --enable-maintainer-mode Enable developer functionality.],
[case "${enableval}" in
- yes) MAINT="" ;;
+ yes) MAINT="" USE_MAINTAINER_MODE=yes ;;
no) MAINT="#" ;;
*) AC_MSG_ERROR("--enable-maintainer-mode does not take a value"); MAINT="#" ;;
esac
@@ -472,19 +475,35 @@ fi])dnl
AC_SUBST(sim_hostendian)
+dnl --enable-sim-float is for developers of the simulator
+dnl It specifies the presence of hardware floating point
+dnl And optionally the bitsize of the floating point register.
+dnl arg[1] specifies the presence (or absence) of floating point hardware
+dnl arg[2] specifies the number of bits in a floating point register
AC_DEFUN(SIM_AC_OPTION_FLOAT,
[
-default_sim_floating_point="ifelse([$1],,0,[$1])"
+default_sim_float="[$1]"
+default_sim_float_bitsize="[$2]"
AC_ARG_ENABLE(sim-float,
[ --enable-sim-float Specify that the target processor has floating point hardware.],
[case "${enableval}" in
yes | hard) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT";;
no | soft) sim_float="-DWITH_FLOATING_POINT=SOFT_FLOATING_POINT";;
+ 32) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=32";;
+ 64) sim_float="-DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=64";;
*) AC_MSG_ERROR("Unknown value $enableval passed to --enable-sim-float"); sim_float="";;
esac
if test x"$silent" != x"yes" && test x"$sim_float" != x""; then
echo "Setting float flags = $sim_float" 6>&1
-fi],[sim_float="-DWITH_FLOATING_POINT=${default_sim_floating_point}"])dnl
+fi],[
+sim_float=
+if test x"${default_sim_float}" != x""; then
+ sim_float="-DWITH_FLOATING_POINT=${default_sim_float}"
+fi
+if test x"${default_sim_float_bitsize}" != x""; then
+ sim_float="$sim_float -DWITH_TARGET_FLOATING_POINT_BITSIZE=${default_sim_float_bitsize}"
+fi
+])dnl
])
AC_SUBST(sim_float)
diff --git a/sim/common/dv-sockser.h b/sim/common/dv-sockser.h
new file mode 100644
index 0000000..ef0a7a9
--- /dev/null
+++ b/sim/common/dv-sockser.h
@@ -0,0 +1,32 @@
+/* Serial port emulation via sockets.
+ Copyright (C) 1998, Free Software Foundation, Inc.
+
+This file is part of the GNU simulators.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef DV_SOCKSER_H
+#define DV_SOCKSER_H
+
+/* bits in result of dev_sockser_status */
+#define DV_SOCKSER_INPUT_EMPTY 1
+#define DV_SOCKSER_OUTPUT_EMPTY 2
+
+/* FIXME: later add a device ptr arg */
+extern int dv_sockser_status (SIM_DESC);
+int dv_sockser_write (SIM_DESC, unsigned char);
+int dv_sockser_read (SIM_DESC);
+
+#endif /* DV_SOCKSER_H */
diff --git a/sim/common/sim-break.c b/sim/common/sim-break.c
index 07d1f95..3b89560 100644
--- a/sim/common/sim-break.c
+++ b/sim/common/sim-break.c
@@ -82,7 +82,7 @@ remove_breakpoint (sd, bp)
sim_core_write_buffer (sd, NULL, exec_map, bp->loc_contents,
bp->addr, SIM_BREAKPOINT_SIZE);
- bp->flags &= SIM_BREAK_INSERTED;
+ bp->flags &= ~SIM_BREAK_INSERTED;
}
/* Come here when a breakpoint insn is hit. If it's really a breakpoint, we
@@ -161,7 +161,7 @@ sim_set_breakpoint (sd, addr)
if (bp->addr == addr)
return SIM_RC_DUPLICATE_BREAKPOINT; /* Already there */
else
- break;
+ break; /* FIXME: why not scan all bp's? */
bp = ZALLOC (struct sim_breakpoint);