forked from golang/vscode-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
src/goDebugConfiguration: massage launch config for debug/test
When the current build directory is resolved to a path different from the program's directory due to soft/symbolic links, the go command can be confused and complain that the absolute path in program is outside the module of the current directory. This CL avoids such problem by making dlv always use a relative path as the build target for build/test mode (and auto for testing). Before starting the debug session, we massage the launch config: program: /foo/bar.go -> program: ./bar.go, __buildDir: /foo program: /foo/bar -> program: ., __buildDir: /foo/bar Previously we find the package directory just before spawning dlv dap and spawn the dlv dap process from the package directory. With this CL, we find the package directory when resolving the debug configuration before debug session. This introduces __buildDir attribute which is internal. (There is an ongoing work to introduce 'buildDir' to dlv DAP so we use internal attribute to make it clear.) Also, this made the resolveDebugConfigurationWithSubstitutedVariables accept relative paths without workspace root. Just the behavior is undefined. (The motivation of change in this part is the testing. We have 'output' property or some others, that are like relative path. I guess most users wouldn't care much. Delve is cool with relative paths so we do our best to resolve that wrt the workspace root. Otherwise, just let delve decide. Updates golang#1713 Change-Id: I434c43131b27d9c58058450c502e1b30c58ea690 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/344790 Trust: Hyang-Ah Hana Kim <[email protected]> Trust: Suzy Mueller <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Suzy Mueller <[email protected]>
- Loading branch information
Showing
4 changed files
with
155 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters