diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-06-10 09:32:05 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-06-10 09:32:05 +0000 |
commit | f5871ec07bfb6388317ec60513286c51ecd06733 (patch) | |
tree | fb1f870d48ce3d69743941437b5b563d65b1b653 /gdb | |
parent | 3d3191a6ad8488986858373778fb8edf7e02715d (diff) | |
download | gdb-f5871ec07bfb6388317ec60513286c51ecd06733.zip gdb-f5871ec07bfb6388317ec60513286c51ecd06733.tar.gz gdb-f5871ec07bfb6388317ec60513286c51ecd06733.tar.bz2 |
Suppress normal stop observer when it's problematic.
* inferior.h (suppress_normal_stop_observer): New.
* infcall.c (call_function_by_hand): Disable stop events when
doing function calls.
* infmcd.c (suppress_normal_stop_observer): New.
(finish_command_continuation): Call normal_stop observer
explicitly.
(finish_command): Disable stop events inside proceed.
* infrun.c (normal_stop): Don't call normal stop observer if
suppressed of if multi-step is in progress.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 13 | ||||
-rw-r--r-- | gdb/infcall.c | 7 | ||||
-rw-r--r-- | gdb/infcmd.c | 10 | ||||
-rw-r--r-- | gdb/inferior.h | 3 | ||||
-rw-r--r-- | gdb/infrun.c | 3 |
5 files changed, 34 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1d80cc6..4f4e28c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,18 @@ 2008-06-10 Vladimir Prus <vladimir@codesourcery.com> + Suppress normal stop observer when it's problematic. + * inferior.h (suppress_normal_stop_observer): New. + * infcall.c (call_function_by_hand): Disable stop events when + doing function calls. + * infmcd.c (suppress_normal_stop_observer): New. + (finish_command_continuation): Call normal_stop observer + explicitly. + (finish_command): Disable stop events inside proceed. + * infrun.c (normal_stop): Don't call normal stop observer if + suppressed of if multi-step is in progress. + +2008-06-10 Vladimir Prus <vladimir@codesourcery.com> + Remove stale code. * infrun.c (finish_command): Don't pass cleanup to continuation. diff --git a/gdb/infcall.c b/gdb/infcall.c index c065b59..ded3211 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -706,6 +706,7 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) { struct cleanup *old_cleanups = make_cleanup (null_cleanup, 0); + struct cleanup *old_cleanups2; int saved_async = 0; /* If all error()s out of proceed ended up calling normal_stop @@ -718,8 +719,12 @@ call_function_by_hand (struct value *function, int nargs, struct value **args) if (target_can_async_p ()) saved_async = target_async_mask (0); - + + old_cleanups2 = make_cleanup_restore_integer + (&suppress_normal_stop_observer); + suppress_normal_stop_observer = 1; proceed (real_pc, TARGET_SIGNAL_0, 0); + do_cleanups (old_cleanups2); if (saved_async) target_async_mask (saved_async); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 30858f1..a844b7d 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -206,6 +206,9 @@ int step_multi; in format described in environ.h. */ struct gdb_environ *inferior_environ; + +/* When set, normal_stop will not call the normal_stop observer. */ +int suppress_normal_stop_observer = 0; /* Accessor routines. */ @@ -1294,8 +1297,13 @@ finish_command_continuation (struct continuation_arg *arg, int error_p) if (TYPE_CODE (value_type) != TYPE_CODE_VOID) print_return_value (SYMBOL_TYPE (function), value_type); } + + /* We suppress normal call of normal_stop observer and do it here so that + that *stopped notification includes the return value. */ + observer_notify_normal_stop (stop_bpstat); } + suppress_normal_stop_observer = 0; delete_breakpoint (breakpoint); } @@ -1362,6 +1370,8 @@ finish_command (char *arg, int from_tty) } proceed_to_finish = 1; /* We want stop_registers, please... */ + make_cleanup_restore_integer (&suppress_normal_stop_observer); + suppress_normal_stop_observer = 1; proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); arg1 = diff --git a/gdb/inferior.h b/gdb/inferior.h index 1dd152a..7f85507 100644 --- a/gdb/inferior.h +++ b/gdb/inferior.h @@ -391,6 +391,9 @@ extern int debug_displaced; void displaced_step_dump_bytes (struct ui_file *file, const gdb_byte *buf, size_t len); + +/* When set, normal_stop will not call the normal_stop observer. */ +extern int suppress_normal_stop_observer; /* Possible values for gdbarch_call_dummy_location. */ #define ON_STACK 1 diff --git a/gdb/infrun.c b/gdb/infrun.c index 2960acb..1e10ecc 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -3772,7 +3772,8 @@ Further execution is probably impossible.\n")); done: annotate_stopped (); - observer_notify_normal_stop (stop_bpstat); + if (!suppress_normal_stop_observer && !step_multi) + observer_notify_normal_stop (stop_bpstat); /* Delete the breakpoint we stopped at, if it wants to be deleted. Delete any breakpoint that is to be deleted at the next stop. */ breakpoint_auto_delete (stop_bpstat); |