This patch fixes continuation handling in async mode, by making the handling sequence match the sync code path. Exec commands sequence should be: execute command -> wait for stop -> rest of command After that, if the stop was due to a breakpoint, we check for any breakpoint commands associated with it. Any command is allowed, so it's possible that one command be another exec command, which resumes the target: break main commands continue end execute command -> wait for stop -> rest of command -> breakpoint commands execute command -> ... breakpoint commands used to be ran in the command_line_handler_continuation. Now they're ran before the continuations, which is wrong. If the continuation has to pull a breakpoint out of the inferior, and a breakpoint command resumed the inferior, the removal will fail (on targets where writing inferior memory on a running target is not possible, like linux). Looking at top.c to copy the exact sync sequence also shows that any language change is printed before running breakpoint commands. This patch applies on top of this one: [RFA] bpstat_do_actions in one place http://sourceware.org/ml/gdb-patches/2008-04/msg00557.html This fixes commands.exp failures. There's one case where the removing a breakpoint from a running target was triggering, due to a breakpoint command. Tested on i686-pc-linux-gnu/async. Ok, after the dependencies are in? -- Pedro Alves