aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-12-14 01:06:04 +0000
committerJason Molenda <jmolenda@apple.com>1999-12-14 01:06:04 +0000
commitc4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee (patch)
tree273969a6c8a28b0f0128edd803506abf025371b1 /gdb/top.c
parenta3a8c91d411abe91720a2ac92b8140e1bdb41282 (diff)
downloadgdb-c4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee.zip
gdb-c4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee.tar.gz
gdb-c4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee.tar.bz2
import gdb-1999-12-13 snapshot
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 95c07db..198a554 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -45,6 +45,7 @@
#include <sys/types.h>
+#include <setjmp.h>
#include "event-top.h"
#include "gdb_string.h"
@@ -464,10 +465,22 @@ NORETURN void (*error_hook)
PARAMS ((void)) ATTR_NORETURN;
+/* Generally one should use catch_errors rather than manipulating these
+ directly. The exception is main(). */
+#if defined(HAVE_SIGSETJMP)
+#define SIGJMP_BUF sigjmp_buf
+#define SIGSETJMP(buf) sigsetjmp(buf, 1)
+#define SIGLONGJMP(buf,val) siglongjmp(buf,val)
+#else
+#define SIGJMP_BUF jmp_buf
+#define SIGSETJMP(buf) setjmp(buf)
+#define SIGLONGJMP(buf,val) longjmp(buf,val)
+#endif
+
/* Where to go for return_to_top_level (RETURN_ERROR). */
- SIGJMP_BUF error_return;
+static SIGJMP_BUF error_return;
/* Where to go for return_to_top_level (RETURN_QUIT). */
- SIGJMP_BUF quit_return;
+static SIGJMP_BUF quit_return;
/* Return for reason REASON. This generally gets back to the command
loop, but can be caught via catch_errors. */
@@ -485,7 +498,7 @@ return_to_top_level (reason)
disable_current_display ();
do_cleanups (ALL_CLEANUPS);
- if (event_loop_p && target_can_async_p ())
+ if (event_loop_p && target_can_async_p () && !target_executing)
do_exec_cleanups (ALL_CLEANUPS);
if (event_loop_p && sync_execution)
do_exec_error_cleanups (ALL_CLEANUPS);