Ellery D'Souza
d4097e3be9
Fixed missing header file "sys/types.h" to fix compiler error
2015-01-26 15:10:21 -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
Michael Gehring
0d08380555
Fix PtracePeekUser
2015-01-25 21:57:56 +01:00
Michael Gehring
2a66ecb10b
Some hw breakpoint fixes
...
Enable usage of dr1-dr3. Clear control bits when a breakpoint
is disabled. Use DR_LEN_1 instead of DR_LEN_8 so breakpoint work on
unaligned adresses.
Fixes #51 .
2015-01-24 11:10:42 +01:00
Derek Parker
ff789d1df6
Update error message for missing .debug_frame
2015-01-23 14:59:42 -06:00
epipho
d7e535f25b
Dont panic if .debug_frame section is not found. Log and exit
2015-01-23 14:57:31 -06:00
Ivar Gaitan
d9c3488f12
Report caller file:line in assert helper fn
2015-01-23 14:55:24 -06:00
Paul Nasrat
46e5cfd399
proctl: propagate underlying error for failing hardware breakpoint.
...
Improves error message on systems that delve is failing on.
2015-01-22 17:10:48 -05:00
epipho
1782e13f74
Genericized slice reading
2015-01-20 01:37:52 -05:00
epipho
e2236664dd
Genericized array reading
2015-01-20 00:32:08 -05:00
epipho
99b614a028
Adding support for reading function pointers and mapping them to function names
2015-01-19 23:15:40 -05:00
epipho
056df44318
Support for uint and boolean types
2015-01-19 22:18:17 -05:00
epipho
67ad85feec
readString can now read strings of any length as well as sliced strings
2015-01-19 19:30:15 -05:00
Derek Parker
76076791b9
Fix stack frame calculation bug
...
There were certain instances where the calculation of the stack frame
was incorrect, causing for garbage to be returned by a print command.
2015-01-16 15:30:22 -06:00
Derek Parker
87c3b0a7d3
Minor syntax cleanup
2015-01-14 17:43:34 -06:00
Derek Parker
ecacbc8a40
Remove bonus comment
2015-01-14 17:40:52 -06:00
Derek Parker
fa62905a7e
Remove slight duplication
2015-01-14 17:36:35 -06:00
Derek Parker
bcc4943abd
Move breakpointIDCounter to DebuggedProcess struct
2015-01-14 09:01:36 -06:00
Derek Parker
d7cb4dcaca
Remove parseProcessStatus and only report stop
...
Currently there is no need for the other items in the ProcessStatus
struct, we really only care if the process is not running, so we can
avoid sending signals to it.
2015-01-14 08:58:32 -06:00
Derek Parker
fbbe9aaa5e
Implement usage of hardware breakpoints
...
Currently only works for amd64 processors.
2015-01-12 21:56:25 -06:00
Derek Parker
c0ae1ee1c6
Remove erroneous fmt.Println calls
2015-01-10 14:33:49 -06:00
Derek Parker
bc39ddfbbc
Handle SIGINT
...
Handle SIGINT by stopping the traced program and then displaying a
prompt to the user for commands. If the traced process is not running,
this is a noop.
Closes #30
2015-01-09 16:24:33 -06:00
Derek Parker
6acb912a0c
Minor comment cleanup
2015-01-02 10:09:32 -06:00
epipho
7c61e2a1cb
EvalSymbol supports evaluating struct members on pointers. Fixed panic
...
when evaluating a nil pointer.
2015-01-02 10:02:56 -06:00
Derek Parker
eed50f3e52
Kill newline
2015-01-01 12:35:03 -06:00
epipho
709347512c
Breakpoints now have ids. Consolidated location lookup logic
2015-01-01 08:23:55 -05:00
Derek Parker
1289f38f87
kill whitespace
2014-12-31 15:54:52 -06:00
epipho
2c5527c6c9
Refactor member variable evaluation so it works in all cases
2014-12-31 16:20:26 -05:00
epipho
ed6d4049b6
Extracting common dwarf reader functionality into its own area
2014-12-31 11:46:58 -06:00
epipho
c0fd1a0295
Refactor extractValue so OP_DW_addr will work
2014-12-31 02:41:25 -05:00
epipho
07940dc59e
Added info locals and info args commands
2014-12-30 12:58:44 -05:00
Derek Parker
cc8563a2a2
Remove unnecessary type conversion
2014-12-30 09:23:22 -06:00
Derek Parker
849a201d4a
Extract function to set slice len
2014-12-29 21:05:22 -06:00
Derek Parker
4dce356497
Slight improvement for readIntSlice
2014-12-29 20:59:52 -06:00
Derek Parker
d7684de92d
Use ptrsize instead of assuming
2014-12-29 17:04:08 -06:00
Derek Parker
46be509d6a
Improve array type output
2014-12-29 16:59:41 -06:00
Derek Parker
623ec5e53d
Improve array evaluation support
...
* First of a few commits to allow for evaluating arrays of arbitrary
types
* Adds support for 32 bit integer arrays
2014-12-28 22:37:18 -06:00
Derek Parker
9e8ac82104
Minor refactoring / code cleanup
2014-12-28 20:48:58 -06:00
Derek Parker
04da3fcbc8
Don't assume pointer size
2014-12-19 23:10:32 -06:00
Derek Parker
8e40467c95
Use ByteSize for reading string size
2014-12-19 23:10:32 -06:00
Derek Parker
2d21cad8dc
Support Go1.4rc1
2014-12-10 22:31:12 -06:00
Derek Parker
e0738c417c
Remove helper file & further isolate linux code
2014-12-09 10:51:17 -06:00
Derek Parker
813340abe6
Remove erroneous stuff from helper package
2014-12-09 10:35:55 -06:00
Derek Parker
12949e3406
Remove linux build requirement on variables source file
2014-12-08 22:33:52 -06:00
Derek Parker
460bedf4f4
Use generic ReadMemory isntead of Ptrace
2014-12-08 22:31:51 -06:00
Derek Parker
e784e5d56d
Isolate linux specific memory reading in threads file
2014-12-08 17:56:02 -06:00
Derek Parker
e299dfde08
Isolate linux specific register getters / setters
2014-12-08 17:54:34 -06:00
Derek Parker
64e01bfed1
Begin thread code isolation
2014-12-08 17:40:59 -06:00
Derek Parker
d41bbbf5c3
Further isolate Linux specific code
2014-12-08 17:15:52 -06:00
Derek Parker
2ecf625c5b
Remove unused struct member
2014-12-08 12:15:08 -06:00
Derek Parker
53ae81291b
Isolate proctl_*.go linux specific code
2014-12-05 16:17:10 -06:00
Derek Parker
1b819915fd
Remove unused function
2014-12-05 12:39:54 -06:00
Derek Parker
f8bb5acc9b
Return more meaningful errors
2014-12-04 15:26:53 -06:00
Derek Parker
d14183a2a2
Fix: do not always use pid thread for clearing bp
...
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.
2014-12-04 15:04:48 -06:00
Derek Parker
a039e5a93d
Add basic support for evaluating struct members
2014-12-02 23:30:39 -06:00
Derek Parker
46760aaa1c
Rename fn for clarity
2014-12-02 16:44:51 -06:00
Derek Parker
2046bc8192
Check for err on Dwarf fn seek
2014-12-02 16:42:50 -06:00
Derek Parker
67e2455caf
Fix format string
2014-12-02 12:42:17 -06:00
Derek Parker
5ece8d3b69
Use allm info to attach to existing threads
...
This remove reliance on the procfs for figuring out what threads are
already active when we attach to a running process. The allm linked list
will be present to matter what OS we're on, whereas procfs will not be
present everywhere.
This is the first in a series of steps to support more platforms.
2014-12-02 10:15:51 -06:00
Derek Parker
74defb1028
Remove unused struct
2014-11-28 20:16:46 -06:00
Derek Parker
afa3a9cc6c
Remove timeoutWait due to improved scheduler handling
2014-11-26 20:45:29 -06:00
Derek Parker
16392ce609
Improve handling of Go runtime scheduler
2014-11-26 20:35:53 -06:00
Derek Parker
13a3112b6b
Improve Go 1.4 support / cleanup goroutine printing
2014-11-25 20:37:43 -06:00
Derek Parker
04097af74d
Avoid carrying closure around with goroutine
2014-11-25 09:22:34 -06:00
Derek Parker
36d3ecd6e1
Update documentation
2014-11-24 18:19:40 -06:00
Derek Parker
3b2b17938b
Improve support for goroutine context switching
...
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.
2014-11-24 17:57:52 -06:00
Derek Parker
c4eadc386b
Cleanup stopTheWorld arity
2014-11-23 10:44:28 -06:00
Derek Parker
8be3ffc774
Refactor: wrap syscall.Wait4
...
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.
2014-11-22 18:57:26 -06:00
Derek Parker
582833a125
minor cleanup
2014-11-21 17:10:13 -06:00
Derek Parker
32fdfd8a2d
lower timeout wait
2014-11-21 17:02:43 -06:00
Derek Parker
aa4f08e18f
check tgkill error
2014-11-21 17:01:14 -06:00
Derek Parker
fe24276b15
Use correct tgid for kill in timeoutWait
2014-11-21 15:44:08 -06:00
Derek Parker
6fd1fbabad
Cleanup trapWait, include TODO for timeoutWait fix
2014-11-20 17:15:42 -06:00
Michael Gehring
6d32a94cd7
Set stderr on launched processes
2014-11-14 13:52:21 -06:00
Derek Parker
29d0cd0bde
Cleanup ignored waitstatus
2014-11-13 19:08:20 -06:00
Michael Gehring
425117a3d6
Stop target process immediately after execve.
2014-11-13 18:52:13 -06:00
Derek Parker
03b5e30bfb
Seek reader for finding goroutine info
2014-11-13 08:36:20 -06:00
Michael Gehring
2f91684e7a
Don't panic in threads
if there is no info for pc
2014-11-12 17:28:28 -06:00
Derek Parker
dcf9f04d45
Improve variable evaluation scope
...
Properly scope variable evaluation to the function the traced process is
currently stopped in.
2014-11-10 21:26:13 -06:00
Derek Parker
505ae44828
cleanup
2014-11-10 07:04:05 -06:00
Derek Parker
cb5785324d
Acknowledge runtime.breakpoint
2014-11-09 18:25:42 -06:00
Derek Parker
7d69c16512
Add command to print all goroutines info
2014-11-09 12:56:21 -06:00
Derek Parker
d2ebf4dc83
Add some documentation
2014-11-08 07:30:22 -06:00
Derek Parker
665ff49181
Add command to print every thread status
2014-11-07 23:55:25 -06:00
Derek Parker
6b2ee09163
Improve overall thread coordination
2014-11-07 23:45:54 -06:00
Derek Parker
4483b17bd6
Synchronize threads better when breakpoint is hit
2014-11-02 12:49:21 -06:00
Derek Parker
f26839d078
Refactor: cleanup path through addThread
2014-10-27 18:10:45 -05:00
Derek Parker
256b386136
Cleanup AttachThread
2014-10-27 17:55:55 -05:00
Derek Parker
f280ba2a3b
minor syntax cleanup
2014-10-27 17:50:47 -05:00
Derek Parker
54788de89b
remove silly function
2014-10-27 17:50:19 -05:00
Derek Parker
27a042eab5
cleanup wait function
2014-10-27 17:47:43 -05:00
Derek Parker
d30a104177
cleanup extra newline
2014-10-27 07:33:19 -05:00
Derek Parker
f1ceba0909
Support 32 bit floats
2014-10-26 12:44:26 -05:00
Derek Parker
6af32b40e6
cleanup go vet errors
2014-10-25 12:44:35 -05:00
Derek Parker
0a12910bc2
Remove unused function
2014-10-25 12:44:35 -05:00
Derek Parker
053c5535ba
Small code cleanup
2014-10-25 12:26:02 -05:00
Derek Parker
7a2362310e
Update documentation
2014-10-25 11:13:02 -05:00
Derek Parker
a3700a4407
Improve support for int variable evaluation
2014-10-25 11:07:12 -05:00
Derek Parker
08aec0d59c
Move variable related code to own file
2014-10-25 10:48:14 -05:00
Derek Parker
c625f09a17
Promote breakpoints back up to process
2014-10-25 09:17:05 -05:00
Derek Parker
4c95bf7302
(Mostly) working multithreaded tracing implementation
...
Areas that need improving:
* Code cleanup
* Promote breakpoints back out of thread context
* Fix potential bug in "Next" implementation, when thread contexts
switch
2014-10-25 08:59:22 -05:00
Derek Parker
099efeeb9d
Allow evaluation of function params
2014-10-17 14:14:55 -05:00
Derek Parker
5331dad93d
Rename project
2014-10-15 09:28:22 -05:00
Derek Parker
6b80a726af
Remove DWARF .debug_line parser / util funcs
2014-10-15 08:31:01 -05:00
Derek Parker
fa0092ac74
Rename helper dir
2014-10-14 09:53:10 -05:00
Derek Parker
1760022895
Refactor Next implementation
2014-10-14 09:52:16 -05:00
Derek Parker
58c1f54578
Improve Next implementation
...
Fix bug involving detecting whether or not we have stepped into another
function when we plan on return from the function we are currently in.
2014-10-13 19:04:38 -05:00
Derek Parker
be7f34ee0c
Cleanup: Return err directly if cannot set breakpoint
2014-10-13 08:56:42 -05:00
Derek Parker
248766300d
Remove silly function
2014-10-13 08:27:25 -05:00
Derek Parker
dc8c9cc2a4
Optimize Next implementation
...
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.
2014-10-13 08:24:59 -05:00
Derek Parker
09e352bdf7
Refactor: Move Cover method to FDE
2014-10-11 00:52:05 -05:00
Derek Parker
dfacf0770d
Fix wrong location bug for Next impl
2014-10-10 21:00:07 -05:00
Derek Parker
8457f5c7df
Cleanup test
2014-10-10 13:52:13 -05:00
Derek Parker
5da86a3e31
cleanup
2014-10-09 17:15:10 -05:00
Derek Parker
6a71009954
Fix Next impl
...
Needs some refactoring and some optimization, but fixes several bugs.
2014-10-09 14:19:10 -05:00
Derek Parker
10a1447ae1
Implement support for pointers to structs
2014-10-07 16:22:26 -05:00
Derek Parker
f0e0d0b8fd
Implement support for struct evaluation
2014-10-07 14:32:22 -05:00
Derek Parker
6562b2e531
Do not os.Exit(0) in test
2014-10-07 14:03:44 -05:00
Derek Parker
c9cbaea291
Optimize Next implementation
...
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.
2014-10-07 13:57:03 -05:00
Derek Parker
2231c0e7f3
Add reminder for "Next" optimization
2014-10-07 10:33:13 -05:00
Derek Parker
6363ce106a
Add comments for PC reset code
2014-10-07 07:58:21 -05:00
Derek Parker
5c301dd9b1
Improve 'in current fn' check for Next impl
2014-10-07 07:57:11 -05:00
Derek Parker
a69c2dc994
Cleanup test
2014-10-05 10:53:13 -05:00
Derek Parker
2ce7352aa4
Simplify temp breakpoint cleanup
2014-10-04 18:13:20 -05:00
Derek Parker
f8a65c41c5
Improve next impl -- needs refactoring
2014-10-04 00:52:40 -05:00
Derek Parker
a712a86074
cleanup formatting
2014-09-30 08:49:30 -05:00
Derek Parker
fad8104160
Reorganize code a bit
2014-09-25 17:20:09 -05:00
Derek Parker
b88d73c6f6
Remove dwarf info text file
2014-09-22 18:34:52 -05:00
Derek Parker
342af24117
Remove superous binary
2014-09-22 18:34:16 -05:00
Derek Parker
ea087ba1b1
Modify fixture prog
2014-09-19 19:58:16 -05:00
Derek Parker
e83e39b158
Fix potential suite hang
2014-09-19 16:01:39 -05:00
Derek Parker
8ee9525f47
Ensure temp breakpoints are cleared after next
2014-09-18 22:28:21 -05:00
Derek Parker
f1e5a70a4b
Update for Go 1.3.1
...
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/*.
2014-09-13 12:28:46 -05:00
Derek Parker
aefbd8f35a
Use consistent fatal test messages
2014-09-06 18:56:25 -05:00
Derek Parker
42c98577d8
Use test assertion helper
2014-09-06 18:53:22 -05:00
Derek Parker
26b9878513
Remove superfluous break in Next implementation
2014-09-05 16:16:55 -05:00
Derek Parker
50951ba257
Do not export nextPotentialLocations
2014-09-05 14:52:45 -05:00
Derek Parker
6aec8333eb
Move things around because aesthetics
2014-09-05 14:38:43 -05:00
Derek Parker
f5df7ea14d
Fix: error should not use nil val
2014-09-05 14:20:12 -05:00
Derek Parker
39569a14ac
Refactor Next implementation
2014-09-05 14:19:03 -05:00
Derek Parker
232d3d7446
Prefer "new" for initialization
2014-09-01 10:39:04 -05:00
Derek Parker
9b415c7546
Remove test binaries
2014-08-27 17:56:23 -05:00
Derek Parker
a847f4fd9d
Don't rely on process.Wait()
, instead use syscall
2014-08-27 17:47:04 -05:00
Derek Parker
fe79437656
Organize types / methods a bit
2014-08-15 15:43:14 -05:00
Derek Parker
0e11797f8b
Reduce nesting
2014-08-14 18:00:48 -05:00
Derek Parker
54e15f9d06
Don't assume availability of .gosymtab / .gopclntab
2014-08-07 17:57:58 -05:00
Derek Parker
0af47b64ce
Use external red/black tree package
2014-08-07 11:03:42 -05:00
Derek Parker
d977810626
Parallelize initial parsing operations
2014-08-06 11:14:23 -05:00
Derek Parker
d676be1810
Use t.StructName
for switch param
2014-08-06 09:50:15 -05:00
Derek Parker
c22b6a8aea
Remove leftover printf
2014-08-05 19:02:44 -05:00