Commit Graph

847 Commits

Author SHA1 Message Date
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
aarzilli
5354e462e8 proc: bugfix: race condition between termination and Continue (linux)
resume loops in continueOnce moved to a OS specific resume function,
this makes the problem easier to deal with and seems to be more
appropriate to a windows port given what transpired from discussion
of Pull Request #276
2016-01-09 08:44:37 +01:00
aarzilli
2f9f20188a proc: bugfix: proc.Launch race (OS X) 2016-01-09 08:44:35 +01:00
aarzilli
5441135668 proc: Next implemented as conditional breakpoints + Continue
Next sets its temporary breakpoints with the condition that they
must only activate on the current goroutine, and then calls Continue
When Continue encounters a temporary breakpoint it clears all
the breakpoint.

User visible changes: breakpoints that get hit while executing Next
are not ignored.

This commit does not implement full conditional breakpoints
functionality, the only condition that can be set is on the
goroutine id.

Fixes race conditions in Next affecting TestNextConcurrent.
2016-01-09 08:44:32 +01:00
aarzilli
78c79927d6 proc: bugfix: [OS X] desync of mach message queue in Continue 2016-01-09 08:44:30 +01:00
aarzilli
b21686e6c4 proc: Continue does not work with breakpoints set on NOP (OSX)
Fixes #262
2016-01-09 08:44:28 +01:00
aarzilli
708cf2f290 service,terminal: propagating simultaneous breakpoints 2016-01-09 08:44:25 +01:00
aarzilli
a9e2696f46 proc: bugfix: proc.(*Process).Continue skips breakpoints
Breakpoints are skipped either because:
1. when multiple breakpoints are hit simultaneously only one is
processed
2. a thread hits a breakpoint while another thread is being
singlestepped over the breakpoint.

Additionally fixed a race condition between Continue and tracee
termination.
2016-01-09 08:28:36 +01:00
aarzilli
2c58d0c242 bugfix: proc/types: loadPackageMap and github.com packages
Makes loadPackageMap actually work with github.com/... packages
2016-01-08 09:58:25 -08:00
aarzilli
7e0d3fc244 workaround: proc/eval: go sometimes inserts &v instead of v 2016-01-04 16:20:23 +01:00
Derek Parker
d4bfd25a28 cmd/trace: Shorten file paths in output
Export the function to shorten file paths from the terminal package so
that it can be used in the `trace` subcommand.
2015-12-28 08:46:12 +01:00
Derek Parker
6d68d1aefa cmd/trace: Fix nil pointer panic in trace subcommand 2015-12-27 18:36:54 -08:00
aarzilli
1aa83e30e0 proc/variables: bugfix: nil pointer with interfaces to functions
Fixes #325
2015-12-26 14:49:46 -08:00
aarzilli
8872b53e80 proc/variables: bugfix: makes TestEvalExpression more robust
Fixes #320
2015-12-26 14:47:43 -08:00
aarzilli
17b39b789d Revert "proc: Fix parsing of 'BuildVersion' on Go tip"
This reverts commit ad5097a8dc716e61992d5c7dd6213e58cb0a88b5.
runtime/internal/sys.BuildVersion was not used in any official
release.
2015-12-23 10:53:49 +01:00
aarzilli
c859a880b6 Makes TestEvalExpression work on go1.6beta1
Go1.6 changed the behaviour of go/constants.
2015-12-23 10:53:49 +01:00
aarzilli
1a4250fb51 proc/variables: bugfix: hang on ptr loop including interfaces
recurseLevel value should not be reset when evaluating the contents
of an interface variable

Fixes #316
2015-12-19 14:57:48 +01:00