delve/pkg/proc
Alessandro Arzilli c30a333f7b proc: allow function calls to appear inside an expression (#1503)
The initial implementation of the 'call' command required the
function call to be the root expression, i.e. something like:

	double(3) + 1

was not allowed, because the root expression was the binary operator
'+', not the function call.

With this change expressions like the one above and others are
allowed.

This is the first step necessary to implement nested function calls
(where the result of a function call is used as argument to another
function call).

This is implemented by replacing proc.CallFunction with
proc.EvalExpressionWithCalls. EvalExpressionWithCalls will run
proc.(*EvalScope).EvalExpression in a different goroutine. This
goroutine, the 'eval' goroutine, will communicate with the main
goroutine of the debugger by means of two channels: continueRequest
and continueCompleted.

The eval goroutine evaluates the expression recursively, when
a function call is encountered it takes care of setting up the
function call on the target program and writes a request to the
continueRequest channel, this causes the 'main' goroutine to restart
the target program by calling proc.Continue.

Whenever Continue encounters a breakpoint that belongs to the
function call injection protocol (runtime.debugCallV1 and associated
functions) it writes to continueCompleted which resumes the 'eval'
goroutine.

The 'eval' goroutine takes care of implementing the function call
injection protocol.

When the expression is fully evaluated the 'eval' goroutine will
write a special message to 'continueRequest' signaling that the
expression evaluation is terminated which will cause Continue to
return to the user.

Updates #119
2019-05-09 08:29:58 -07:00
..
core Miscellaneous logging improvements (#1525) 2019-03-27 14:58:36 -07:00
gdbserial Miscellaneous logging improvements (#1525) 2019-03-27 14:58:36 -07:00
linutil proc,proc/native,proc/gdbserial: initial plugin support (#1413) 2019-03-20 10:32:51 -07:00
native proc/native: fix target program crash caused by call injection (linux) (#1538) 2019-04-25 09:45:37 -07:00
test proc,proc/native,proc/gdbserial: initial plugin support (#1413) 2019-03-20 10:32:51 -07:00
winutil proc/gdbserial: do not return floating point regs when not requested (#1497) 2019-02-26 08:53:45 -08:00
arch.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
bininfo.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
breakpoints.go proc/*: allow stepping into functions without debug_info symbols 2018-11-20 12:57:25 -08:00
disasm_amd64.go proc/*: allow stepping into functions without debug_info symbols 2018-11-20 12:57:25 -08:00
disasm.go *: Misc refactors, and doc additions 2018-09-19 20:59:35 +02:00
doc.go Move top-level packages into pkg 2017-02-08 12:17:19 -08:00
dwarf_expr_test.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
eval.go proc: allow function calls to appear inside an expression (#1503) 2019-05-09 08:29:58 -07:00
fncall.go proc: allow function calls to appear inside an expression (#1503) 2019-05-09 08:29:58 -07:00
interface.go proc: allow function calls to appear inside an expression (#1503) 2019-05-09 08:29:58 -07:00
mem.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
moduledata.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
proc_general_test.go proc: change memCache to delay reading 2018-04-23 10:13:21 -07:00
proc_linux_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
proc_test.go proc: allow function calls to appear inside an expression (#1503) 2019-05-09 08:29:58 -07:00
proc_unix_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
proc.go proc: allow function calls to appear inside an expression (#1503) 2019-05-09 08:29:58 -07:00
registers_amd64.go proc/gdbserial: do not return floating point regs when not requested (#1497) 2019-02-26 08:53:45 -08:00
registers.go proc/gdbserial: do not return floating point regs when not requested (#1497) 2019-02-26 08:53:45 -08:00
scope_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
stack.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
threads.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
types.go proc: support debugging plugins (#1414) 2019-05-08 14:06:38 -07:00
variable_test.go *: Update import name to github.com/go-delve/delve 2019-01-04 19:43:13 +01:00
variables.go proc: allow function calls to appear inside an expression (#1503) 2019-05-09 08:29:58 -07:00