diff options
author | David Taylor <taylor@redhat.com> | 1998-01-05 15:36:49 +0000 |
---|---|---|
committer | David Taylor <taylor@redhat.com> | 1998-01-05 15:36:49 +0000 |
commit | 4b65fd38798807a481eb9c915af10bc36db0adc6 (patch) | |
tree | b563a8876cbed08d2aa19fa20eb24daf572877c8 /gdb/top.c | |
parent | f6428b86cccb6a2aa2fc3b9d659fedc5200b1047 (diff) | |
download | gdb-4b65fd38798807a481eb9c915af10bc36db0adc6.zip gdb-4b65fd38798807a481eb9c915af10bc36db0adc6.tar.gz gdb-4b65fd38798807a481eb9c915af10bc36db0adc6.tar.bz2 |
fix gdb/13620 -- control-c to interrupt gdb command only works once.
if HAVE_SIGSETJMP is not defined, nothing is changed; if it is defined
(as it now is for sysv4 based systems), then the fix is enabled.
Diffstat (limited to 'gdb/top.c')
-rw-r--r-- | gdb/top.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -458,9 +458,9 @@ NORETURN void (*error_hook) PARAMS ((void)) ATTR_NORETURN; /* Where to go for return_to_top_level (RETURN_ERROR). */ -jmp_buf error_return; +SIGJMP_BUF error_return; /* Where to go for return_to_top_level (RETURN_QUIT). */ -jmp_buf quit_return; +SIGJMP_BUF quit_return; /* Return for reason REASON. This generally gets back to the command loop, but can be caught via catch_errors. */ @@ -490,7 +490,7 @@ return_to_top_level (reason) break; } - (NORETURN void) longjmp + (NORETURN void) SIGLONGJMP (reason == RETURN_ERROR ? error_return : quit_return, 1); } @@ -520,9 +520,9 @@ catch_errors (func, args, errstring, mask) char *errstring; return_mask mask; { - jmp_buf saved_error; - jmp_buf saved_quit; - jmp_buf tmp_jmp; + SIGJMP_BUF saved_error; + SIGJMP_BUF saved_quit; + SIGJMP_BUF tmp_jmp; int val; struct cleanup *saved_cleanup_chain; char *saved_error_pre_print; @@ -534,21 +534,21 @@ catch_errors (func, args, errstring, mask) if (mask & RETURN_MASK_ERROR) { - memcpy ((char *)saved_error, (char *)error_return, sizeof (jmp_buf)); + memcpy ((char *)saved_error, (char *)error_return, sizeof (SIGJMP_BUF)); error_pre_print = errstring; } if (mask & RETURN_MASK_QUIT) { - memcpy (saved_quit, quit_return, sizeof (jmp_buf)); + memcpy (saved_quit, quit_return, sizeof (SIGJMP_BUF)); quit_pre_print = errstring; } - if (setjmp (tmp_jmp) == 0) + if (SIGSETJMP (tmp_jmp) == 0) { if (mask & RETURN_MASK_ERROR) - memcpy (error_return, tmp_jmp, sizeof (jmp_buf)); + memcpy (error_return, tmp_jmp, sizeof (SIGJMP_BUF)); if (mask & RETURN_MASK_QUIT) - memcpy (quit_return, tmp_jmp, sizeof (jmp_buf)); + memcpy (quit_return, tmp_jmp, sizeof (SIGJMP_BUF)); val = (*func) (args); } else @@ -558,12 +558,12 @@ catch_errors (func, args, errstring, mask) if (mask & RETURN_MASK_ERROR) { - memcpy (error_return, saved_error, sizeof (jmp_buf)); + memcpy (error_return, saved_error, sizeof (SIGJMP_BUF)); error_pre_print = saved_error_pre_print; } if (mask & RETURN_MASK_QUIT) { - memcpy (quit_return, saved_quit, sizeof (jmp_buf)); + memcpy (quit_return, saved_quit, sizeof (SIGJMP_BUF)); quit_pre_print = saved_quit_pre_print; } return val; |