Added shell buffer support for JDB

This commit is contained in:
IdanArye 2014-05-17 20:23:15 +03:00
parent 9fae72d993
commit fe16f3925c

View File

@ -11,7 +11,9 @@ function! vebugger#jdb#start(entryClass,args)
call l:debugger.writeLine('stop on '.a:entryClass.'.main')
call l:debugger.writeLine('run '.a:entryClass.' '.vebugger#util#commandLineArgsForProgram(a:args))
call l:debugger.writeLine('monitor where')
call vebugger#std#openShellBuffer(l:debugger)
call l:debugger.addReadHandler(function('s:readProgramOutput'))
call l:debugger.addReadHandler(function('s:readWhere'))
call l:debugger.addReadHandler(function('s:readException'))
call l:debugger.addReadHandler(function('s:readEvaluatedExpressions'))
@ -28,6 +30,29 @@ function! vebugger#jdb#start(entryClass,args)
return l:debugger
endfunction
function! s:readProgramOutput(pipeName,line,readResult,debugger) dict
if 'out'==a:pipeName
if a:line=~'\v^\> \>'
\||a:line=='> '
\||a:line=~'\v^Step completed'
\||a:line=~'\v^Breakpoint hit'
\||a:line=~'\v^\> Deferring breakpoint'
\||a:line=='Nothing suspended.'
\||a:line=~'\v^\> run ' "Signs that the output finished
let self.programOutputMode=0
elseif a:line=~'\v(step|step up|next|cont)$' "Next line should be output
let self.programOutputMode=1
elseif a:line=~'\v^\> [^>]' "Start of output
let a:readResult.std.programOutput={'line':substitute(a:line,'\v^\> ','','')}
let self.programOutputMode=1
elseif get(self,'programOutputMode')
let a:readResult.std.programOutput={'line':a:line}
endif
else
let a:readResult.std.programOutput={'line':a:line}
endif
endfunction
function! s:findFolderFromStackTrace(src,nameFromStackTrace)
let l:path=a:src
for l:dirname in split(a:nameFromStackTrace,'\.')