Commit Graph

137 Commits

Author SHA1 Message Date
polinasok
90fb0a535f
service/dap: support auto-loading of unloaded interfaces (#2362)
* service/dap: support auto-loading of unloaded interfaces

* Make DeepSource happy

* Don't set reference if data failed to auto-load

* Use frame-less expressions

* Refine interface recursion capping test case

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-03-08 09:41:47 -08:00
Luis Gabriel Gomez
4364c728f0
dap: reduce branching on onLaunchRequest mode validations (#2364) 2021-03-05 10:07:23 +01:00
polinasok
2e80b32c41
service/dap: avoid double removal of temp built binary (#2335)
* Avoid double removal of temp binary

* Add back accidentally removed empty line

* Simplify regex

* Use unique build output directories in test cases

* Recover TestLaunchDebugRequest hidden logging and refine error check

* Special case access-denied error on Windows

* Remove special case for access denied on Windows

* Increase remove delay on Win

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-02-24 08:19:07 -08:00
polinasok
129a9fe46c
service/dap: detect and report unloaded variables (#2353)
* Detect and report unloaded variables

* Make DeepSource happy

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-02-23 08:29:06 -08:00
polinasok
540e63a55e
Include optional breakpoint info in setBreakpoints responses to reliably populate the UI (#2347)
Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-02-21 08:02:42 -08:00
polinasok
98728d8fe1
service/dap: improve test coverage for evaluateName feature based on known vscode-go bugs (#2341)
* DAP test for github.com/golang/vscode-go/issues/1056

* DAP test for github.com/golang/vscode-go/issues/884

* DAP test for github.com/golang/vscode-go/issues/851

* DAP test for github.com/golang/vscode-go/issues/1053

* DAP test for github.com/golang/vscode-go/issues/1054

* Make DeepSource happy

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-02-21 08:00:05 -08:00
Alessandro Arzilli
f19d5e5c13
proc: fix embedded field search (#2320)
Both structMember and findMethod implemented a depth-first search in
embedded fields but the Go specification requires a breadth-first
search. They also allowed promotion of fields in the concrete type of
embedded interfaces even though this is not allowed by Go.
Furthermore they both lacked protection from infinite recursion
when a type embeds itself and the user requests a non-existent field.

Fixes #2316
2021-01-29 09:25:31 -08:00
Artem Khvastunov
f2ec3e49a8
Introduce TeamCity builds (#2298)
* add -json flag when running tests on TeamCity

* introduce TeamCity builds

* restore gdbserial constants for 386

Otherwise compilation fails.

* skip TestAttachRequest on Windows as it never finishes

* run tests on 1.16beta1
2021-01-18 07:48:06 -08:00
polinasok
82fcd2cb26
service/dap: Add support for evaluateName for variables (#2292)
* Add support for evaluateName for variables

* More evaluateName logic tweaks and tests

* Make DeepSource happy

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-01-14 10:53:12 -08:00
polinasok
a224f17374
service/dap: use address, not index to differentiate compound map keys (#2291)
* Use address, not index to differentiate compound map keys

* Clean up calls to expectVarRegex

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-01-08 09:17:54 -08:00
polinasok
3e0ddf2bd1
Fix race condition in TestAttachStopOnEntry (#2290)
Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2021-01-06 09:07:47 -08:00
polinasok
796278ecba
service/dap: Support local attach (#2260)
* Support local attach

* Undo loopprog change

* Remove test check for system-specific error message

* Skip attach tests on freebasd

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-12-28 09:14:15 -08:00
Alessandro Arzilli
7dcd7b4d1e
Miscellaneous fixes for problems uncovered by Github Actions tests (#2274)
Fix bug in DAP test: TestEvaluateCallRequest.
In Go 1.15 the call injection will be executed on a different goroutine
from the goroutine where it was started on to avoid confusing the
garbage collector, the test must be aware of this fact and use the
goroutine ID from the stopped response instead of assuming 1 is the
currently selected goroutine.

Disables TestAttachDetach when running in Github Actions.

Disable some coredump tests when running in Github Actions (core size
limits?).
2020-12-27 15:11:02 -08:00
polinasok
98cba03f7d
service/dap: expand goroutine info in threads response (#2233)
* service/dap: expand goroutine info in threads response

* Fix checks

* Make DeepSource happy

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-11-30 09:43:37 -08:00
polinasok
d3d2910de2
Enable supportsDelayedStackTraceLoading capability (#2238)
Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-11-30 09:43:09 -08:00
polinasok
c94db60d27
service/dap: support evaluate requests with expressions and calls (#2185)
* Support evaluate request

* Fix failing tests

* Call support

* Remove debugger.CurrentThread() that got accidentally reintroduced during merge

* Address review comments

* Function to stringify stop reason

* Add resetHandlesForStop

* Handle stop inside call

* More tests

* Address review comments

* Check all threads to determine if call completed

* Fix test

* Fix test

* Fix test

* Address review comments

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-11-12 15:24:31 -08:00
polinasok
3fd78fc498
Relax flaky check in TestScopesAndVariables on windows/go1.15 (#2215)
Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-10-30 13:53:54 +01:00
Suzy Mueller
5632cf92be
service/dap: add "panic" and "fatal error" as stopped reasons (#2186)
* service/dap: add "panic" and "fatal error" as stopped reasons

The unrecovered panic and fatal throw breakpoints are not set by the
user. We now check for these special breakpoints and send appropriate
stopped reasons to the client.

* Add getter for StopReason

* Set threadID and stop reason correctly

If there is no selected goroutine, no goroutine ID should be set in
the stopped event.

The stopped reason can be better determined using the process
StopReason.

* Update panic breakpoint on next test to work with Go 1.13 runtime

When running panic.go with Go1.13, the next line that is stepped to
after panic('boom') is the defer function in the runtime package. The
unrecovered panic breakpoint is not hit until after several steps.

The test now steps until the breakpoint is hit, or the program terminates
without hitting the unrecovered panic breakpoint, in which case it fails.

* Skip breakpoint on next test in < Go 1.14
2020-10-07 08:24:40 -07:00
polinasok
80d0c8e717
service/dap: support clearing breakpoints and setting breakpoint conditions (#2188)
* Support clearing breakpoints and setting conditions

* Return unverified breakpoints with errors

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-10-02 09:18:33 -07:00
polinasok
551c541737
service/dap: make interface variable to dap.Variable conversion more readable (#2184)
* Add underlying type when printing interface type

* Add todo to remove one level from interface printing

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-09-29 07:03:53 -07:00
polinasok
4980fff8ce
service/dap: Add support for package globals to scopes/variables requests (#2160)
* Support global variables

* Respond to review comments

* Clarify comment

* Add more details to test error messages

* Remove flaky main..inittask checks

* Rename globals flag to match vscode-go

* Normalize filepath with slash separator

* Improve handling for unknown package

* Tweak error message

* More refactoring, normalization and error details to deal with Win test failures

* Clean up optional launch args processing

* Add CurrentPackage to debugger and use instead of ListPackagesBuildInfo

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-09-15 13:14:55 -07:00
polinasok
ec9765359a
service/dap: support next, stepIn and stepOut requests (#2143)
* Issue stopped event on runtime error when continuing

* Support next, stepIn and stepOut

* Refactor stop logic

* Explicitely set AllThreadsContinued

* Make DeepSource happy

* Respond to review comments

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-08-24 10:21:51 -07:00
aarzilli
52ce7d11dc service/dap: fix TestScopesAndVariablesRequests on Windows/Go1.15 2020-08-17 10:25:01 +02:00
polinasok
58ea3234ef
service/dap: Initial support for scopes and variables requests (#2111)
* Initial support for scopes and variables requests

* Add detailed variables test

* Address review comments

* Fix typo and redudant escaped characters

* Bug fix for uninitialized interfaces; no refs needed for 0-size vars

* Minor cosmetic tweaks

* Add incomplete loading test

* Make DeepSource happy

* Remove unnecessary t.Helper() calls

* Update broken test after merge

* Add missing return

* Rework test harness to abort testvariables2 before stack overflow

* Remove accidentally duplicated disconnet

* Test for invalid interface type with regex

* Drop testvariables3, clean up and test unreadable case

* Respond to review comments

* Make expectVar test helper less fragile

* Make DeepSource happy

* Use proc.LoadConfig directly

* Adjust test to avoid var count discrepency between Go 1.15 and earlier

* Make compound keys in a map unique for correct display

* Remove locals num check that will break if more vars are added

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-08-11 08:34:27 -07:00
polinasok
717e2685db
service/dap: Add launch request support for stackTraceDepth arg (#2099)
* service/dap: Support stackTraceDepth launch argument

* Respond to review comments

* Make DeepSource happy

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-07-08 10:20:05 -07:00
polinasok
7e13791b4a
service/dap: Support stackTrace request (#2093)
* service/dap: Support stackTrace request

* Minor tweaks

* Address review comments

* Fix grammar

* Address review comments

* Address review comments

* Update comments

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-07-01 11:01:17 -07:00
polinasok
4be75bec59
service/dap: Add buildFlags error checking and tests in launch requests (#2056)
* service/dap: Add error checking and tests for buildFlags in launch requests

* Clarify with comments and better naming

* Undo redundant support.go changes

* Undo redundant support.go changes (attempt #2)

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-05-28 14:01:51 -07:00
polinasok
f92afb9c17
service/dap: Adds launch request support for program args (#2040)
* Adds launch request support for program args

* Combine types of function parameters

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-05-11 09:52:26 -07:00
polinasok
2f295f310d
service/dap: Add error handlers for unsupported and not-yet-supported requests (#1918)
* Add no-op handlers for unsupported requests

* Fix whitespace

* Add couple of missing unsupported requests

* More comments

* Separate errors for unsupported and not-yet-implemented requests.

* Fix go.mod/sum dependencies

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-05-01 12:24:44 -07:00
Derek Parker
e5d24a96bf *: Consolidate service/debugger config
Embed the debugger config object in the service config object to avoid needless duplication of fields.
2020-04-14 21:02:38 +02:00
polinasok
c97c04220d
service/dap: Change reason to "entry" when stopping on entry (#1976)
Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-04-01 12:51:31 -07:00
polinasok
5613cf151e
service/dap: Add support for threads request (#1914)
* Add support for threads request

* Address review comments

* Relax threads test condition

* Address review comments

* Clean up unnecessary newline

* Respond to review comment

Co-authored-by: Polina Sokolova <polinasok@users.noreply.github.com>
2020-03-10 12:29:06 -07:00
polinasok
f863be0a17
service/dap: Add support for debug and test modes (#1901)
* service/dap: Add support for debug and test modes

* Address code review comments

* Remove //dap comment

* OptFlags() => optfalgs()

* If mode => switch mode
2020-03-04 09:22:51 -08:00
Eli Bendersky
a83554863f
service/dap: clean shutdown sequence in server (#1889)
Using a stop channel to signal clean shutdown to the server's
goroutines. Also updates the tests to trigger disconnectChan.

This helps avoid spurious error logs when the client disconnects, when
Ctrl+C is pressed, etc.
2020-02-26 20:45:48 -08:00
Eli Bendersky
7f14f6ab11
service/dap: avoid hardcoded []byte slices in DAP tests (#1881)
* Remove hardcoded tests

* Cleanup - consistent naming, simplify some code, remove unused func

* Address review comments

* Add Seq checks back

* Address more review comments

* Remove hardcoded tests

* Cleanup - consistent naming, simplify some code, remove unused func

* Address review comments

* Add Seq checks back

* Address more review comments

* Make more consistent

* More consistency

* Simplify Except* methods with a helper

Mark t.Helper() where appropriate
2020-02-24 09:36:34 -08:00
Hyang-Ah Hana Kim
44c644ccf2
service/dap: minor cosmetic changes (#1882)
- Move package doc comments so they are recognized as package doc.
- Use t.Helper when appropriate.
2020-02-21 09:05:30 -08:00
polinasok
fbc4623c08
service/dap: Initial implementation for 'dlv dap' (#1858)
* Initial implementation for 'dlv dap'

* Fix Travis and AppVeyor failures

* Address review comments

* Address review comments

* Regenrate documentation

* Replace dap server printfs with log.Error

* Update 'dap log'

* Fix typos

* Revert logflags changes that got mixed in by accident
2020-02-15 11:52:53 -08:00