Since fixing scheduler handling bugs, a new bug was exposed where Step
was calling Clear off of the DebuggedProcess struct. This is incorrect,
and should be handled by the thread itself and not delegated.
Remove any assumption that a wait syscall on a thread id after a
continue will return. Any time we continue a thread, wait for activity
from any thread, because the scheduler may well have switched contexts
on us due to syscall entrace, channel op, etc...
There are several more things to be done here including:
* Potential tracking of goroutine id as we jump around to thread
contexts.
* Potential of selectively choosing threads to operate on based on the
internal M data structures, ensuring that our M has an active G.
This commit partially fixes#23 and #24, however there are still some
random hangs that happen and need to be ironed out.
Wrap syscall.Wait4 and cleanup a few coordination issues.
There are still some issues here where background threads are left
sleeping. This could potentially cause weird issues. There are a few
more things I have planned to cleanup thread coordination issues.
Areas that need improving:
* Code cleanup
* Promote breakpoints back out of thread context
* Fix potential bug in "Next" implementation, when thread contexts
switch