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
Once the program detects that we have stepped into another function,
we simply calculate the return address and then set a breakpoint and
continue to that location, avoiding numerous syscalls.
Now that I'm using the step strategy, I put in an optimization where if
stepping into another function, simply find the return address, put a
breakpoint there, and then continue.
I decided to vendor all debug/dwarf and debug/elf files so that the
project can be go get-table. All changes that I am waiting to land in Go
1.4 are now captured in /vendor/debug/*.
Improvements:
* `next`ing through a loop works correctly (when not already within a loop)
* `next`ing out of a function works correctly
Needs work:
* `next`ing in a loop can be improved when starting within a loop
This current implementation does not cover the following:
* Setting correct breakpoint when exiting loop
* Setting correct breakpoint when returning from function
* All facilities are available for this, it just is not taken into
account in the current `next` implementation.