StepOut and Continue

This commit is contained in:
Ben Jackson 2018-05-20 16:18:40 +01:00
commit f55dc8cd8e
3 changed files with 27 additions and 2 deletions

View file

@ -103,7 +103,6 @@ function! s:_Send( msg ) abort
endfunction
function! vimspector#StopDebugSession() abort
py3 _session.Stop()
@ -136,6 +135,14 @@ function! vimspector#StepInto() abort
py3 _session.StepInto()
endfunction
function! vimspector#StepOut() abort
py3 _session.StepOut()
endfunction
function! vimspector#Continue() abort
py3 _session.Continue()
endfunction
" Boilerplate {{{
let &cpo=s:save_cpo
unlet s:save_cpo

View file

@ -78,8 +78,10 @@ class DebugSession( object ):
self._uiTab = vim.current.tabpage
self._codeWindow = vim.current.window
vim.command( 'nnoremenu WinBar.Continute :call vimspector#Continue()<CR>' )
vim.command( 'nnoremenu WinBar.Next :call vimspector#StepOver()<CR>' )
vim.command( 'nnoremenu WinBar.Step :call vimspector#StepInto()<CR>' )
vim.command( 'nnoremenu WinBar.Finish :call vimspector#StepOut()<CR>' )
vim.command( 'vspl' )
vim.command( 'enew' )
@ -142,6 +144,22 @@ class DebugSession( object ):
},
} )
def StepOut( self ):
self._DoRequest( None, {
'command': 'stepOut',
'arguments': {
'threadId': self._currentThread
},
} )
def Continue( self ):
self._DoRequest( None, {
'command': 'continue',
'arguments': {
'threadId': self._currentThread
},
} )
def _DoRequest( self, handler, msg ):
this_id = self._next_message_id

View file

@ -17,7 +17,7 @@ namespace Test
void bar( TestStruct b )
{
std::string s;
s += b.isInt ? b.something.somethingInt : b.something.somethingChar;
s += b.isInt ? "An int" : "A char";
std::cout << s << '\n';
}