summaryrefslogtreecommitdiffstats
path: root/sim/sh
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-04-18 12:24:52 +0000
committerAndrew Cagney <cagney@redhat.com>1997-04-18 12:24:52 +0000
commit8517f62b166073b871c896fdd642798fae4a08bd (patch)
tree805af7156e712458e58d2ebe21fc7b0b73dee681 /sim/sh
parent2d3588808f00aaa6784f004aa940b862a11be3a2 (diff)
downloadppe42-binutils-8517f62b166073b871c896fdd642798fae4a08bd.tar.gz
ppe42-binutils-8517f62b166073b871c896fdd642798fae4a08bd.zip
Ref gdb/11763 - can't stop a running simulator:
o Provide poll_quit callback to simulators so that they can poll for SIGINT on clueless OS's. o Add sim_stop to simulators so that clients can request a halt (eg gdbtk's STOP button) Works for PPC! o Re-arange remote-sim.c so that the hard work is moved from gdbsim_resume() to gdbsim_wait() (where it should be).
Diffstat (limited to 'sim/sh')
-rw-r--r--sim/sh/ChangeLog5
-rw-r--r--sim/sh/interp.c34
2 files changed, 17 insertions, 22 deletions
diff --git a/sim/sh/ChangeLog b/sim/sh/ChangeLog
index 91bcaefef3..91dfd345d1 100644
--- a/sim/sh/ChangeLog
+++ b/sim/sh/ChangeLog
@@ -1,3 +1,8 @@
+Fri Apr 18 14:14:49 1997 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * interp.c (sim_stop): New function.
+ (sim_resume): Use poll_quit for polling.
+
Thu Apr 17 03:32:04 1997 Doug Evans <dje@canuck.cygnus.com>
* Makefile.in (SIM_OBJS): Add sim-load.o.
diff --git a/sim/sh/interp.c b/sim/sh/interp.c
index f50c76b9ca..98f10e80a5 100644
--- a/sim/sh/interp.c
+++ b/sim/sh/interp.c
@@ -883,6 +883,14 @@ gotcall (from, to)
#define MMASKB ((saved_state.asregs.msize -1) & ~0)
+int
+sim_stop (sd)
+ SIM_DESC sd;
+{
+ saved_state.asregs.exception = SIGINT;
+ return 1;
+}
+
void
sim_resume (sd, step, siggnal)
SIM_DESC sd;
@@ -896,9 +904,7 @@ sim_resume (sd, step, siggnal)
register int prevlock;
register int thislock;
register unsigned int doprofile;
-#if defined(__GO32__) || defined(WIN32)
register int pollcount = 0;
-#endif
register int little_endian = little_endian_p;
int tick_start = get_now ();
@@ -959,32 +965,16 @@ sim_resume (sd, step, siggnal)
pc += 2;
-#ifdef __GO32__
pollcount++;
if (pollcount > 1000)
{
pollcount = 0;
- if (kbhit()) {
- int k = getkey();
- if (k == 1)
- saved_state.asregs.exception = SIGINT;
-
- }
- }
-#endif
- /* FIXME: Testing for INSIDE_SIMULATOR is wrong.
- Only one copy of interp.o is built. */
-#if defined (WIN32) && !defined(INSIDE_SIMULATOR)
- pollcount++;
- if (pollcount > 1000)
- {
- pollcount = 0;
- if (win32pollquit())
+ if ((*callback->poll_quit) != NULL
+ && (*callback->poll_quit) (sd))
{
- control_c();
- }
+ sim_stop (sd);
+ }
}
-#endif
#ifndef ACE_FAST
prevlock = thislock;
OpenPOWER on IntegriCloud