Commit Graph

760 Commits

Author SHA1 Message Date
Derek Parker
c8a588c691 travis: Update travis.yml 2015-10-09 17:59:45 -07:00
Derek Parker
10910929b8 all: Use -exec flag to codesign test binary on OSX
Replaces a lot of ugly Makefile nonsense with a script that codesigns
the test binary before it runs. Only applicable to OSX test runs.
2015-10-09 17:56:09 -07:00
Derek Parker
2e71cf2465 proc: refactor: move Process.comm to Process.os.comm
Only used under Linux, no need to have it available on Process itself.
2015-10-09 17:33:16 -07:00
Derek Parker
d8dd9c8d0e proc: Properly close channels upon process exit
Prevents a lot of goroutines hanging around, especially when running
tests.
2015-10-09 17:33:16 -07:00
Florin Patan
197c165699 proc/breakpoint Add breakpoint statistics
This adds support for breakpoints statistics

Fixes #247
2015-10-09 16:01:06 -07:00
Derek Parker
f35d4b92be main: Update vendored cobra for bugfix
Additionally removes test code / html / txt / etc from vendor dir.
2015-10-09 07:46:14 -07:00
Quentin Perez
065984f42c Fix 2 x panic: runtime error: index out of range 2015-10-09 10:45:37 +02:00
Derek Parker
56d57ee97a proc: Format & refactor 2015-10-06 18:24:50 -07:00
Luke Hoban
a8512ba11a proc: Move nil check into toField 2015-10-06 18:24:46 -07:00
Luke Hoban
e18aa9da01 proc/variables: Don't print during testcase 2015-10-06 18:17:49 -07:00
Luke Hoban
e6477c01b1 proc/variables: Support for embedded structs
Embedded structs are encoded in DWARF as fields with
package-qualified names.  They define an anonymous field
on the struct with the non-qualified name, as well as
promoted fields for each field of the embedded struct so
long as these are not shadowed by fields of the containing
struct.

Fixes #220.
2015-10-06 18:17:49 -07:00
Konstantin Shaposhnikov
cc9ab6d687 proc: avoid dup chan recv breakpoints
I encountered the error message described in the issue while debugging
InfluxDB. I can confirm that after this fix the error disapeared.

