Support the lldb debugger

The advantage of this one is that it has globals and statics in the
variables and runs directly in lldb. It can also show disassembly,
though we don't yet support that.

The disadvantage is that this is yet another plugin that plays fast and
loose with the protocol, so we have to add a bunch more gets.
This commit is contained in:
Ben Jackson 2018-05-29 01:48:37 +01:00
commit 20045b2941
4 changed files with 27 additions and 4 deletions

View file

@ -28,6 +28,17 @@
"node", "node",
"/Users/ben/.vscode/extensions/rogalmic.bash-debug-0.2.0/out/bashDebug.js" "/Users/ben/.vscode/extensions/rogalmic.bash-debug-0.2.0/out/bashDebug.js"
] ]
},
"lldb": {
"name": "lldb",
"command": [
"lldb",
"-b",
"-O",
"command script import '/Users/ben/.vscode/extensions/vadimcn.vscode-lldb-0.8.7/adapter'",
"-O",
"script adapter.main.run_stdio_session()"
]
} }
}, },
"configurations": { "configurations": {
@ -97,6 +108,17 @@
"showDebugOutput": true, "showDebugOutput": true,
"trace": true "trace": true
} }
},
"lldb launch": {
"adapter": "lldb",
"configuration": {
"type": "lldb",
"request": "launch",
"name": "LLDB: Launch",
"program": "/Users/ben/Development/vim/src/vim",
"args": [],
"cwd": "/Users/ben/Development/vim"
}
} }
} }
} }

View file

@ -56,13 +56,13 @@ class CodeView( object ):
vim.command( 'sign unplace {0}'.format( self._signs[ 'vimspectorPC' ] ) ) vim.command( 'sign unplace {0}'.format( self._signs[ 'vimspectorPC' ] ) )
self._signs[ 'vimspectorPC' ] = None self._signs[ 'vimspectorPC' ] = None
if not frame or not frame[ 'source' ]: if not frame or not frame.get( 'source' ):
return False return False
vim.current.window = self._window vim.current.window = self._window
buffer_number = int( vim.eval( 'bufnr( "{0}", 1 )'.format( buffer_number = int( vim.eval( 'bufnr( "{0}", 1 )'.format(
frame[ 'source' ][ 'path' ] ) ) ) frame[ 'source' ].get( 'path', '???' ) ) ) )
try: try:
vim.command( 'bu {0}'.format( buffer_number ) ) vim.command( 'bu {0}'.format( buffer_number ) )

View file

@ -139,7 +139,8 @@ class DebugAdapterConnection( object ):
handler( message ) handler( message )
else: else:
self._logger.error( self._logger.error(
'Request failed: {0}'.format( message[ 'message' ] ) ) 'Request failed: {0}'.format(
message.get( 'message' ) or '<silence>' ) )
utils.UserMessage( 'Request failed: {0}'.format( message[ 'message' ] ), utils.UserMessage( 'Request failed: {0}'.format( message[ 'message' ] ),
persist = True ) persist = True )
elif message[ 'type' ] == 'event': elif message[ 'type' ] == 'event':

View file

@ -27,7 +27,7 @@ class OutputView( object ):
self.ShowOutput( 'stdout' ) self.ShowOutput( 'stdout' )
def OnOutput( self, event ): def OnOutput( self, event ):
category = event[ 'category' ] category = event.get( 'category' ) or 'output'
if category not in self._buffers: if category not in self._buffers:
self._CreateBuffer( category ) self._CreateBuffer( category )