Commit Graph

1658 Commits

Author SHA1 Message Date
Wesley Merkel
e60942a39d terminal: show message if there are no vars/locals/args
When the vars, locals, or args commands return no results, nothing is

printed out to the terminal. This commit makes these commands print a

message like `(no locals)` when there is nothing to show. This feedback

is more descriptive of what is being returned than an empty string.
2016-04-06 09:26:10 -07:00
Derek Parker
ae7abe1a9d vendor: Remove localtests packages from godeps 2016-04-06 09:39:34 +02:00
Harry Moreno
a20bdf4b3b docs: Make installation directory more explicit 2016-04-04 10:39:40 -07:00
Sam Vilain
cfe0e52d04 Instruct OSX users to trust certificate, not key
I ran through these instructions and didn't notice that the
certificate I'd created appeared three times in the list I
was looking at.  Emphasize where the trust setting is
enabled.
2016-03-30 11:50:27 -07:00
aarzilli
53af850bdc proc: Never return a stack trace of zero frames
proc.(*Thread).Scope fails if we can find a FDE but PCToLine returns
nothing
2016-03-28 09:01:16 -07:00
aarzilli
0f4b7ce8c7 proc: add runtime.mcall to top of stack function 2016-03-28 09:01:16 -07:00
aarzilli
497b526194 proc: stacktrace refactoring
- made GoroutineStacktrace a method of struct G
- made stacktrace a method of StackIterator
- renamed StackIterator to stackIterator
- factored out logic to obtain a stackIterator from a goroutine that's
used by both (*G).Stacktrace and by (*G).UserCurrent
2016-03-28 09:01:16 -07:00
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