aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote-sim.c
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1997-05-08 01:00:39 +0000
committerAndrew Cagney <cagney@redhat.com>1997-05-08 01:00:39 +0000
commitc14cabbac4f755a9a62fd06b1e9974ba90db9593 (patch)
treef09e79b781bab1618d015e77339f1db63122ba65 /gdb/remote-sim.c
parenta7b2f95a4943da9cd8a522c3aaa72a09568bc13f (diff)
downloadfsf-binutils-gdb-c14cabbac4f755a9a62fd06b1e9974ba90db9593.zip
fsf-binutils-gdb-c14cabbac4f755a9a62fd06b1e9974ba90db9593.tar.gz
fsf-binutils-gdb-c14cabbac4f755a9a62fd06b1e9974ba90db9593.tar.bz2
Part II of getting GdbTk's stop button to always work.
Diffstat (limited to 'gdb/remote-sim.c')
-rw-r--r--gdb/remote-sim.c55
1 files changed, 29 insertions, 26 deletions
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index a4af8e3..8a7d1df 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -243,26 +243,6 @@ gdb_os_flush_stderr (p)
gdb_flush (gdb_stderr);
}
-/* GDB version of os_poll_quit callback.
- Taken from gdb/util.c - should be in a library */
-
-static int
-gdb_os_poll_quit (p)
- host_callback *p;
-{
- notice_quit ();
- if (quit_flag)
- {
- quit_flag = 0; /* we've stolen it */
- return 1;
- }
- else if (immediate_quit)
- {
- return 1;
- }
- return 0;
-}
-
/* GDB version of printf_filtered callback. */
/* VARARGS */
@@ -615,25 +595,47 @@ gdbsim_resume (pid, step, siggnal)
}
/* Notify the simulator of an asynchronous request to stop.
- Since some simulators can not stop, help them out.
- When stepping, need to also notify the client that it
- too should quit */
+
+ The simulator shall ensure that the stop request is eventually
+ delivered to the simulator. If the call is made while the
+ simulator is not running then the stop request is processed when
+ the simulator is next resumed.
+
+ For simulators that do not support this operation, just abort */
static void
gdbsim_stop ()
{
if (! sim_stop (gdbsim_desc))
{
- error ("gdbsim_stop: simulator failed to stop!\n");
+ quit ();
}
}
+/* GDB version of os_poll_quit callback.
+ Taken from gdb/util.c - should be in a library */
+
+static int
+gdb_os_poll_quit (p)
+ host_callback *p;
+{
+ notice_quit ();
+ if (quit_flag) /* gdb's idea of quit */
+ {
+ quit_flag = 0; /* we've stolen it */
+ return 1;
+ }
+ else if (immediate_quit)
+ {
+ return 1;
+ }
+ return 0;
+}
+
/* Wait for inferior process to do something. Return pid of child,
or -1 in case of error; store status through argument pointer STATUS,
just as `wait' would. */
-static void (*prev_sigint) ();
-
static void
gdbsim_cntrl_c (int signo)
{
@@ -645,6 +647,7 @@ gdbsim_wait (pid, status)
int pid;
struct target_waitstatus *status;
{
+ static RETSIGTYPE (*prev_sigint) ();
int sigrc = 0;
enum sim_stop reason = sim_running;