commit
f8fc1719e2
7 changed files with 113 additions and 24 deletions
28
README.md
28
README.md
|
|
@ -86,6 +86,7 @@ on a best-efforts basis:
|
||||||
|
|
||||||
- Java (see caveats)
|
- Java (see caveats)
|
||||||
- C# (c-sharp) using dotnet core
|
- C# (c-sharp) using dotnet core
|
||||||
|
- Go (requires separate installation of [Delve][])
|
||||||
|
|
||||||
## Languages known not to work
|
## Languages known not to work
|
||||||
|
|
||||||
|
|
@ -158,6 +159,7 @@ The debug adapters themselves have certain runtime dependencies:
|
||||||
| Bourne Shell | Experimental | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? |
|
| Bourne Shell | Experimental | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? |
|
||||||
| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
||||||
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
||||||
|
| Go | Experimental | `--enable-go` | vscode-go | Go, [Delve][] |
|
||||||
|
|
||||||
For other languages, you'll need some other way to install the gadget.
|
For other languages, you'll need some other way to install the gadget.
|
||||||
|
|
||||||
|
|
@ -579,6 +581,30 @@ Requires `install_gadget.py --force-enable-c-sharp`.
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Go
|
||||||
|
|
||||||
|
Requires:
|
||||||
|
|
||||||
|
* `install_gadget.py --enable-go`
|
||||||
|
* [Delve][delve-install] installed, e.g. `go get -u github.com/go-delve/delve/cmd/dlv`
|
||||||
|
* Delve to be in your PATH, or specify the `dlvToolPath` launch option
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"configurations": {
|
||||||
|
"run": {
|
||||||
|
"adapter": "vscode-go",
|
||||||
|
"configuration": {
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${fileDirname}",
|
||||||
|
"mode": "debug",
|
||||||
|
"dlvToolPath": "$HOME/go/bin/dlv"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Also the mock debugger, but that isn't actually useful.
|
Also the mock debugger, but that isn't actually useful.
|
||||||
|
|
||||||
## Partially supported
|
## Partially supported
|
||||||
|
|
@ -610,3 +636,5 @@ Copyright © 2018 Ben Jackson
|
||||||
[gitter]: https://gitter.im/vimspector/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link
|
[gitter]: https://gitter.im/vimspector/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link
|
||||||
[java-debug-server]: https://github.com/Microsoft/java-debug
|
[java-debug-server]: https://github.com/Microsoft/java-debug
|
||||||
[website]: https://puremourning.github.io/vimspector-web/
|
[website]: https://puremourning.github.io/vimspector-web/
|
||||||
|
[delve]: https://github.com/go-delve/delve
|
||||||
|
[delve-install]: https://github.com/go-delve/delve/tree/master/Documentation/installation
|
||||||
|
|
|
||||||
|
|
@ -43,8 +43,8 @@ GADGETS = {
|
||||||
'vscode-cpptools': {
|
'vscode-cpptools': {
|
||||||
'language': 'c',
|
'language': 'c',
|
||||||
'download': {
|
'download': {
|
||||||
'url': ( 'https://github.com/Microsoft/vscode-cpptools/releases/download/'
|
'url': 'https://github.com/Microsoft/vscode-cpptools/releases/download/'
|
||||||
'${version}/${file_name}' ),
|
'${version}/${file_name}',
|
||||||
},
|
},
|
||||||
'do': lambda name, root: InstallCppTools( name, root ),
|
'do': lambda name, root: InstallCppTools( name, root ),
|
||||||
'all': {
|
'all': {
|
||||||
|
|
@ -80,8 +80,8 @@ GADGETS = {
|
||||||
'vscode-python': {
|
'vscode-python': {
|
||||||
'language': 'python',
|
'language': 'python',
|
||||||
'download': {
|
'download': {
|
||||||
'url': ( 'https://github.com/Microsoft/vscode-python/releases/download/'
|
'url': 'https://github.com/Microsoft/vscode-python/releases/download/'
|
||||||
'${version}/${file_name}' ),
|
'${version}/${file_name}',
|
||||||
},
|
},
|
||||||
'all': {
|
'all': {
|
||||||
'version': '2019.5.17059',
|
'version': '2019.5.17059',
|
||||||
|
|
@ -111,8 +111,8 @@ GADGETS = {
|
||||||
'language': 'csharp',
|
'language': 'csharp',
|
||||||
'enabled': False,
|
'enabled': False,
|
||||||
'download': {
|
'download': {
|
||||||
'url': ( 'https://github.com/Samsung/netcoredbg/releases/download/latest/'
|
'url': 'https://github.com/Samsung/netcoredbg/releases/download/latest/'
|
||||||
'${file_name}' ),
|
'${file_name}',
|
||||||
'format': 'tar',
|
'format': 'tar',
|
||||||
},
|
},
|
||||||
'all': {
|
'all': {
|
||||||
|
|
@ -175,15 +175,37 @@ GADGETS = {
|
||||||
'vscode-bash-debug': {
|
'vscode-bash-debug': {
|
||||||
'language': 'bash',
|
'language': 'bash',
|
||||||
'download': {
|
'download': {
|
||||||
'url': ( 'https://github.com/rogalmic/vscode-bash-debug/releases/'
|
'url': 'https://github.com/rogalmic/vscode-bash-debug/releases/'
|
||||||
'download/${version}/${file_name}' ),
|
'download/${version}/${file_name}',
|
||||||
},
|
},
|
||||||
'all': {
|
'all': {
|
||||||
'file_name': 'bash-debug-0.3.5.vsix',
|
'file_name': 'bash-debug-0.3.5.vsix',
|
||||||
'version': 'v0.3.5',
|
'version': 'v0.3.5',
|
||||||
'checksum': '',
|
'checksum': '',
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
'vscode-go': {
|
||||||
|
'language': 'go',
|
||||||
|
'download': {
|
||||||
|
'url': 'https://github.com/microsoft/vscode-go/releases/download/'
|
||||||
|
'${version}/${file_name}'
|
||||||
|
},
|
||||||
|
'all': {
|
||||||
|
'version': '0.11.4',
|
||||||
|
'file_name': 'Go-0.11.4.vsix',
|
||||||
|
'checksum':
|
||||||
|
'ff7d7b944da5448974cb3a0086f4a2fd48e2086742d9c013d6964283d416027e'
|
||||||
|
},
|
||||||
|
'adapters': {
|
||||||
|
'vscode-go': {
|
||||||
|
'name': 'delve',
|
||||||
|
'command': [
|
||||||
|
'node',
|
||||||
|
'${gadgetDir}/vscode-go/out/src/debugAdapter/goDebug.js'
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -187,12 +187,23 @@ class ProjectBreakpoints( object ):
|
||||||
self._breakpoints_handler = handler
|
self._breakpoints_handler = handler
|
||||||
|
|
||||||
|
|
||||||
def SendBreakpoints( self ):
|
def SendBreakpoints( self, doneHandler = None ):
|
||||||
assert self._breakpoints_handler is not None
|
assert self._breakpoints_handler is not None
|
||||||
|
|
||||||
# Clear any existing breakpoints prior to sending new ones
|
# Clear any existing breakpoints prior to sending new ones
|
||||||
self._breakpoints_handler.ClearBreakpoints()
|
self._breakpoints_handler.ClearBreakpoints()
|
||||||
|
|
||||||
|
awaiting = 0
|
||||||
|
|
||||||
|
def response_handler( source, msg ):
|
||||||
|
if msg:
|
||||||
|
self._breakpoints_handler.AddBreakpoints( source, msg )
|
||||||
|
nonlocal awaiting
|
||||||
|
awaiting = awaiting - 1
|
||||||
|
if awaiting == 0 and doneHandler:
|
||||||
|
doneHandler()
|
||||||
|
|
||||||
|
|
||||||
for file_name, line_breakpoints in self._line_breakpoints.items():
|
for file_name, line_breakpoints in self._line_breakpoints.items():
|
||||||
breakpoints = []
|
breakpoints = []
|
||||||
for bp in line_breakpoints:
|
for bp in line_breakpoints:
|
||||||
|
|
@ -211,8 +222,9 @@ class ProjectBreakpoints( object ):
|
||||||
'path': file_name,
|
'path': file_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
awaiting = awaiting + 1
|
||||||
self._connection.DoRequest(
|
self._connection.DoRequest(
|
||||||
lambda msg: self._breakpoints_handler.AddBreakpoints( source, msg ),
|
lambda msg: response_handler( source, msg ),
|
||||||
{
|
{
|
||||||
'command': 'setBreakpoints',
|
'command': 'setBreakpoints',
|
||||||
'arguments': {
|
'arguments': {
|
||||||
|
|
@ -224,8 +236,9 @@ class ProjectBreakpoints( object ):
|
||||||
)
|
)
|
||||||
|
|
||||||
if self._server_capabilities.get( 'supportsFunctionBreakpoints' ):
|
if self._server_capabilities.get( 'supportsFunctionBreakpoints' ):
|
||||||
|
awaiting = awaiting + 1
|
||||||
self._connection.DoRequest(
|
self._connection.DoRequest(
|
||||||
lambda msg: self._breakpoints_handler.AddBreakpoints( None, msg ),
|
lambda msg: response_handler( None, msg ),
|
||||||
{
|
{
|
||||||
'command': 'setFunctionBreakpoints',
|
'command': 'setFunctionBreakpoints',
|
||||||
'arguments': {
|
'arguments': {
|
||||||
|
|
@ -241,14 +254,18 @@ class ProjectBreakpoints( object ):
|
||||||
self._SetUpExceptionBreakpoints()
|
self._SetUpExceptionBreakpoints()
|
||||||
|
|
||||||
if self._exceptionBreakpoints:
|
if self._exceptionBreakpoints:
|
||||||
|
awaiting = awaiting + 1
|
||||||
self._connection.DoRequest(
|
self._connection.DoRequest(
|
||||||
None, # There is nothing on the response to this
|
lambda msg: response_handler( None, None ),
|
||||||
{
|
{
|
||||||
'command': 'setExceptionBreakpoints',
|
'command': 'setExceptionBreakpoints',
|
||||||
'arguments': self._exceptionBreakpoints
|
'arguments': self._exceptionBreakpoints
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if awaiting == 0 and doneHandler:
|
||||||
|
doneHandler()
|
||||||
|
|
||||||
|
|
||||||
def _SetUpExceptionBreakpoints( self ):
|
def _SetUpExceptionBreakpoints( self ):
|
||||||
exceptionBreakpointFilters = self._server_capabilities.get(
|
exceptionBreakpointFilters = self._server_capabilities.get(
|
||||||
|
|
|
||||||
|
|
@ -683,9 +683,7 @@ class DebugSession( object ):
|
||||||
|
|
||||||
|
|
||||||
def OnEvent_initialized( self, message ):
|
def OnEvent_initialized( self, message ):
|
||||||
self._codeView.ClearBreakpoints()
|
def onBreakpointsDone():
|
||||||
self._breakpoints.SendBreakpoints()
|
|
||||||
|
|
||||||
if self._server_capabilities.get( 'supportsConfigurationDoneRequest' ):
|
if self._server_capabilities.get( 'supportsConfigurationDoneRequest' ):
|
||||||
self._connection.DoRequest(
|
self._connection.DoRequest(
|
||||||
lambda msg: self._OnInitializeComplete(),
|
lambda msg: self._OnInitializeComplete(),
|
||||||
|
|
@ -696,6 +694,9 @@ class DebugSession( object ):
|
||||||
else:
|
else:
|
||||||
self._OnInitializeComplete()
|
self._OnInitializeComplete()
|
||||||
|
|
||||||
|
self._codeView.ClearBreakpoints()
|
||||||
|
self._breakpoints.SendBreakpoints( onBreakpointsDone )
|
||||||
|
|
||||||
def OnEvent_thread( self, message ):
|
def OnEvent_thread( self, message ):
|
||||||
self._stackTraceView.OnThreadEvent( message[ 'body' ] )
|
self._stackTraceView.OnThreadEvent( message[ 'body' ] )
|
||||||
|
|
||||||
|
|
|
||||||
1
support/test/go/hello_world/.gitignore
vendored
Normal file
1
support/test/go/hello_world/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
hello_world
|
||||||
14
support/test/go/hello_world/.vimspector.json
Normal file
14
support/test/go/hello_world/.vimspector.json
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"configurations": {
|
||||||
|
"run": {
|
||||||
|
"adapter": "vscode-go",
|
||||||
|
"configuration": {
|
||||||
|
"request": "launch",
|
||||||
|
"program": "${workspaceRoot}/hello-world.go",
|
||||||
|
"mode": "debug",
|
||||||
|
"dlvToolPath": "$HOME/go/bin/dlv",
|
||||||
|
"trace": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
6
support/test/go/hello_world/hello-world.go
Normal file
6
support/test/go/hello_world/hello-world.go
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
package main
|
||||||
|
import "fmt"
|
||||||
|
func main() {
|
||||||
|
var v = "test"
|
||||||
|
fmt.Println("hello world: " + v)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue