Commit Graph

62 Commits

Author SHA1 Message Date
Derek Parker
3fba1f7113 Correctly handle hardware breakpoints across threads
* Set hardware breakpoints on all existing threads
* Set hardware breakpoints on any new thread the spawns

Fixes #111
2015-06-11 22:46:06 -05:00
Derek Parker
d59ef1371b Set CurrentThread after printing thread switch 2015-06-11 22:16:18 -05:00
Derek Parker
a1d0ced6f9 Insert raw instructions for G addr in TLS
* Remove half baked CallFn implementation.
* Cleanup whitespace
* Cleanup read/write mem functions
2015-06-11 15:28:20 -05:00
Derek Parker
c7dc57d44f Detach from process in tests
Prevents leaving around a bunch of zombie processes
2015-05-27 17:38:53 -05:00
Derek Parker
39945498a8 Improve 'next': return into deferred func 2015-05-09 12:44:38 -05:00
Derek Parker
2cfbc2937f Refactor: replace dwarf.Reader with wrapped reader 2015-05-09 11:25:26 -05:00
Derek Parker
544f20992f Refactor parseG function 2015-05-09 10:37:16 -05:00
Derek Parker
5a408e7054 Handle NULL addrs / empty OP stacks 2015-05-07 16:55:06 -05:00
Derek Parker
794d5b1e19 Revert errors.New change 2015-05-04 17:31:13 -05:00
Derek Parker
1ad66660a1 Prefer errors.New for unformatted errors 2015-05-01 16:27:29 -05:00
Derek Parker
2b5a9155e6 Use Arch struct for arch specific values 2015-04-29 12:07:27 -05:00
Derek Parker
21dca7efeb Use seperate ID counter for temp breakpoints 2015-04-29 08:17:35 -05:00
Derek Parker
efd1f391f2 Fix: Darwin single step state setting 2015-04-25 14:53:55 -05:00
Derek Parker
fa9fe1a679 Improve RequestManualStop 2015-04-25 14:25:48 -05:00
Derek Parker
da688b8184 Handle runtime.Breakpoint 2015-04-25 14:13:35 -05:00
Derek Parker
173ee20097 Fix: properly handle random signals
* Ignore signals we do not care about
* Implement custom fork/exec for Darwin to convert signals to mach
  exceptions
2015-04-25 13:02:45 -05:00
Derek Parker
047a91af5b Improve 'next' algorithm 2015-04-25 09:39:54 -05:00
Derek Parker
7073e1c7d0 Refactor next and trapWait 2015-04-23 11:39:46 -05:00
Derek Parker
91ebc8d132 Make trapWait method on DebuggedProcess 2015-04-23 10:42:28 -05:00
Derek Parker
6df90f325d Rename CurrentPC -> PC 2015-04-23 10:40:33 -05:00
Derek Parker
383e9c1c37 Cleanup reassignments 2015-04-23 10:30:27 -05:00
Derek Parker
cd603aee8c Improve docs 2015-04-23 09:17:14 -05:00
Derek Parker
b86f227ab6 Further improve documentation 2015-04-22 20:01:25 -05:00
Derek Parker
ce01e0f4bc Improve documentation around internal types 2015-04-22 11:42:58 -05:00
Derek Parker
8a7c6a41b8 Code organization 2015-04-20 16:58:49 -05:00
Derek Parker
48d0703b4f Improve 'next' impl for non-go next'ing 2015-04-20 13:03:22 -05:00
Derek Parker
58db8322ef Improve chan / goroutine coordination
* Properly find next source line for goroutines blocked in chanrecv
* Refactor breakpoint clearing
* Refactor temp breakpoint setting
2015-04-19 17:15:34 -05:00
Derek Parker
20c9e92cec Improve handling of manual stops 2015-04-13 17:17:06 -05:00
Derek Parker
e5a4a5ae9b Set CurrentBreakpoint on DebuggedProcess 2015-04-09 10:01:58 -05:00
Derek Parker
42a57ad285 Move print goroutine info into command
* DebuggedProcess method: `PrintGoroutinesInfo` -> `GoroutinesInfo`
* `goroutines` command in command/command.go now responsible for
  printing info.
2015-04-09 09:53:02 -05:00
Derek Parker
1d99e03f83 Reduce exported members of DebuggedProcess struct 2015-04-03 11:10:35 -05:00
Derek Parker
ccad114ed1 DRY code duplicated across OSes 2015-04-03 10:52:31 -05:00
Derek Parker
e4426fa51f Return breakpoint directly from trapWait 2015-04-03 10:47:27 -05:00
Derek Parker
e7a9daf248 Return thread directly from trapWait 2015-04-03 10:32:43 -05:00
Derek Parker
86e1530524 Improve next implementation
* Better tracking of current goroutine
* More efficient, eliminates superfluous step syscalls
* Handles concurrency and thread coordination better
2015-03-31 17:12:45 -05:00
Derek Parker
0d9b1ed29b Minor function refactor 2015-03-24 08:31:56 -05:00
Derek Parker
684dc92ccd Improve handling of process natural death (OS X) 2015-03-21 17:33:35 -05:00
Derek Parker
4729ae828b Allow arbitrary switching between threads 2015-03-13 14:50:01 -05:00
Derek Parker
9f70f43f5c Update thread printing, now denotes current thread
Also refactored code a bit, removed printing functions from proctl
package and inlined them into command.
2015-03-11 18:08:20 -05:00
Ivar Gaitan
8b04d877a0 Handle process natural death a bit better 2015-03-06 17:03:08 -06:00
Derek Parker
0b3cf1cd15 Add command to print active breakpoints 2015-03-06 08:53:54 -06:00
Derek Parker
2b76fee539 Inline function 2015-02-28 22:03:26 -06:00
Derek Parker
c7cc84fa83 More cleanup 2015-02-28 21:34:55 -06:00
Derek Parker
450e5c4805 Fix linux compile errors 2015-02-27 17:13:35 -06:00
Derek Parker
2d2d70641e (Mostly) working on OS X 2015-02-27 15:03:06 -06:00
Derek Parker
4d88d9ed8d Prefer binary search over tree lookup for FDEs
FDEs previously were loaded into a red/black tree and searched. This is
significantly more expensive than a binary search over a slice. Not sure
what I was thinking using a red/black tree - this binary search
implementation is significantly more efficient.
2015-02-04 19:22:39 -06:00
Derek Parker
aa8ad88965 Improve documentation 2015-02-02 16:09:56 -05:00
Derek Parker
e001bbfff2 Fix race between Delve and tracee runtime
This commit fixes a race condition between Delve and the runtime of the traced process. When a new thread is created in the traced process, Delve takes note of it and then continue both the new thread, and the thread that called clone. If Delve attempts to use data in `runtime.allm` before the new `m->procid` is set, errors occur. The errors are due to Delve assuming any m with a procid of 0 is the main thread of the process (due to how theGo runtime allocates M's, only `clone`d threads have procid properly set. This causes certain events (like `next`) to happen twice to the main thread, because 2 m's in `runtime.allm` have a `procid` of 0, and also causes various other issues that prevent proper thread coordination from Delve.

Fixes #43
2015-02-01 13:45:20 -05:00
Derek Parker
4f5bfc5ee8 Handle clearing HW breakpoints properly 2015-01-31 20:43:48 -06:00
Paul Sbarra
58de1f7c85 migrate to go.sys subrepository
As of go version 1.4 the standard library syscall package is "locked
down" and code outside of the standard library is recommended to migrate
to the go.sys subrepository.

Reference: https://golang.org/s/go1.4-syscall
2015-01-25 22:43:47 -06:00