On Tuesday 29 April 2008 07:14:11 you wrote: > Volodya, > > > * defs.h (make_cleanup_restore_integer): New declaration. > > * utils.c (restore_integer_closure, restore_integer) > > (make_cleanup_restore_integer): New. > > * breakpoint.c (restore_always_inserted_mode): Remove. > > (update_breakpoints_after_exec): Use make_cleanup_restore_integer. > > > > * 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. > > > > * interps.h (top_level_interpreter): New. > > * interps.c (top_level_interpreter): Rename to > > top_level_interpreter_ptr. > > (top_level_interpreter): New. > > > > * mi/mi-interp.c (mi_on_normal_stop): New. > > (mi_interpreter_init): Register mi_on_normal_stop. > > (mi_interpreter_exec_continuation): Remove. > > (mi_cmd_interpreter_exec): Don't register the above. > > * mi/mi-main.c (captured_mi_execute_command): Don't care > > about sync_execution. > > (mi_execute_async_cli_command): Don't install continuation. Don't > > print *stopped. > > (mi_exec_async_cli_cmd_continuation): Remove. > > I tried to have a look at your patch, but I couldn't get into it > within the short amount of time that I have today. What I did notice > is that it contains several changes that could be made independent. > For instance, the make_cleanup_restore_integer/restore_always_inserted_mode > part could be introduced separately (honestly, this part looks a little > scary as you will leak memory is someone cancels the cleanup - so far, > I think the usual practice is to have one make_cleanup_bla_bla_bla > that specially restores your variable). > > I need to document myself about the "*stopped async output" because > I didn't quite get the idea of the patch. But if I had known that this > patch had some MI-logic to it, I'd probably have stayed away from it. > I seem to find more excitement in other parts of GDB... If no one else > gets to it, I'll see I can find some time later in the week or next week > to try again, but it would definitely help to see this patch broken down > into smaller pieces. Here are 3 independent bits. 1. Introduce the make_cleanup_restore_integer function. You're right that it can lead to bad results if one discards this cleanup, but then one should be careful with discarding cleanups anyway. 2. Modify the normal_stop observer not to fire in some cases. One case is when doing function call -- we don't announce the stop in CLI and for similar reason we don't have observer to be called. Also, for the benefit of next patch, we want the call to observer to be delayed until we print function return value, if we're doing finish. 3. The MI patch itself. Note that it does not seen an approval -- I can self-approve it. The point of the patch is to report target stop in MI immediately when a stop in some thread is detected by gdb. Currently, MI reports target stop only when it's done doing some command, which is incompatible with idea that target can stop many times per one MI command. Thanks, Volodya