Commit Graph

863 Commits

Author SHA1 Message Date
Derek Parker
8f85b6cbae dlv: Take package name in certain commands
This patch allows certain commands (`debug`, `test`, and `trace`) to
take an argument specifying a package name. This allows a user to
specify a package other than that of the current package in the working
directory.

If a package name is not specified, the behavior remains the same, as in
Delve will look in the current working directory for a `main` package to
compile.

Fixes #423
2016-02-16 09:55:34 -08:00
Derek Parker
3360a2e997 terminal: Fix disassemble cmd name/improve help msg 2016-02-11 17:16:42 -08:00
aarzilli
e7a9a3ea9a Disassemble command
Implements #368
2016-02-11 16:59:07 -08:00
aarzilli
b370e20cd5 proc: bugs setting next breakpoints
1. A running goroutine is by definition not parked waiting for a
chan recv
2. The FDE end address is intended to be exclusive, the code
interpreted as inclusive and sometimes ended up setting a breakpoint
on a function other than the current one.
2016-02-11 08:28:07 +01:00
aarzilli
51e87386da proc: Bug loading maps
Past the maximum recursion depth maps shouldn't be loaded at all,
adding map children and not loading them breaks assumptions in
the prettyprinter.

Fixes #406
2016-02-10 08:27:48 -08:00
Alex Brainman
270ebbbb8c [proc] do not export ThreadBasicInformation 2016-02-10 15:35:34 +11:00
Alex Brainman
c61de7b0c1 [proc] use syscall package to call NtQueryInformationThread
I was hoping this will fix the issue below.
But there is more code that break new cgo rules.

Fixes #409 (partial)
2016-02-09 17:24:14 +11:00
Luke Hoban
e2c455dd89 [proc] ContinueDebugEvent after EXIT_PROCESS on Windows
Fixes #398.
2016-02-05 14:53:02 -08:00
Luke Hoban
cf3a07b584 Fix path lookup logic on Windows.
Fixes #370.
2016-02-05 14:45:27 -08:00
aarzilli
3ca1dd35ca cmd/dlv: bugfix: trace disables terminal echo
Fixes #397
2016-02-04 08:55:38 +01:00
aarzilli
0945170772 proc: bugfix: crash when a negative depth is used for Stacktrace 2016-02-02 12:26:29 +01:00
Derek Parker
94a265f098 dlv: Misc refactors
Mainly just cleans up the code in cmd/dlv/main.go
2016-02-01 09:50:37 +01:00
Derek Parker
8a1f36a1ce dlv: Flag to print stacktrace on trace subcommand 2016-02-01 09:28:25 +01:00
Derek Parker
62870df140 vendor: Vendor golang.org/x/sys/windows
Fixes #392
2016-01-31 23:42:19 +01:00
aarzilli
06bba9b7a9 proc/variables: crash while reading unintialized variable
Fixes #384
2016-01-31 20:14:17 +01:00
aarzilli
ae6a5f503c cmd/dlv/main: trace subcommand shows duplicate entries
The tracepoint should be set on the function's first line, not the
function's entry point to avoid function prologue weirdness.

Fixes #389
2016-01-31 13:35:18 +01:00
Derek Parker
975a114c0f trace: Fix panic calling trace without arg 2016-01-31 11:14:58 +01:00
aarzilli
3a8730de72 proc: Do not panic when a command is executed on an exited process
Fixes #355
2016-01-30 07:23:21 +01:00
aarzilli
fb7210934d service/rpc: clean irrelevant net/rpc error messages
Fixes #378
2016-01-29 17:27:42 +01:00
aarzilli
b94e2bd0ec terminal/command: stack command panics when stack has 1 frame
Insure that the digits function always returns at least 1.

Fixes #354 (partial)
2016-01-29 07:26:41 +01:00
aarzilli
6c7ad4059b proc: Possible panic while reading uninitialised memory
If uninitialized memory is read loadArrayValues could try to call
cacheMemory with a negative size, which could cause a 'makeslice:
len out of range' panic.

Fixes #354 (partial)
2016-01-27 13:25:49 +01:00
Luke Hoban
d756eba13a [service/debugger] Case-insensitive paths on Windows
Fixes #370.
2016-01-26 18:50:53 -08:00
Derek Parker
39bc379dd2 proc: Fix step when on breakpoint
Fixes #361
2016-01-26 16:45:26 -08:00
Derek Parker
de02a5b0a6 misc: fix typo in changelog
I need a proof-reader...
2016-01-26 11:19:58 -08:00
Derek Parker
139fb8353b misc: Fix typos in changelog 2016-01-26 11:14:47 -08:00
Derek Parker
6774a6c782 all: Bump to version 0.11.0-alpha 2016-01-26 11:11:55 -08:00
Derek Parker
1bda586115 proc: step now goes to next line, including funcs
This patch modifies the `step` command to step to the next source line,
stepping into any function encountered along the way.

Fixes #360
2016-01-24 15:48:36 -08:00
aarzilli
54f1c9b3d4 proc: replace debug/dwarf with golang.org/x/debug/dwarf
Typedefs that resolve to slices are not recorded in DWARF as typedefs
but instead as structs in a way that there is no way to know they
are really slices using debug/dwarf.
Using golang.org/x/debug/dwarf instead this problem is solved and
as a bonus some types are printed with a nicer names: (struct string
→ string, struct []int → []int, etc)

 Fixes #356 and #293
