diff options
author | Stan Shebs <shebs@codesourcery.com> | 1999-04-26 18:34:20 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1999-04-26 18:34:20 +0000 |
commit | 7a292a7adf506b866905b06b3024c0fd411c4583 (patch) | |
tree | 5b208bb48269b8a82d5c3a5f19c87b45a62a22f4 /sim/common/sim-io.c | |
parent | 1996fae84682e8ddd146215dd2959ad1ec924c09 (diff) | |
download | gdb-7a292a7adf506b866905b06b3024c0fd411c4583.zip gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.gz gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.bz2 |
import gdb-19990422 snapshot
Diffstat (limited to 'sim/common/sim-io.c')
-rw-r--r-- | sim/common/sim-io.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c index f3d2f67..26f4445 100644 --- a/sim/common/sim-io.c +++ b/sim/common/sim-io.c @@ -33,6 +33,13 @@ #include <unistd.h> #endif +/* Define the rate at which the simulator should poll the host + for a quit. */ +#ifndef POLL_QUIT_INTERVAL +#define POLL_QUIT_INTERVAL 0x10 +#endif + +static int poll_quit_count = POLL_QUIT_INTERVAL; /* See the file include/callbacks.h for a description */ @@ -304,9 +311,12 @@ sim_io_error(SIM_DESC sd, void sim_io_poll_quit(SIM_DESC sd) { - if (STATE_CALLBACK (sd)->poll_quit != NULL) - if (STATE_CALLBACK (sd)->poll_quit (STATE_CALLBACK (sd))) - sim_stop (sd); + if (STATE_CALLBACK (sd)->poll_quit != NULL && poll_quit_count-- < 0) + { + poll_quit_count = POLL_QUIT_INTERVAL; + if (STATE_CALLBACK (sd)->poll_quit (STATE_CALLBACK (sd))) + sim_stop (sd); + } } |