From c4093a6ab3c9ba5f830ca18d91d8b4db5b1d28ee Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Tue, 14 Dec 1999 01:06:04 +0000 Subject: import gdb-1999-12-13 snapshot --- gdb/top.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gdb/top.c') 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 +#include #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); -- cgit v1.1