diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2008-03-14 18:57:44 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2008-03-14 18:57:44 +0000 |
commit | 32c1e744c108afe9bebd41766ab3025279878f85 (patch) | |
tree | b2753a1c815eb9b5c2cca33ec36afe7ebcebf560 /gdb/breakpoint.c | |
parent | c04ea773f9e9764a17382e6c1e0cf5a8d24df67a (diff) | |
download | gdb-32c1e744c108afe9bebd41766ab3025279878f85.zip gdb-32c1e744c108afe9bebd41766ab3025279878f85.tar.gz gdb-32c1e744c108afe9bebd41766ab3025279878f85.tar.bz2 |
Async mode fixes.
* Makefile.in (infcmd.o, inf-loop.o): Update dependencies.
* breakpoint.c (bpstat_do_actions): In async mode,
don't jump to top expecting stop_bpstat to be already
updated.
* event-loop.c (start_event_loop): Call async_enable_stdin
on exception.
* event-top.c (async_enable_stdin): Do nothing if sync_execution
is not set.
(command_handler): Do not setup continuation here.
(command_line_handler_continuation): Move to...
* top.c (command_line_handler_continuation): ... here.
(execute_command): In async mode, register continuation.
Don't check frame's language in running in async mode.
* exceptions.c (throw_exception): Don't do exec_error_cleanups.
* inf-loop.c (complete_execution): Inline into...
(inferior_event_handler): ... here. Clear target_executing before
doing any cleanups. Don't try to show prompt if the target was
resumed.
* infcmd.c (signal_command): Add support for async mode.
(finish_command): Only add continuation if the target was
successfully resumed.
* remote.c (init_async_opts): Register to_get_thread_local_address
handler.
* mi/mi-interp.c (mi_cmd_interpreter_exec): Don't mess
with sync_execution.
* tui/tui-interp.c (tui_command_loop): Call async_enable_stdin
on exception.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r-- | gdb/breakpoint.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 4fbda0b..6830efe 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2114,11 +2114,30 @@ top: do_cleanups (this_cmd_tree_chain); if (breakpoint_proceeded) - /* The inferior is proceeded by the command; bomb out now. - The bpstat chain has been blown away by wait_for_inferior. - But since execution has stopped again, there is a new bpstat - to look at, so start over. */ - goto top; + { + if (target_can_async_p ()) + /* If we are in async mode, then the target might + be still running, not stopped at any breakpoint, + so nothing for us to do here -- just return to + the event loop. */ + break; + else + /* In sync mode, when execute_control_command returns + we're already standing on the next breakpoint. + Breakpoint commands for that stop were not run, + since execute_command does not run breakpoint + commands -- only command_line_handler does, but + that one is not involved in execution of breakpoint + commands. So, we can now execute breakpoint commands. + There's an implicit assumption that we're called with + stop_bpstat, so our parameter is the new bpstat to + handle. + It should be noted that making execute_command do + bpstat actions is not an option -- in this case we'll + have recursive invocation of bpstat for each breakpoint + with a command, and can easily blow up GDB stack. */ + goto top; + } } do_cleanups (old_chain); } |