Commit Graph

30 Commits

Author SHA1 Message Date
aarzilli
988d529e91 proc/variables: Support chan types
Pretty print will print them with the format:
chan <element type> <queued elements>/<queue size>
2015-11-06 17:01:38 -08:00
aarzilli
43b64ec39e proc: Implements expression interpreter
Supported operators:

- All (binary and unary) operators between basic types except <-,
++ and -- (includes & to take the address of an expression)
- Comparison operators between supported compound types
- Typecast of integer constants into pointer types
- struct members
- indexing of arrays, slices and strings
- slicing of arrays, slices and strings
- pointer dereferencing
- true, false and nil constants

Implements #116, #117 and #251
2015-11-04 12:28:48 +01:00
aarzilli
d65e832524 proc/variable: changed Value's type to constant.Value 2015-10-28 18:28:58 -07:00
aarzilli
50b5fc92e2 Changed api.Variable to have a machine readable value
The new contents of api.Variable are documented in
proc/variables.go.

Implements #243
2015-10-28 18:28:58 -07:00
Derek Parker
d4d4021a41 proc: Update help for new goroutines flags & minor cleanup 2015-10-18 15:02:14 -07: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
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
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
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
Luke Hoban
e0519dd540 proc/variables: Support for nested struct members
Fixes #220
2015-09-29 22:50:42 -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
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
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
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
aarzilli
c6ebd80905 Variable evaluation on arbitrary (goroutine, frame) pair. 2015-09-05 12:08:40 -05:00
aarzilli
8de1a307ee Fix: track recurseLevel in readArray/readSlice
This fix helps avoid infinite recursion.
2015-08-09 20:37:47 -05:00
aarzilli
fe054b2f0f EvalVariable should also evaluate package variables 2015-08-09 20:37:47 -05:00
Derek Parker
93dcd40cee Refactor read/write memory code 2015-08-01 21:43:03 -05:00
Michael Gehring
720a592348 Make info locals understand/print complex types
Fixes #192
2015-07-30 17:07:08 +02:00
aarzilli
d0f3459efb bugfix, Issue #163: offset of g struct in TLS picked based on the value of runtime.buildVersion and presence of compile units created by GNU AS, instead of being fixed to -16 2015-07-28 07:33:51 +02:00
Derek Parker
3cee10d8bc Implement 'trace' subcommand
Allows a user to execute `dlv trace [regexp]` and Delve will execute the
program and output information on functions matching [regexp].
2015-07-12 15:20:12 -05: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
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