From dee803840d2ba679a5444ed6715be25194a8e8d7 Mon Sep 17 00:00:00 2001 From: Jim Kingdon Date: Tue, 4 Apr 1995 20:07:21 +0000 Subject: * top.c, utils.c, main.c: Replace error_pre_print with two variables: error_pre_print (for RETURN_ERROR) and quit_pre_print (for RETURN_QUIT). Fixes a bug whereby typing ^C (e.g. in "maint print sym") could output extraneous stuff. * objfiles.c: Don't declare error_pre_print; defs.h does it. --- gdb/top.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'gdb/top.c') diff --git a/gdb/top.c b/gdb/top.c index 2068471..3ba7581 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -493,15 +493,22 @@ catch_errors (func, args, errstring, mask) int val; struct cleanup *saved_cleanup_chain; char *saved_error_pre_print; + char *saved_quit_pre_print; saved_cleanup_chain = save_cleanups (); saved_error_pre_print = error_pre_print; + saved_quit_pre_print = quit_pre_print; if (mask & RETURN_MASK_ERROR) - memcpy ((char *)saved_error, (char *)error_return, sizeof (jmp_buf)); + { + memcpy ((char *)saved_error, (char *)error_return, sizeof (jmp_buf)); + error_pre_print = errstring; + } if (mask & RETURN_MASK_QUIT) - memcpy (saved_quit, quit_return, sizeof (jmp_buf)); - error_pre_print = errstring; + { + memcpy (saved_quit, quit_return, sizeof (jmp_buf)); + quit_pre_print = errstring; + } if (setjmp (tmp_jmp) == 0) { @@ -516,11 +523,16 @@ catch_errors (func, args, errstring, mask) restore_cleanups (saved_cleanup_chain); - error_pre_print = saved_error_pre_print; if (mask & RETURN_MASK_ERROR) - memcpy (error_return, saved_error, sizeof (jmp_buf)); + { + memcpy (error_return, saved_error, sizeof (jmp_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 (jmp_buf)); + quit_pre_print = saved_quit_pre_print; + } return val; } -- cgit v1.1