Commit Graph

847 Commits

Author SHA1 Message Date
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
Derek Parker
0cba1fe0ba proc/variables: Use sched.pc instead of gopc for G location
gopc is the instruction of the `go` command that spawned this goroutine.
What we really want (unless we can get the PC from the thread) is the
value of sched.pc which is the value of the PC at the time it was
parked.
2015-09-16 20:59:30 -07:00
Ilia Choly
2c48b60bb4 terminal/command: list command w/ frame & goroutine commands 2015-09-13 11:56:20 -05:00
Ilia Choly
e273949f37 Add basic tab completion to terminal 2015-09-12 12:46:09 -05:00
Ilia Choly
e2acf8ce4a Sort goroutines by ID 2015-09-10 14:12:42 -04:00
Ilia Choly
0efe3eef4a Sort threads by ID 2015-09-10 14:04:59 -04:00
aarzilli
017ce2ae4e Fix: absolute path confused for regexp in FindLocation 2015-09-09 10:06:56 -05:00
Derek Parker
c0a0e0bdc1 proc/proc: Fix OSX hangs in highly parallel programs
`next` would hang in highly parallel programs, causing test flickers and
unexpected behavior. This patch fixes it by examining all stopped
threads whenever Delve gets a notification, instead of just the thread
that caused the stop.
2015-09-05 18:29:33 -05:00
Derek Parker
1094c32f14 Bump version to 0.8.1-alpha 2015-09-05 17:27:06 -05:00
Derek Parker
af9e97b697 service/debugger: Use PC instead of scope in Location.Find 2015-09-05 17:23:59 -05:00
Derek Parker
3fc823b781 Bump version to 0.8.0-alpha 2015-09-05 12:31:37 -05:00
aarzilli
c6ebd80905 Variable evaluation on arbitrary (goroutine, frame) pair. 2015-09-05 12:08:40 -05:00
Paul Smith
7206267772 Visually align registers & show 16 bytes for each
This change right-aligns the register names in the output of the "regs" command,
and pads out the display of the hex value of each register to 16 bytes. This
makes scanning registers for set values a bit easier.
2015-09-02 00:00:48 -05:00
omie
d5e00a583d dwarf/line: Support for parsing multiple file tables
Support multiple file / directory tables for multiple compilation units.

- added a type DebugLines that can hold number of DebugLineInfo
- added a supporting attribute to DebugLineInfo called 'Lookup' which is to be
used to quickly lookup if file exists in FileNames slice
- added supporting methods to lookup and return corresponding DebugLineInfo
- changed the debug_line parsing behavior to read all the available tables and
push them to DebugLines

- since Process.lineInfo is now a slice, it was breaking AllPCsBetween as well
- updated that function's definition to accept a new filename parameter to be
able to extract related DebugLineInfo
- updated calls to AllPCsBetween

- fixed tests that were broken due to attribute type change in Process
- updated _fixtures/cgotest program to include stdio.h, so that it updates
.debug_line header
- added a test to check 'next' in a cgo binary
- OSX - 1.4 does not support cgo, handle that in new testcase
2015-08-29 14:51:27 -05:00