Commit Graph

1101 Commits

Author SHA1 Message Date
aarzilli
43756cd864 proc: bugfix: Truncate stacktrace when FDE of a frame can not be found
Instead of returning an error when FDE of a frame can not be found,
just truncate the stack trace.

Fixes #462
2016-03-28 09:01:16 -07:00
aarzilli
59beb7b442 debugger: Allow disassembly even if the scope can not be converted
It is sometimes impossible to convert an EvalScope immediately after
starting the program but disassembly can still proceed.
2016-03-28 08:44:18 -07:00
Steve Mynott
b1011b7378 terminal: create "h" alias for "help" command 2016-03-23 18:21:57 -07:00
aarzilli
d735d1824c proc: removed dead code from proc.(*Variable).parseG 2016-03-23 13:45:57 +01:00
Derek Parker
487215fd09 docs: Update OSX install docs
Fixes #403
2016-03-18 09:08:26 -07:00
Derek Parker
522e7aa266 misc: minor message format cleanup 2016-03-17 15:35:10 -07:00
Hubert Krauze
37f124817d dlv: Misc refactors 2016-03-17 15:32:30 -07:00
Alex Brainman
ff0ec8ce00 terminal: do not use escape codes on windows unless they are supported 2016-03-15 09:43:22 +01:00
Derek Parker
e88ea83e1d proc: TODO trace stop status on kernel versions 2016-03-14 09:43:55 -07:00
Derek Parker
82e3939cf9 proc: whitespace/import cleanup 2016-03-14 09:40:24 -07:00
Joe Grasse
59ef8a7a71 proc: Add process state T
On linux kernel 2.6.x, the Trace/Stop status is 'T'

Fixes #209
2016-03-14 09:39:39 -07:00
vancouverwill
7d3d90a04d Updated OSX install.md
It was unclear that to install, first clone Delve before `CERT=mycert make install`
Added link to helpful walkthrough installation video
2016-03-14 08:55:48 +01:00
aarzilli
c4797ea445 proc: Breakpoint to catch unrecovered panics
Automatically sets a breakpoint on runtime.startpanic, the function
that gets called by runtime.dopanic when a panic is not recovered.

Implements #317
2016-03-09 14:15:30 +01:00
aarzilli
c66c6408a5 proc: Caching type offsets
Caches the mapping of type names to offset in debug_info to speed up
variable evaluation.

BEFORE:
	BenchmarkArray-4         	     100	  13'238'441 ns/op	   0.62 MB/s
	BenchmarkArrayPointer-4  	     200	  10'044'093 ns/op	   0.87 MB/s
	BenchmarkMap-4           	    1000	   1'332'530 ns/op	   0.77 MB/s
	BenchmarkGoroutinesInfo-4	      10	 114'677'462 ns/op
	BenchmarkLocalVariables-4	    2000	   1'223'975 ns/op
AFTER:
	BenchmarkArray-4         	     200	   9'925'686 ns/op	   0.83 MB/s
	BenchmarkArrayPointer-4  	     100	  11'143'930 ns/op	   0.78 MB/s
	BenchmarkMap-4           	    2000	   1'302'520 ns/op	   0.79 MB/s
	BenchmarkGoroutinesInfo-4	      30	  35'079'549 ns/op
	BenchmarkLocalVariables-4	    1000	   1'137'299 ns/op

Note in particular the speedup of BenchmarkGoroutinesInfo, since
proc.(*Variable).parseG is a function we call a lot.
2016-03-05 13:04:11 +01:00
Derek Parker
758f76ffee misc: Include issue template for GitHub 2016-03-03 10:40:14 -08:00
John Aylward
5fe0d79e01 Fixes quote of certificate 2016-02-28 20:33:09 -05:00
aarzilli
49a0a121e0 tests: Add test for #149, fixed TestNextGeneral on tip
The go compiler changed and break statements no longer get compiled to
nothing when -N is passed:

https://go-review.googlesource.com/#/c/19848/
https://go-review.googlesource.com/#/c/19854/
2016-02-28 16:44:22 -08:00
Derek Parker
216616c34e terminal: misc cleanup 2016-02-28 16:42:48 -08:00
aarzilli
ecc95cd2ac debugger: bugfix: BreakpointInfo variables evaluated on wrong thread
BreakpointInfo variables were always evaluated on CurrentThread
instead of the thread that triggered the breakpoint.
2016-02-28 13:38:05 +01:00
aarzilli
5ba9bcd740 terminal: Mechanism to handle command prefixes
Implements extensible mechanism to specify which commands accept
prefixes (goroutine, frame, on) instead of hardcoding them in
a switch.

