Added statement execution for PDB

This commit is contained in:
IdanArye 2014-05-17 19:41:32 +03:00
parent 8a26f05585
commit b2b0550c46

View File

@ -16,6 +16,7 @@ function! vebugger#pdb#start(entryFile,args)
call l:debugger.setWriteHandler('std','breakpoints',function('s:writeBreakpoints'))
call l:debugger.setWriteHandler('std','closeDebugger',function('s:closeDebugger'))
call l:debugger.setWriteHandler('std','evaluateExpressions',function('s:requestEvaluateExpression'))
call l:debugger.setWriteHandler('std','executeStatements',function('s:executeStatements'))
call l:debugger.setWriteHandler('std','removeAfterDisplayed',function('s:removeAfterDisplayed'))
call l:debugger.generateWriteActionsFromTemplate()
@ -27,7 +28,12 @@ endfunction
function! s:readProgramOutput(pipeName,line,readResult,debugger) dict
if 'out'==a:pipeName
if a:line=~"\\V\<C-[>[C" " After executing commands this seems to get appended...
let self.programOutputMode=1
return
endif
if a:line=~'\v^\>'
\||a:line=~'\V\^(Pdb)' "We don't want to print this particular line...
\||a:line=='--Return--'
\||a:line=='The program finished and will be restarted'
let self.programOutputMode=0
@ -97,6 +103,14 @@ function! s:requestEvaluateExpression(writeAction,debugger)
endfor
endfunction
function! s:executeStatements(writeAction,debugger)
for l:evalAction in a:writeAction
if has_key(l:evalAction,'statement')
call a:debugger.writeLine('!'.l:evalAction.statement)
endif
endfor
endfunction
function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger)
if 'out'==a:pipeName
if 1==a:debugger.state.pdb.willPrintNext.stage "Reading the empty line after the command