We plan to develop a new debugger for Gracle. We imagine that a thread will be debugged by having the debugger run in a different thread. Setting breakpoints will be done by modifying the code, just like Unix debuggers do, except that since we have a single address space, we don't have to go through ptrace.
The single address space complicates things, however, because we cannot modify the code for one thread and not modify it for others. We plan to solve this problem by keeping track of which threads have breakpoints set in them, and when a thread traps because of a modification of the code, a check is made to see whether the thread has breakpoints set at all, and whether this is one of them. If not, the thread continues its execution as usual.
This method slows down the execution of threads other than the one that is being debugged when there is a breakpoint in some code that is used by threads that are not being debugged at the moment. However, it is unlikely that such other threads would be executing the same code as the one being debugged.