Implements #240
2016-02-28 13:38:05 +01:00
Derek Parker
b3c1ca5384 service/test: Improve TypesCommand filter assetion 2016-02-27 15:50:37 -08:00
aarzilli
c8f4cee97d New command 'types'
Lists all the types defined in the debugged program.
2016-02-27 15:39:11 -08:00
aarzilli
14a92352bc proc: Add filter for non-variable global symbols to PackageVariables 2016-02-27 15:26:24 -08:00
aarzilli
58913527db proc: Crash when stepping past the end of the program
Fixes #414
2016-02-27 15:15:51 -08:00
Derek Parker
16f30d0738 terminal: Refactor Term/FakeTerm 2016-02-27 15:02:55 -08:00
aarzilli
9e588fef72 terminal: Next does not fill BreakpointInfo
Fixes #411
2016-02-25 08:46:12 +01:00
Derek Parker
1efc4940cd service/debugger: Fix typo 2016-02-24 17:50:11 -08:00
aarzilli
82ef3cce78 debugger: bugfix: make delve API thread safe
proc.(*Process) methods are not thread safe, multiple clients
connecting simultaneously to a delve server (Issue #383) or a even
a single over-eager client (Issue #408) can easily crash it.
Additionally (Issue #419) calls to client.(*RPCClient).Halt can
crash the server because they can result in calling the function
debug/dwarf.(*Data).Type simultaneously in multiple threads which
will cause it to return incompletely parsed dwarf.Type values.

Fixes #408, #419 (partial)
2016-02-24 17:49:30 -08:00
aarzilli
037926015a proc: bugfix: propagate signals we don't handle to inferior
Fixes #419 (partial)
2016-02-24 17:49:30 -08:00
Derek Parker
63a660820e docs: Move wiki docs into Documentation dir
Going forward, all documentation should be placed in the Documentation
directory in the root of the project. This switch allows maintainers to
approve updates to documentation before they are committed, as opposed
to the pre-existing wiki which anybody could modify.

Currently the Documentation directory includes docs on building, usage,
and minimal docs around the API. This is just the initial commit, and
documentation will continue to improve over time.

Some changes have been made (and will continue to be made) to `cmd/dlv` to
ensure we can auto-generate documentation for all commands from the
newly provided script `scripts/gen-usage-docs.go`, which can be invoked
via `go run scripts/gen-usage-docs.go`.

Additionally, version has been split into its own package. This was a
bit of housekeeping related to the changes made the `cmd/dlv`.
2016-02-19 10:47:46 -08:00
Derek Parker
460f0c910c vendor: Update cobra and vendor cobra/doc 2016-02-19 10:32:05 -08:00
Alex Brainman
8d4d0871cf proc: replace cgo with syscalls on windows
Unrelated to conversion, I have also changed (*Thread).readMemory
to return only first count bytes of memory just as advised
by ReadProcessMemory.

Fixes #409
Fixes #412
Fixes #416
2016-02-19 15:55:20 +11:00
aarzilli
6242c4388e _fixtures: Removed testvariables2 and testvariables4
Moved the code in testvariables2 and testvariables4 into
testvariables3, renamed testvariables3 into testvariables2
2016-02-18 12:16:31 -08:00
Derek Parker
9fcd44421f travis: Test against Go 1.6 2016-02-18 19:19:43 +01:00
aarzilli
852f0c95b3 proc: Step should skip function prologue
Step disassembles the current instruction, if it is a CALL sets a
temp breakpoint inside the called function, after the prologue and
calls Continue.

Fixes #332
2016-02-18 09:15:37 -08:00
aarzilli
4116d66c8d proc: Replaced FunctionEntryToFirstLine with disassembly alternative
- Unlike FunctionEntryToFirstLine can skip the prologue on functions
that are defined on a single line, either because they weren't
formatted or because they were autogenerated
- Can skip the prologue on most functions when setting a breakpoint
with the filename:line syntax

Fixes #396
2016-02-18 09:11:34 -08:00
aarzilli
c277b27157 cmd/dlv: add flag to make headless server accept multiple clients 2016-02-17 20:09:50 +01:00
aarzilli
3be65a4c1f service, terminal: Named breakpoints and breakpoint conditions
Implements #109 and #120
2016-02-16 15:59:37 -08:00
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