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).
This commit is contained in:
Andrew Cagney
1997-04-18 12:24:52 +00:00
parent 2d3588808f
commit 8517f62b16
20 changed files with 693 additions and 40 deletions

View File

@@ -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.

View File

@@ -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;