закешированный к нам в целях безопасности дебаггер
Go to file
Alessandro Arzilli 2c700230de
proc: use stack machine to evaluate expressions (#3508)
* proc: use stack machine to evaluate expressions

This commit splits expression evaluation into two parts. The first part (in
pkg/proc/evalop/evalcompile.go) "compiles" as ast.Expr into a list of
instructions (defined in pkg/proc/evalop/ops.go) for a stack machine
(defined by `proc.(*evalStack)`).
The second part is a stack machine (implemented by `proc.(*EvalScope).eval`
and `proc.(*EvalScope).evalOne`) that has two modes of operation: in the
main mode it executes inteructions from the list (by calling `evalOne`), in
the second mode it executes the call injection protocol by calling
`funcCallStep` repeatedly until it either the protocol finishes, needs more
input from the stack machine (to set call arguments) or fails.

This approach has several benefits:

- it is now possible to remove the goroutine we use to evaluate expression
  and the channel used to communicate with the Continue loop.
- every time we resume the target to execute the call injection protocol we
  need to update several local variables to match the changed state of the
  target, this is now done at the top level of the evaluation loop instead of
  being hidden inside a recurisive evaluator
- using runtime.Pin to pin addresses returned by an injected call would
  allow us to use a more natural evaluation order for function calls, which
  would solve some bugs #3310, allow users to inspect values returned by a
  call injection #1599 and allow implementing some other features #1465. Doing
  this with the recursive evaluator, while keeping backwards compatibility
  with versions of Go that do not have runtime.Pin is very hard. However after
  this change we can simply conditionally change how compileFunctionCall works
  and add some opcodes.

* review round 1

* review round 2
2023-10-17 11:21:59 -07:00
_fixtures proc: use DW_AT_trampoline to detect auto-generated code (#3528) 2023-10-16 08:57:33 -07:00
_scripts all: remove obsolete build tags "// +build" (#3513) 2023-10-03 08:50:11 -07:00
.teamcity teamcity: misc changes to CI (#3476) 2023-08-22 09:24:25 -07:00
assets Add high-res images 2015-05-19 12:25:26 -05:00
cmd/dlv all: replace deprecated io/ioutil with io and os (#3509) 2023-09-25 11:41:59 -07:00
Documentation proc: implement follow exec mode on Windows (#3507) 2023-10-13 16:51:11 +02:00
pkg proc: use stack machine to evaluate expressions (#3508) 2023-10-17 11:21:59 -07:00
service service/test: disable TestClientServer_chanGoroutines with rr backend (#3492) 2023-10-13 10:55:24 -07:00
vendor Various fixes for go 1.22 (#3455) 2023-09-19 09:34:34 -07:00
.cirrus.yml proc: fixes concerning call injection on freebsd and rr (#3000) 2022-05-05 08:39:54 -07:00
.gitattributes makefile: use git's $Id$ instead of setting ver.Build in makefile (#807) 2017-04-28 10:14:33 -07:00
.gitignore chore: don't ignore directory cmd/dlv (#3359) 2023-05-05 09:59:43 -07:00
CHANGELOG.md V1.21.1 (#3518) 2023-10-03 09:05:40 +02:00
CONTRIBUTING.md README: Remove gitter chat link. 2020-01-21 09:06:53 -08:00
go.mod Various fixes for go 1.22 (#3455) 2023-09-19 09:34:34 -07:00
go.sum Various fixes for go 1.22 (#3455) 2023-09-19 09:34:34 -07:00
ISSUE_TEMPLATE.md Documentation: document substitute-path more (#2998) 2022-05-04 11:01:56 -07:00
LICENSE Add License and README 2014-05-03 15:31:52 -05:00
Makefile *: Fix ppc64le test runs (#3460) 2023-08-11 08:51:28 -07:00
README.md TeamCity,Documentation: use new TeamCity URL (#3275) 2023-02-15 11:11:42 +01:00

Delve

license GoDoc Build Status

The GitHub issue tracker is for bugs only. Please use the developer mailing list for any feature proposals and discussions.

About Delve

Delve is a debugger for the Go programming language. The goal of the project is to provide a simple, full featured debugging tool for Go. Delve should be easy to invoke and easy to use. Chances are if you're using a debugger, things aren't going your way. With that in mind, Delve should stay out of your way as much as possible.