закешированный к нам в целях безопасности дебаггер
Go to file
Hyang-Ah Hana Kim c8934dc33b
dap: handle SetVariable requests (#2440)
* dap: handle SetVariable requests

The handler invokes debugger.SetVariableInScope, except for
string type variables. For which, we rely on the `call` command.
Moved the call expression handling logic to the new `doCall`
function, so it can be reused by the SetVariable requenst
handler.

With this PR, every successful SetVariable request triggers
a StoppedEvent - that's a hack to reset the variablesHandle
map internally and notify the client of this change. It will
be nice if we can just update cached data corresponding to
the updated variable.  But I cannot find an easy and safe way
to achieve this yet.

Also fixed a small bug in the call expression evaluation -
Previously, dlv dap returned an error "Unable to evaluate
expression: call stopped" if the call expression is for
variable assignment.  (e.g. "call animal = "rabbit").

* dap: address comments from aarzilli

resetHandlesForStop & sendStoppedEvent unconditionally after
call command is left as a TODO - This is an existing code path
(just refactored) and an preexisting bug. Fixing it here
requires updates in TestEvaluateCallRequest and I prefer
addressing it in a separate cl.

Disabled call injection testing on arm64. Separated TestSetVariable
into two, one that doesn't involve call injection and another that
may involve call injection.

Fixed variableByName by removing unnecessary recursion.

* dap: address polina's comments

- removed the hard reset for every variable set
- added tests for various variable types
- added tests that involves interrupted function calls. (breakpoint/panic)

And,
- changed to utilize EvalVariableInScope to access the variable instead
of searching the children by name.
- changed to utilize evaluate requests when verifying whether the variable
is changed as expected in testing. Since now we avoid resetting the variable
handles after variable reset, either we need to trigger scope changes
explicitly, or stop depending on the variables request.

* dap: address comments

- Discuss the problem around the current doCall implementation
and the implication.
- Refine the description on how VS Code handles after setVariable
and evaluate request (there could be followup scopes/evaluate requests).
- Use the explicit line numbers for breakpoints in the SetVariable tests.
- Do not use errors.Is - we could've used golang.org/x/xerrors polyfill
but that's an additional dependency, and we will remove this check once
tests that depend on old behavior are fixed.

* dap: remove errTerminated and adjust the test

* dap: evaluate in the outer frame, instead of advancing to the next bp
2021-05-20 10:05:47 -07:00
_fixtures dap: handle SetVariable requests (#2440) 2021-05-20 10:05:47 -07:00
_scripts TeamCity: fix Windows builds (#2467) 2021-05-06 10:05:17 -07:00
.teamcity TeamCity: add mac/arm64 build and use DelveBot account (#2368) 2021-03-04 18:38:56 +01:00
assets Add high-res images 2015-05-19 12:25:26 -05:00
cmd/dlv dap: add sameuser check (#2494) 2021-05-19 10:29:05 -07:00
Documentation terminal,service: add API and commands for watchpoints (#2488) 2021-05-20 10:04:02 -07:00
pkg terminal,service: add API and commands for watchpoints (#2488) 2021-05-20 10:04:02 -07:00
service dap: handle SetVariable requests (#2440) 2021-05-20 10:05:47 -07:00
vendor go.mod: update google/go-dap to 0.5.0 (#2460) 2021-05-04 12:33:50 -07:00
.cirrus.yml *: Update freebsd image 2020-04-08 11:40:24 +02:00
.deepsource.toml Continuous Integration cleanup (#2369) 2021-03-08 09:35:56 -08:00
.gitattributes makefile: use git's $Id$ instead of setting ver.Build in makefile (#807) 2017-04-28 10:14:33 -07:00
.gitignore Introduce TeamCity builds (#2298) 2021-01-18 07:48:06 -08:00
CHANGELOG.md all: v1.6.1 2021-05-19 09:24:05 +02:00
CONTRIBUTING.md README: Remove gitter chat link. 2020-01-21 09:06:53 -08:00
go.mod go.mod: update google/go-dap to 0.5.0 (#2460) 2021-05-04 12:33:50 -07:00
go.sum go.mod: update google/go-dap to 0.5.0 (#2460) 2021-05-04 12:33:50 -07:00
ISSUE_TEMPLATE.md misc: Include issue template for GitHub 2016-03-03 10:40:14 -08:00
LICENSE Add License and README 2014-05-03 15:31:52 -05:00
Makefile *: mv scripts _scripts 2020-03-28 20:28:51 +01:00
README.md Change TeamCity test matrix and drop appveyor/travis-ci configurations (#2315) 2021-01-25 20:48:27 -08: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.