Fixes #258
2015-10-06 18:02:29 -07:00
Derek Parker
c731a83424 proc: Refactor ptrace calls on Darwin 2015-10-06 10:45:36 -07:00
aarzilli
769dd59b4d terminal: correct CSI sequence in (*Term).Println
<esc>[0m (reset) should be used instead of <esc>[37m (set foreground
color to white)
2015-10-05 14:01:01 +02:00
Derek Parker
6ae8633b08 proc: Comment fixes / misc formatting 2015-10-04 12:08:17 -07:00
Derek Parker
f2ae6a27cd proc: fix: Call wg.Done in loadProcessInformation on OSX 2015-10-04 12:08:17 -07:00
aarzilli
e509c3ce36 proc: bugfix: status does not work with programs containing spaces
/proc/pid/stat needs more complex parsing

Fixes #239
2015-10-04 12:01:09 -07:00
Derek Parker
db95b67b23 all: Bump to version 0.10.0-alpha 2015-10-04 11:17:46 -07:00
Derek Parker
40eec12308 terminal/command: Update clearall help text 2015-10-04 10:59:53 -07:00
Derek Parker
c6b5609f77 all: Run go fmt across all files 2015-10-04 10:58:32 -07:00
Konstantin Shaposhnikov
8c01bcc34d terminal/command: add optional linespec argument to clearall
If an optional linespec argument is passed to clearall command then only
breakpoints matching this linespec will be cleared.

Behavior of clearall command without arguments hasn't changed.
2015-10-04 10:49:25 -07:00
aarzilli
eb2bc2a7ee terminal: Implements init file and source command
The 'source' command reads the file specified as argument and executes
it as a list of delve commands.
Additionally a flag '--init' can be passed to delve specifying a file
containing a list of commands to execute on startup.

Issue #96
2015-10-04 10:32:38 -07:00
aarzilli
bc9ac0ec78 terminal/command: check for SelectedGoroutine == nil in goroutines
Fixes #257
2015-10-03 14:29:46 +02:00
aarzilli
d30221dac7 proc/variables: chanRecvReturnAddress uses outdated frame info
g.SP refers to the frame the goroutine was in the last time it was
scheduled out. Instead of calling proc.(*Process).stacktrace directly
we should call proc.(*Process).GoroutineStacktrace that substitutes
fresh values retrieved from thread registers when necessary.
This bug leads to occasional problems with `next`.
2015-10-02 13:09:41 +02:00
Derek Parker
f2e5214e1b all: Makefile refactor 2015-09-30 18:32:08 -07:00
Derek Parker
4e6d69e744 all: Vendor with Godeps & GO15EXPERIMENT
Use godeps to vendor dependencies and the normal go toolchain, with
GO15VENDOREXPERIMENT=1 set to properly vendor dependencies for reproducible
builds.
2015-09-30 18:25:02 -07:00
Derek Parker
71e83d6f59 travis: Remove go 1.4.2 2015-09-30 18:25:02 -07:00
Derek Parker
f8b4b45a03 terminal/command: Refactor formatting of line numbers 2015-09-30 08:39:14 -07:00
Luke Hoban
e0519dd540 proc/variables: Support for nested struct members
Fixes #220
2015-09-29 22:50:42 -07:00
Derek Parker
80107dba8d terminal: Refactor handling of dumb terminals 2015-09-29 22:42:06 -07:00
Florin Patan
76b9aa03bb terminal/command: Support for dumb terminal
Support for dumb terminal

Fixes #252
2015-09-29 21:55:41 -07:00
Derek Parker
af16cfa90b variables: Misc cleanup / renaming 2015-09-28 22:59:39 -07:00
aarzilli
c9b517067b Implements set command for pointers and numerical values
set <variable name> <value>
2015-09-28 22:45:06 -07:00
Derek Parker
8f2ccbad0a variables: Misc cleanup / renaming 2015-09-28 22:25:40 -07:00
aarzilli
8d920931e1 proc/variables: Split address calculations from value extraction
Refactored variables.go to separate calculation of a variable's address from
reading its value. This change is useful to implement the 'set' command
as well as the evaluation of more complex expressions (in the future).
2015-09-28 11:17:27 +02:00
aarzilli
bba999b985 proc: bugfix: intermittent failures of TestRestart_afterExit
During process termination we seem to receive notifications of new
threads that die before we can add them, ignore them
2015-09-27 07:56:47 +02:00
aarzilli
d81482c820 terminal: bugfix: Do not detach from/kill already exited process 2015-09-27 07:56:47 +02:00
aarzilli
93ad209f24 proc: bugfix: Detach(true) does not kill tracee
Instead of using PTRACE_DETACH to inject SIGINT into the tracee use
sys.Kill directly: PTRACE_DETACH is allowed to ignore its signal
argument if the tracee isn't in signal-delivery-stop status.
2015-09-27 07:56:35 +02:00
Derek Parker
466960d95a proc: Remove hardware assisted breakpoints
Only use software breakpoints for now. The reasoning is because it
complicates the code without justification, and is only supported on
Linux. Eventually, once watchpoints are properly implemented we will
revive some of this code. Also, if it is ever necessary to actually set
a hw breakpoint we can revive that code as well.

All future versions of this code will include support for OSX before
being merged back in.
2015-09-26 13:58:54 -07:00
Derek Parker
c91ca831b7 build: Always pass ldflags to builds on OSX
Previously, 'ldflags' were added to the compiler invocation based on the
version of Go the user was running. It seems to make more sense to
simply always pass along the flags on Darwin (due to the bug mentioned
in the comment above this line in the diff) as that is less brittle than
branching on the Go version, and yet will not break current users /
developers work flow.
2015-09-25 17:19:09 -07:00
aarzilli
5ba0435382 Refactor: use FindGoroutine
Use proc.(*Process).FindGoroutine in proc.(*Process).SwitchGoroutine and
debugger.(*Debugger).Stacktrace. That method did not exist when those
were originally written.
2015-09-20 09:03:52 -07:00
aarzilli
a6391c1f76 proc/variables: Large strings & uninitialized memory fixes
Be more tolerant of unitialized memory, limit length of strings like we
do for array/slices.

Workaround for Issue #189
2015-09-20 08:59:06 -07:00
Derek Parker
7f3ae73471 Version: Bump to 0.9.0-alpha 2015-09-20 00:13:23 -05:00
Derek Parker
e02625ab89 terminal/command: Refactor to use stdlib function
Replace function with a stdlib implementation.
2015-09-19 23:58:18 -05:00
Derek Parker
2407005444 terminal/command: Stack no long takes goroutine id
Default numeric argument now simply represents the depth. If you would
like to see the stack trace of another goroutine, use `goroutine <id> bt`.
2015-09-19 23:43:43 -05:00
Derek Parker
784505813d proc/stack: Add punctuation to comment 2015-09-19 23:19:03 -05:00
aarzilli
da39258bec stack command: -full flag prints local variables and arguments of all the functions on the stack trace 2015-09-18 08:34:21 +02:00
Ilia Choly
6527f15e4d proc: Exclude dead goroutines from results.
Some of the goroutines stored in runtime.allg are in the dead state and
should not be displayed. The state is determined by the 'g.atomicstatus'
member.
2015-09-17 12:17:26 -07:00
Ilia Choly
c185b7d004 proc/proc: Cache 'GoroutineInfo' result during halt
The GoroutineInfo method can be slow if there are many goroutines. This
patch caches the results during a halt so they are not needlessly
recomputed.

Fixes #234
2015-09-17 12:10:35 -07:00
Derek Parker
b733b66236 docs: Update contributing doc
Updated doc with standard commit message format.
2015-09-17 07:10:56 -07:00