2016-01-24 15:41:41 -08:00
aarzilli
b1640238ce dwarf/frame: detecting dwarf section endianness 2016-01-24 15:41:41 -08:00
Vorn Mom
1bfae45b07 terminal/command: Fixed 'test' command on Windows
This change addresses a Windows-specifc issue with the 'test' command. On
Windows, 'go test' generate executables with a '.exe' filename extention,
but the current implementation attaches to a filename without the
extention.
2016-01-24 15:37:58 -08:00
aarzilli
91743d9472 go fmt 2016-01-24 17:30:23 +01:00
Derek Parker
afe77160b0 proc: refactor parseg
Instead of doing a bunch of manual DWARF / memory parsing we instead can
just dogfood the internal Variable API to retrieve the G struct.
2016-01-24 17:11:17 +01:00
aarzilli
d9a31dd598 proc: implement conditional breakpoints
Backend only, no UI

Implements #120 (partial)
2016-01-24 08:32:28 +01:00
aarzilli
092571591f proc: added fake runtime.curg variable 2016-01-24 08:31:16 +01:00
Luke Hoban
14f26ffda8 Reenable TestNextNetHTTP on Windows 2016-01-23 21:26:08 -08:00
Derek Parker
5477bf10c3 Add AppVeyor badge to README 2016-01-23 20:08:15 -08:00
Luke Hoban
bddb712a6b Add support for Windows.
Fixes #198.
2016-01-20 19:06:31 -08:00
Derek Parker
98ae684096 proc: Single step only "current" thread
Instead of the `step` command single stepping every thread, instead only
step the "current" thread. This fixes a few issues surrounding single
stepping, and simplifies the logic. The original concerns around only
stepping a single thread (with regard to coordination) are invalid and
generally non-issues.
2016-01-20 12:22:39 -08:00
aarzilli
af54701cb7 terminal/command: bugfix: goroutines doesn't work without arguments
Splitting an empty string results in a one element array with a
single empty string element.

See: http://play.golang.org/p/EzVX64Q82A
2016-01-19 15:24:23 +01:00
aarzilli
70cbbdc083 service/locations: hooked expression evaluator to location specifiers
Location specifiers starting with '*' can be followed by any
expression supported by the evaluator.
The expression should evaluate to either an integer (which will be
interpreted as an address) or to a function pointer (which will be
dereferenced to get the function's entry point).
2016-01-17 21:45:28 -08:00
aarzilli
453bd0217f proc: bugfix: clearing temp breakpoints
Temp breakpoints should be cleared even if a non-temp breakpoint is
triggered on the same goroutine that the temp breakpoints are set on.

Fixes #305
2016-01-16 09:13:15 +01:00
aarzilli
b839eda2a9 proc/variables: prefetch of target process memory
Prefetch the entire memory of structs and arrays and cache it instead
of issuing readMemory calls only when we get down to primitive types.
This reduces the number of system calls to ptrace that variables makes.

Improves performance in general, greatly improving it in some
particular cases (involving large structs).

Benchmarks without prefetching:
	BenchmarkArray-4         	      10	 132189944 ns/op	   0.06 MB/s
	BenchmarkArrayPointer-4  	       5	 202538503 ns/op	   0.04 MB/s
	BenchmarkMap-4           	     500	   3804336 ns/op	   0.27 MB/s
	BenchmarkGoroutinesInfo-4	      10	 126397104 ns/op
	BenchmarkLocalVariables-4	     500	   2494846 ns/op

Benchmarks with prefetching:
	BenchmarkArray-4         	     200	  10719087 ns/op	   0.76 MB/s
	BenchmarkArrayPointer-4  	     100	  11931326 ns/op	   0.73 MB/s
	BenchmarkMap-4           	    1000	   1466479 ns/op	   0.70 MB/s
	BenchmarkGoroutinesInfo-4	      10	 103407004 ns/op
	BenchmarkLocalVariables-4	    1000	   1530395 ns/op

Improvement factors:
	BenchmarkArray				12.33x
	BenchmarkArrayPointer		16.97x
	BenchmarkMap					 2.59x
	BenchmarkGoroutinesInfo		 1.22x
	BenchmarkLocalVariables		 1.63x
2016-01-10 13:49:03 +01:00
aarzilli
32a0c752eb proc: fix 2 typos 2016-01-10 12:47:54 +01:00
Derek Parker
0188dc2c8b misc: cleanup and documentation 2016-01-10 02:10:51 -08:00
aarzilli
6d50aba71d proc/variables: bugfix: infinite loading loop through maps
Fixes #341
2016-01-10 10:04:14 +01:00
Derek Parker
26c0307aef proc: fix typo 2016-01-09 13:46:18 -08:00
aarzilli
4266479531 proc: bugfix: array overrun from cgo in updateThreadList 2016-01-09 08:44:45 +01:00
aarzilli
4da4aea89c proc: wait for full process stop before evaluating anything 2016-01-09 08:44:43 +01:00
aarzilli
ab2b9ad1c6 proc: refactoring of Continue 2016-01-09 08:44:41 +01:00
aarzilli
17d8aa2bd1 proc: bugfix: wrong final count in TestBreakpointCounts (linux)
Sometimes after PtraceSingleStep the thread does not advance of a
single instruction but is, instead, blocked immediately by a SIGSTOP
Made singleStep repeat the process until a SIGTRAP is observed.

Unsure where the SIGSTOP comes from.
2016-01-09 08:44:38 +01:00