Commit Graph

11 Commits

Author SHA1 Message Date
Derek Parker
b9846c7684 command (next): Improvements for parallel programs
This patch aims to improve how Delve tracks the current goroutine,
especially in very highly parallel programs. The main spirit of this
patch is to ensure that even in situations where the goroutine we care
about is not executing (common for len(g) > len(m)) we still end up back
on that goroutine as a result of executing the 'next' command.

We accomplish this by tracking our original goroutine id, and any time a
breakpoint is hit or a threads stops, we examine the stopped threads and
see if any are executing the goroutine we care about. If not, we set
'next' breakpoint for them again and continue them. This is done so that
one of those threads can eventually pick up the goroutine we care about
and begin executing it again.
2015-08-20 09:32:59 -05:00
Derek Parker
6bac0ae0b2 Remove superfluous comment and misc cleanup 2015-08-01 23:14:06 -05:00
Derek Parker
fd407f8579 Fix Linux compilation error 2015-08-01 23:06:34 -05:00
Derek Parker
93dcd40cee Refactor read/write memory code 2015-08-01 21:43:03 -05:00
aarzilli
d919114d32 Fix: Linux - call wait4 on thread grp leader is broken
On a thread that's leader of its group,
that is ptraced and that was survived by its children.
2015-06-26 22:10:09 -05:00
Derek Parker
9d1711d376 dbp.Running determined by any thread running 2015-06-26 09:58:26 -05:00
Derek Parker
db278d0453 Improve TestHalt reliability on Linux 2015-06-26 07:46:46 -05:00
Derek Parker
b35a743a3c Ensure thread is stopped before setting breakpoint
For hardware breakpoints we have to set them on every thread. It could
be the case that another thread is running. Stop it first, set the
breakpoint, then continue it.
2015-06-24 18:33:38 -05:00
Derek Parker
e4fc5e32c2 Refactor: Use thread-locked goroutine for ptrace ops
Previously either the terminal client or the debugger service would
either lock main goroutine to a thread or provide a locked goroutine to
run _all_ DebuggedProcess functions in. This is unnecessary because only
ptrace functions need to be run from the same thread that originated the
PT_ATTACH request.

Here we use a specific thread-locked goroutine to service any ptrace
request. That goroutine is also responsible for the initial spawning /
attaching of the process, since it must be responsible for the PT_ATTACH
request.
2015-06-13 12:57:42 -05:00
Derek Parker
e5233e7262 Rename: s/ThreadContext/Thread/ 2015-06-12 14:51:23 -05:00
Derek Parker
bfca6114d4 Rename package proctl -> proc 2015-06-12 14:49:23 -05:00