I have occasionally found that I have killed off gdb, and had no way to recover a debug session to QEMU. Also the detach/kill sequence does not work correctly protocol wise in the QEMU gdb-stub. This patch addresses these problems. I implemented the serial protocol commands the same way as in KGDB. ? = Query state, but also clear the breakpoints. - KGDB/gdb do the same thing so that in case you lose your session or context, gdb always send the "?" command during the connect sequence. This ensures that gdb has a clean slate for breakpoints and run control. D = Detach and clear all breakpoints with return "OK" k = Do the same thing as D for now In the future this can be used to kill the target emulation. But for now it makes gdb and other gdb serial debugger happy. signed-off-by: jason.wessel@windriver.com Thanks, Jason.