> [...]> In non-stop mode (where you can stop one thread but leave the others> running), gdb wants to have the breakpoints always inserted. So,> something must emulate the displaced instruction.

This sounds like the sort of thing that kernel kprobes do, which theuprobes patch does for userspace. The gdbstub prototype can useuprobes for such "displaced" breakpoints, and single-step-out-of-lineto execute them on a few platforms like x86-*. This is alreadyprototyped / working. (gdbstub currently restricts itself tosingle-threaded programs only, but that's another todo.)