Commit Graph

31 Commits

Author SHA1 Message Date
Derek Parker
26ad5f1d82 Introduce target interface 2017-02-08 12:16:51 -08:00
Alessandro Arzilli
e77595ce31 Improve stacktraces (#721)
* service/rpccommon: fixed typo

* proc: test parseG while target is in runtime.deferreturn

runtime.deferreturn will change the value of curg._defer.fn in such a
way that if the target is stopped at just the right instruction it
may crash an incorrect implementation of parseG

* proc/stack: handle stack barriers correctly

Correctly handle stack barriers insterted during garbage collection.
2017-02-08 14:14:57 +01:00
aarzilli
8f0646e426 proc: load more registers
Adds ability to load x87, SSE and AVX registers.

Fixes #666
2016-12-19 21:29:45 +01:00
aarzilli
da910cc3bd proc: disabled TestUnsupportedArch on go1.7
See: https://github.com/golang/go/issues/16180
2016-07-03 09:02:21 +02:00
aarzilli
5714aa548c proc: cleanup: attach FDE to Stackframe structure 2016-06-24 21:22:30 +02:00
Alessandro Arzilli
9bc6ad4f46 Go 1.7 compatibility (#524)
* tests: update to cope with go1.7 SSA compiler

* de-vendored golang.org/x/debug/dwarf

We need our own tweaked version

* dwarf/debug/dwarf: always use the entry's name attribute

Using the name attribute leads to better type names as well as fixes
inconsistencies between 1.5, 1.6 and 1.7.

* proc: Updated loadInterface to work with go1.7

go1.7 changed the internal representation of types, removing the string
field from runtime._type.
Updated loadInterface to use the new str field.
2016-05-29 12:20:09 -07:00
Nan Xiao
b9b3e4ac03 proc: Update stack.go (#527)
Fix typo.
2016-05-13 11:28:56 -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
Hubert Krauze
37f124817d dlv: Misc refactors 2016-03-17 15:32:30 -07:00
aarzilli
0945170772 proc: bugfix: crash when a negative depth is used for Stacktrace 2016-02-02 12:26:29 +01:00
Derek Parker
0188dc2c8b misc: cleanup and documentation 2016-01-10 02:10:51 -08:00
aarzilli
cb529eafab terminal,proc: Improved goroutine printing
Three locations are returned for goroutines: its current location,
its current location excluding unexported runtime functions and
the location of its go instruction.
The command 'goroutines' takes a new parameter to select which
location to print (defaulting to current location w/o runtime)
2015-10-18 14:40:52 -07: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
aarzilli
c6ebd80905 Variable evaluation on arbitrary (goroutine, frame) pair. 2015-09-05 12:08:40 -05:00
Derek Parker
b9846c7684 command (next): Improvements for parallel programs
This patch aims to improve how Delve tracks the current goroutine,
especially in very highly parallel programs. The main spirit of this
patch is to ensure that even in situations where the goroutine we care
about is not executing (common for len(g) > len(m)) we still end up back
on that goroutine as a result of executing the 'next' command.

We accomplish this by tracking our original goroutine id, and any time a
breakpoint is hit or a threads stops, we examine the stopped threads and
see if any are executing the goroutine we care about. If not, we set
'next' breakpoint for them again and continue them. This is done so that
one of those threads can eventually pick up the goroutine we care about
and begin executing it again.
2015-08-20 09:32:59 -05:00
Derek Parker
f43007c55e Fix: Handle inability to find return addr
Fixes a code path where stacktrace returns < 2 locations and
thread.ReturnAddress would panic. Now returns an error.
2015-08-10 10:45:33 -05:00
Derek Parker
93dcd40cee Refactor read/write memory code 2015-08-01 21:43:03 -05:00
Derek Parker
a506bb7d8e Finish support for Go1.5beta2 2015-07-28 18:56:55 -05:00
Derek Parker
df2bf3cb63 Fix comment typos 2015-07-16 13:07:34 -05:00
Derek Parker
a99a37f397 Initial refactor of source package
Major source cleanup, still not finished. Removes gross control flow.
2015-07-09 13:06:30 -05:00
Derek Parker
6b99c5f519 Cleanup tracepoint commit
* Cleanup comments
* Cleanup naming in certain instances
* Modify stacktrace to return current location
2015-06-30 22:16:52 -05:00
aarzilli
3a96d8eed7 trace command 2015-06-29 21:16:55 +02:00
Derek Parker
102d4c89ae s/DebuggedProcess/Process/ 2015-06-20 17:54:52 -05:00
aarzilli
07473f04c5 Implement stack command
Finishes #63 #64
2015-06-20 15:29:33 -05:00
Derek Parker
bb9fbe1056 Refactor: Use arch specific address sizes 2015-06-13 14:04:09 -05:00
Derek Parker
e5233e7262 Rename: s/ThreadContext/Thread/ 2015-06-12 14:51:23 -05:00
Derek Parker
bfca6114d4 Rename package proctl -> proc 2015-06-12 14:49:23 -05:00