Fix #5 - Vim7.3 compatibility
This commit is contained in:
parent
c10e27f7c7
commit
b8dd945557
@ -32,16 +32,16 @@ function! vebugger#gdb#start(binaryFile,args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
call l:debugger.addReadHandler(function('s:readProgramOutput'))
|
call l:debugger.addReadHandler(function('vebugger#gdb#_readProgramOutput'))
|
||||||
call l:debugger.addReadHandler(function('s:readWhere'))
|
call l:debugger.addReadHandler(function('vebugger#gdb#_readWhere'))
|
||||||
call l:debugger.addReadHandler(function('s:readFinish'))
|
call l:debugger.addReadHandler(function('vebugger#gdb#_readFinish'))
|
||||||
call l:debugger.addReadHandler(function('s:readEvaluatedExpressions'))
|
call l:debugger.addReadHandler(function('vebugger#gdb#_readEvaluatedExpressions'))
|
||||||
|
|
||||||
call l:debugger.setWriteHandler('std','flow',function('s:writeFlow'))
|
call l:debugger.setWriteHandler('std','flow',function('vebugger#gdb#_writeFlow'))
|
||||||
call l:debugger.setWriteHandler('std','breakpoints',function('s:writeBreakpoints'))
|
call l:debugger.setWriteHandler('std','breakpoints',function('vebugger#gdb#_writeBreakpoints'))
|
||||||
call l:debugger.setWriteHandler('std','closeDebugger',function('s:closeDebugger'))
|
call l:debugger.setWriteHandler('std','closeDebugger',function('vebugger#gdb#_closeDebugger'))
|
||||||
call l:debugger.setWriteHandler('std','evaluateExpressions',function('s:requestEvaluateExpression'))
|
call l:debugger.setWriteHandler('std','evaluateExpressions',function('vebugger#gdb#_requestEvaluateExpression'))
|
||||||
call l:debugger.setWriteHandler('std','executeStatements',function('s:executeStatements'))
|
call l:debugger.setWriteHandler('std','executeStatements',function('vebugger#gdb#_executeStatements'))
|
||||||
|
|
||||||
call l:debugger.generateWriteActionsFromTemplate()
|
call l:debugger.generateWriteActionsFromTemplate()
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ function! s:findFolderFromStackTrace(src,nameFromStackTrace)
|
|||||||
return l:path
|
return l:path
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readProgramOutput(pipeName,line,readResult,debugger)
|
function! vebugger#gdb#_readProgramOutput(pipeName,line,readResult,debugger)
|
||||||
if 'err'==a:pipeName
|
if 'err'==a:pipeName
|
||||||
\&&a:line!~'\v^[=~*&^]'
|
\&&a:line!~'\v^[=~*&^]'
|
||||||
\&&a:line!~'\V(gdb)'
|
\&&a:line!~'\V(gdb)'
|
||||||
@ -70,7 +70,7 @@ function! s:readProgramOutput(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readWhere(pipeName,line,readResult,debugger)
|
function! vebugger#gdb#_readWhere(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
"let l:matches=matchlist(a:line,'\v^\~"#(\d+)\s+(.+)\s+\(.*\)\s+at\s+([^:]+):(\d+)')
|
"let l:matches=matchlist(a:line,'\v^\~"#(\d+)\s+(.+)\s+\(.*\)\s+at\s+([^:]+):(\d+)')
|
||||||
let l:matches=matchlist(a:line,'\v^\*stopped.*fullname\=\"([^"]+)\",line\=\"(\d+)"')
|
let l:matches=matchlist(a:line,'\v^\*stopped.*fullname\=\"([^"]+)\",line\=\"(\d+)"')
|
||||||
@ -84,13 +84,13 @@ function! s:readWhere(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readFinish(pipeName,line,readResult,debugger)
|
function! vebugger#gdb#_readFinish(pipeName,line,readResult,debugger)
|
||||||
if a:line=~'\c\V\^~"[Inferior \.\*exited normally]'
|
if a:line=~'\c\V\^~"[Inferior \.\*exited normally]'
|
||||||
let a:readResult.std.programFinish={'finish':1}
|
let a:readResult.std.programFinish={'finish':1}
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeFlow(writeAction,debugger)
|
function! vebugger#gdb#_writeFlow(writeAction,debugger)
|
||||||
if 'stepin'==a:writeAction
|
if 'stepin'==a:writeAction
|
||||||
call a:debugger.writeLine('step')
|
call a:debugger.writeLine('step')
|
||||||
elseif 'stepover'==a:writeAction
|
elseif 'stepover'==a:writeAction
|
||||||
@ -102,11 +102,11 @@ function! s:writeFlow(writeAction,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:closeDebugger(writeAction,debugger)
|
function! vebugger#gdb#_closeDebugger(writeAction,debugger)
|
||||||
call a:debugger.writeLine('quit')
|
call a:debugger.writeLine('quit')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeBreakpoints(writeAction,debugger)
|
function! vebugger#gdb#_writeBreakpoints(writeAction,debugger)
|
||||||
for l:breakpoint in a:writeAction
|
for l:breakpoint in a:writeAction
|
||||||
if 'add'==(l:breakpoint.action)
|
if 'add'==(l:breakpoint.action)
|
||||||
call a:debugger.writeLine('break '.fnameescape(l:breakpoint.file).':'.l:breakpoint.line)
|
call a:debugger.writeLine('break '.fnameescape(l:breakpoint.file).':'.l:breakpoint.line)
|
||||||
@ -116,13 +116,13 @@ function! s:writeBreakpoints(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:requestEvaluateExpression(writeAction,debugger)
|
function! vebugger#gdb#_requestEvaluateExpression(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
call a:debugger.writeLine('print '.l:evalAction.expression)
|
call a:debugger.writeLine('print '.l:evalAction.expression)
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:executeStatements(writeAction,debugger)
|
function! vebugger#gdb#_executeStatements(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
if has_key(l:evalAction,'statement')
|
if has_key(l:evalAction,'statement')
|
||||||
"Use eval to run the statement - but first we need to remove the ;
|
"Use eval to run the statement - but first we need to remove the ;
|
||||||
@ -131,7 +131,7 @@ function! s:executeStatements(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger) dict
|
function! vebugger#gdb#_readEvaluatedExpressions(pipeName,line,readResult,debugger) dict
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
if has_key(self,'nextExpressionToBePrinted')
|
if has_key(self,'nextExpressionToBePrinted')
|
||||||
let l:matches=matchlist(a:line,'\v^\~"\$(\d+) \= (.*)"$')
|
let l:matches=matchlist(a:line,'\v^\~"\$(\d+) \= (.*)"$')
|
||||||
|
@ -16,15 +16,15 @@ function! vebugger#jdb#start(entryClass,args)
|
|||||||
call vebugger#std#openShellBuffer(l:debugger)
|
call vebugger#std#openShellBuffer(l:debugger)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call l:debugger.addReadHandler(function('s:readProgramOutput'))
|
call l:debugger.addReadHandler(function('vebugger#jdb#_readProgramOutput'))
|
||||||
call l:debugger.addReadHandler(function('s:readWhere'))
|
call l:debugger.addReadHandler(function('vebugger#jdb#_readWhere'))
|
||||||
call l:debugger.addReadHandler(function('s:readException'))
|
call l:debugger.addReadHandler(function('vebugger#jdb#_readException'))
|
||||||
call l:debugger.addReadHandler(function('s:readEvaluatedExpressions'))
|
call l:debugger.addReadHandler(function('vebugger#jdb#_readEvaluatedExpressions'))
|
||||||
|
|
||||||
call l:debugger.setWriteHandler('std','flow',function('s:writeFlow'))
|
call l:debugger.setWriteHandler('std','flow',function('vebugger#jdb#_writeFlow'))
|
||||||
call l:debugger.setWriteHandler('std','breakpoints',function('s:writeBreakpoints'))
|
call l:debugger.setWriteHandler('std','breakpoints',function('vebugger#jdb#_writeBreakpoints'))
|
||||||
call l:debugger.setWriteHandler('std','evaluateExpressions',function('s:requestEvaluateExpression'))
|
call l:debugger.setWriteHandler('std','evaluateExpressions',function('vebugger#jdb#_requestEvaluateExpression'))
|
||||||
call l:debugger.setWriteHandler('std','executeStatements',function('s:executeStatements'))
|
call l:debugger.setWriteHandler('std','executeStatements',function('vebugger#jdb#_executeStatements'))
|
||||||
|
|
||||||
call l:debugger.generateWriteActionsFromTemplate()
|
call l:debugger.generateWriteActionsFromTemplate()
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ function! vebugger#jdb#start(entryClass,args)
|
|||||||
return l:debugger
|
return l:debugger
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readProgramOutput(pipeName,line,readResult,debugger) dict
|
function! vebugger#jdb#_readProgramOutput(pipeName,line,readResult,debugger) dict
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
if a:line=~'\v^\> \>'
|
if a:line=~'\v^\> \>'
|
||||||
\||a:line=='> '
|
\||a:line=='> '
|
||||||
@ -68,7 +68,7 @@ function! s:findFolderFromStackTrace(src,nameFromStackTrace)
|
|||||||
return l:path
|
return l:path
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readWhere(pipeName,line,readResult,debugger)
|
function! vebugger#jdb#_readWhere(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v\s*\[(\d+)]\s*(\S+)\s*\(([^:]*):(\d*)\)')
|
let l:matches=matchlist(a:line,'\v\s*\[(\d+)]\s*(\S+)\s*\(([^:]*):(\d*)\)')
|
||||||
if 4<len(l:matches)
|
if 4<len(l:matches)
|
||||||
@ -89,7 +89,7 @@ function! s:readWhere(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readException(pipeName,line,readResult,debugger)
|
function! vebugger#jdb#_readException(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\vException occurred:\s+(\S+)')
|
let l:matches=matchlist(a:line,'\vException occurred:\s+(\S+)')
|
||||||
if 1<len(l:matches)
|
if 1<len(l:matches)
|
||||||
@ -99,7 +99,7 @@ function! s:readException(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeFlow(writeAction,debugger)
|
function! vebugger#jdb#_writeFlow(writeAction,debugger)
|
||||||
if 'stepin'==a:writeAction
|
if 'stepin'==a:writeAction
|
||||||
call a:debugger.writeLine('step')
|
call a:debugger.writeLine('step')
|
||||||
elseif 'stepover'==a:writeAction
|
elseif 'stepover'==a:writeAction
|
||||||
@ -122,7 +122,7 @@ function! s:getClassNameFromFile(filename)
|
|||||||
return l:className
|
return l:className
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeBreakpoints(writeAction,debugger)
|
function! vebugger#jdb#_writeBreakpoints(writeAction,debugger)
|
||||||
for l:breakpoint in a:writeAction
|
for l:breakpoint in a:writeAction
|
||||||
let l:class=''
|
let l:class=''
|
||||||
if has_key(a:debugger.state.jdb.filesToClassesMap,l:breakpoint.file)
|
if has_key(a:debugger.state.jdb.filesToClassesMap,l:breakpoint.file)
|
||||||
@ -140,13 +140,13 @@ function! s:writeBreakpoints(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:requestEvaluateExpression(writeAction,debugger)
|
function! vebugger#jdb#_requestEvaluateExpression(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
call a:debugger.writeLine('eval '.l:evalAction.expression)
|
call a:debugger.writeLine('eval '.l:evalAction.expression)
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:executeStatements(writeAction,debugger)
|
function! vebugger#jdb#_executeStatements(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
if has_key(l:evalAction,'statement')
|
if has_key(l:evalAction,'statement')
|
||||||
"Use eval to run the statement - it works!
|
"Use eval to run the statement - it works!
|
||||||
@ -155,7 +155,7 @@ function! s:executeStatements(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger)
|
function! vebugger#jdb#_readEvaluatedExpressions(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v^%(\s*%(%(%(\w|\.)+)\[\d+\] )+)? ([^=]+) \= (.*)$')
|
let l:matches=matchlist(a:line,'\v^%(\s*%(%(%(\w|\.)+)\[\d+\] )+)? ([^=]+) \= (.*)$')
|
||||||
if 3<len(l:matches)
|
if 3<len(l:matches)
|
||||||
|
@ -29,19 +29,19 @@ function! vebugger#mdbg#start(binaryFile,args)
|
|||||||
call l:debugger.writeLine('run "'.s:pathToMdbgStyle(fnamemodify(a:binaryFile, ':p')).'" '.vebugger#util#commandLineArgsForProgram(a:args))
|
call l:debugger.writeLine('run "'.s:pathToMdbgStyle(fnamemodify(a:binaryFile, ':p')).'" '.vebugger#util#commandLineArgsForProgram(a:args))
|
||||||
call l:debugger.writeLine('where')
|
call l:debugger.writeLine('where')
|
||||||
end
|
end
|
||||||
call l:debugger.addReadHandler(function('s:readProgramOutput'))
|
call l:debugger.addReadHandler(function('vebugger#mdbg#_readProgramOutput'))
|
||||||
call l:debugger.addReadHandler(function('s:readWhere'))
|
call l:debugger.addReadHandler(function('vebugger#mdbg#_readWhere'))
|
||||||
call l:debugger.addReadHandler(function('s:readFinish'))
|
call l:debugger.addReadHandler(function('vebugger#mdbg#_readFinish'))
|
||||||
call l:debugger.addReadHandler(function('s:readEvaluatedExpressions'))
|
call l:debugger.addReadHandler(function('vebugger#mdbg#_readEvaluatedExpressions'))
|
||||||
call l:debugger.addReadHandler(function('s:readBreakpointBound'))
|
call l:debugger.addReadHandler(function('vebugger#mdbg#_readBreakpointBound'))
|
||||||
|
|
||||||
call l:debugger.addThinkHandler(function('s:breakpointAdded'))
|
call l:debugger.addThinkHandler(function('s:breakpointAdded'))
|
||||||
|
|
||||||
call l:debugger.setWriteHandler('std','flow',function('s:writeFlow'))
|
call l:debugger.setWriteHandler('std','flow',function('vebugger#mdbg#_writeFlow'))
|
||||||
call l:debugger.setWriteHandler('std','breakpoints',function('s:writeBreakpoints'))
|
call l:debugger.setWriteHandler('std','breakpoints',function('vebugger#mdbg#_writeBreakpoints'))
|
||||||
call l:debugger.setWriteHandler('std','closeDebugger',function('s:closeDebugger'))
|
call l:debugger.setWriteHandler('std','closeDebugger',function('vebugger#mdbg#_closeDebugger'))
|
||||||
call l:debugger.setWriteHandler('std','evaluateExpressions',function('s:requestEvaluateExpression'))
|
call l:debugger.setWriteHandler('std','evaluateExpressions',function('vebugger#mdbg#_requestEvaluateExpression'))
|
||||||
call l:debugger.setWriteHandler('std','executeStatements',function('s:executeStatements'))
|
call l:debugger.setWriteHandler('std','executeStatements',function('vebugger#mdbg#_executeStatements'))
|
||||||
|
|
||||||
call l:debugger.generateWriteActionsFromTemplate()
|
call l:debugger.generateWriteActionsFromTemplate()
|
||||||
|
|
||||||
@ -86,10 +86,10 @@ function! s:findFilePath(src,fileName,methodName)
|
|||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readProgramOutput(pipeName,line,readResult,debugger)
|
function! vebugger#mdbg#_readProgramOutput(pipeName,line,readResult,debugger)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readWhere(pipeName,line,readResult,debugger)
|
function! vebugger#mdbg#_readWhere(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v^\*(\d+)\.\s*([A-Za-z0-9_.+<>]+)\s*\((.+):(\d+)\)')
|
let l:matches=matchlist(a:line,'\v^\*(\d+)\.\s*([A-Za-z0-9_.+<>]+)\s*\((.+):(\d+)\)')
|
||||||
if 3<len(l:matches)
|
if 3<len(l:matches)
|
||||||
@ -110,13 +110,13 @@ function! s:readWhere(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readFinish(pipeName,line,readResult,debugger)
|
function! vebugger#mdbg#_readFinish(pipeName,line,readResult,debugger)
|
||||||
if a:line=~'\VSTOP: Process Exited\$'
|
if a:line=~'\VSTOP: Process Exited\$'
|
||||||
let a:readResult.std.programFinish={'finish':1}
|
let a:readResult.std.programFinish={'finish':1}
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeFlow(writeAction,debugger)
|
function! vebugger#mdbg#_writeFlow(writeAction,debugger)
|
||||||
if 'stepin'==a:writeAction
|
if 'stepin'==a:writeAction
|
||||||
call a:debugger.writeLine('step')
|
call a:debugger.writeLine('step')
|
||||||
elseif 'stepover'==a:writeAction
|
elseif 'stepover'==a:writeAction
|
||||||
@ -128,11 +128,11 @@ function! s:writeFlow(writeAction,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:closeDebugger(writeAction,debugger)
|
function! vebugger#mdbg#_closeDebugger(writeAction,debugger)
|
||||||
call a:debugger.writeLine('quit')
|
call a:debugger.writeLine('quit')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeBreakpoints(writeAction,debugger)
|
function! vebugger#mdbg#_writeBreakpoints(writeAction,debugger)
|
||||||
for l:breakpoint in a:writeAction
|
for l:breakpoint in a:writeAction
|
||||||
let l:fullFileName=fnamemodify(l:breakpoint.file,':p')
|
let l:fullFileName=fnamemodify(l:breakpoint.file,':p')
|
||||||
if 'add'==(l:breakpoint.action)
|
if 'add'==(l:breakpoint.action)
|
||||||
@ -145,7 +145,7 @@ function! s:writeBreakpoints(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readBreakpointBound(pipeName,line,readResult,debugger)
|
function! vebugger#mdbg#_readBreakpointBound(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\vBreakpoint \#(\d+) bound\s*\(line (\d+) in ([^)]+)\)')
|
let l:matches=matchlist(a:line,'\vBreakpoint \#(\d+) bound\s*\(line (\d+) in ([^)]+)\)')
|
||||||
if 3<len(l:matches)
|
if 3<len(l:matches)
|
||||||
@ -171,13 +171,13 @@ function! s:breakpointAdded(readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:requestEvaluateExpression(writeAction,debugger)
|
function! vebugger#mdbg#_requestEvaluateExpression(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
call a:debugger.writeLine('print '.l:evalAction.expression)
|
call a:debugger.writeLine('print '.l:evalAction.expression)
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:executeStatements(writeAction,debugger)
|
function! vebugger#mdbg#_executeStatements(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
if has_key(l:evalAction,'statement')
|
if has_key(l:evalAction,'statement')
|
||||||
call a:debugger.writeLine('set '.substitute(l:evalAction.statement,'\v;\s*$','',''))
|
call a:debugger.writeLine('set '.substitute(l:evalAction.statement,'\v;\s*$','',''))
|
||||||
@ -185,7 +185,7 @@ function! s:executeStatements(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger) dict
|
function! vebugger#mdbg#_readEvaluatedExpressions(pipeName,line,readResult,debugger) dict
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v\[[^\]]*\]\s*mdbg\>\s*([^=]+)\=(.*)$')
|
let l:matches=matchlist(a:line,'\v\[[^\]]*\]\s*mdbg\>\s*([^=]+)\=(.*)$')
|
||||||
if 2<len(l:matches)
|
if 2<len(l:matches)
|
||||||
|
@ -12,17 +12,17 @@ function! vebugger#pdb#start(entryFile,args)
|
|||||||
call vebugger#std#openShellBuffer(l:debugger)
|
call vebugger#std#openShellBuffer(l:debugger)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call l:debugger.addReadHandler(function('s:readProgramOutput'))
|
call l:debugger.addReadHandler(function('vebugger#pdb#_readProgramOutput'))
|
||||||
call l:debugger.addReadHandler(function('s:readWhere'))
|
call l:debugger.addReadHandler(function('vebugger#pdb#_readWhere'))
|
||||||
call l:debugger.addReadHandler(function('s:readFinish'))
|
call l:debugger.addReadHandler(function('vebugger#pdb#_readFinish'))
|
||||||
call l:debugger.addReadHandler(function('s:readEvaluatedExpressions'))
|
call l:debugger.addReadHandler(function('vebugger#pdb#_readEvaluatedExpressions'))
|
||||||
|
|
||||||
call l:debugger.setWriteHandler('std','flow',function('s:writeFlow'))
|
call l:debugger.setWriteHandler('std','flow',function('vebugger#pdb#_writeFlow'))
|
||||||
call l:debugger.setWriteHandler('std','breakpoints',function('s:writeBreakpoints'))
|
call l:debugger.setWriteHandler('std','breakpoints',function('vebugger#pdb#_writeBreakpoints'))
|
||||||
call l:debugger.setWriteHandler('std','closeDebugger',function('s:closeDebugger'))
|
call l:debugger.setWriteHandler('std','closeDebugger',function('vebugger#pdb#_closeDebugger'))
|
||||||
call l:debugger.setWriteHandler('std','evaluateExpressions',function('s:requestEvaluateExpression'))
|
call l:debugger.setWriteHandler('std','evaluateExpressions',function('vebugger#pdb#_requestEvaluateExpression'))
|
||||||
call l:debugger.setWriteHandler('std','executeStatements',function('s:executeStatements'))
|
call l:debugger.setWriteHandler('std','executeStatements',function('vebugger#pdb#_executeStatements'))
|
||||||
call l:debugger.setWriteHandler('std','removeAfterDisplayed',function('s:removeAfterDisplayed'))
|
call l:debugger.setWriteHandler('std','removeAfterDisplayed',function('vebugger#pdb#_removeAfterDisplayed'))
|
||||||
|
|
||||||
call l:debugger.generateWriteActionsFromTemplate()
|
call l:debugger.generateWriteActionsFromTemplate()
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ function! vebugger#pdb#start(entryFile,args)
|
|||||||
return l:debugger
|
return l:debugger
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readProgramOutput(pipeName,line,readResult,debugger) dict
|
function! vebugger#pdb#_readProgramOutput(pipeName,line,readResult,debugger) dict
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
if a:line=~"\\V\<C-[>[C" " After executing commands this seems to get appended...
|
if a:line=~"\\V\<C-[>[C" " After executing commands this seems to get appended...
|
||||||
let self.programOutputMode=1
|
let self.programOutputMode=1
|
||||||
@ -54,7 +54,7 @@ function! s:readProgramOutput(pipeName,line,readResult,debugger) dict
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readWhere(pipeName,line,readResult,debugger)
|
function! vebugger#pdb#_readWhere(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v^\> (.+)\((\d+)\).*\(\)$')
|
let l:matches=matchlist(a:line,'\v^\> (.+)\((\d+)\).*\(\)$')
|
||||||
|
|
||||||
@ -70,13 +70,13 @@ function! s:readWhere(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readFinish(pipeName,line,readResult,debugger)
|
function! vebugger#pdb#_readFinish(pipeName,line,readResult,debugger)
|
||||||
if a:line=='The program finished and will be restarted'
|
if a:line=='The program finished and will be restarted'
|
||||||
let a:readResult.std.programFinish={'finish':1}
|
let a:readResult.std.programFinish={'finish':1}
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeFlow(writeAction,debugger)
|
function! vebugger#pdb#_writeFlow(writeAction,debugger)
|
||||||
if 'stepin'==a:writeAction
|
if 'stepin'==a:writeAction
|
||||||
call a:debugger.writeLine('step')
|
call a:debugger.writeLine('step')
|
||||||
elseif 'stepover'==a:writeAction
|
elseif 'stepover'==a:writeAction
|
||||||
@ -88,11 +88,11 @@ function! s:writeFlow(writeAction,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:closeDebugger(writeAction,debugger)
|
function! vebugger#pdb#_closeDebugger(writeAction,debugger)
|
||||||
call a:debugger.writeLine('quit')
|
call a:debugger.writeLine('quit')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeBreakpoints(writeAction,debugger)
|
function! vebugger#pdb#_writeBreakpoints(writeAction,debugger)
|
||||||
for l:breakpoint in a:writeAction
|
for l:breakpoint in a:writeAction
|
||||||
if 'add'==(l:breakpoint.action)
|
if 'add'==(l:breakpoint.action)
|
||||||
call a:debugger.writeLine('break '.fnameescape(fnamemodify(l:breakpoint.file,':p')).':'.l:breakpoint.line)
|
call a:debugger.writeLine('break '.fnameescape(fnamemodify(l:breakpoint.file,':p')).':'.l:breakpoint.line)
|
||||||
@ -102,13 +102,13 @@ function! s:writeBreakpoints(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:requestEvaluateExpression(writeAction,debugger)
|
function! vebugger#pdb#_requestEvaluateExpression(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
call a:debugger.writeLine('p '.l:evalAction.expression)
|
call a:debugger.writeLine('p '.l:evalAction.expression)
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:executeStatements(writeAction,debugger)
|
function! vebugger#pdb#_executeStatements(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
if has_key(l:evalAction,'statement')
|
if has_key(l:evalAction,'statement')
|
||||||
call a:debugger.writeLine('!'.l:evalAction.statement)
|
call a:debugger.writeLine('!'.l:evalAction.statement)
|
||||||
@ -116,7 +116,7 @@ function! s:executeStatements(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger) dict
|
function! vebugger#pdb#_readEvaluatedExpressions(pipeName,line,readResult,debugger) dict
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
if has_key(self,'expression') "Reading the actual value to print
|
if has_key(self,'expression') "Reading the actual value to print
|
||||||
let l:value=a:line
|
let l:value=a:line
|
||||||
@ -134,7 +134,7 @@ function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger) dict
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:removeAfterDisplayed(writeAction,debugger)
|
function! vebugger#pdb#_removeAfterDisplayed(writeAction,debugger)
|
||||||
for l:removeAction in a:writeAction
|
for l:removeAction in a:writeAction
|
||||||
if has_key(l:removeAction,'id')
|
if has_key(l:removeAction,'id')
|
||||||
"call a:debugger.writeLine('undisplay '.l:removeAction.id)
|
"call a:debugger.writeLine('undisplay '.l:removeAction.id)
|
||||||
|
@ -11,15 +11,15 @@ function! vebugger#rdebug#start(entryFile,args)
|
|||||||
call vebugger#std#openShellBuffer(l:debugger)
|
call vebugger#std#openShellBuffer(l:debugger)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
call l:debugger.addReadHandler(function('s:readProgramOutput'))
|
call l:debugger.addReadHandler(function('vebugger#rdebug#_readProgramOutput'))
|
||||||
call l:debugger.addReadHandler(function('s:readWhere'))
|
call l:debugger.addReadHandler(function('vebugger#rdebug#_readWhere'))
|
||||||
call l:debugger.addReadHandler(function('s:readEvaluatedExpressions'))
|
call l:debugger.addReadHandler(function('vebugger#rdebug#_readEvaluatedExpressions'))
|
||||||
|
|
||||||
call l:debugger.setWriteHandler('std','flow',function('s:writeFlow'))
|
call l:debugger.setWriteHandler('std','flow',function('vebugger#rdebug#_writeFlow'))
|
||||||
call l:debugger.setWriteHandler('std','breakpoints',function('s:writeBreakpoints'))
|
call l:debugger.setWriteHandler('std','breakpoints',function('vebugger#rdebug#_writeBreakpoints'))
|
||||||
call l:debugger.setWriteHandler('std','evaluateExpressions',function('s:requestEvaluateExpression'))
|
call l:debugger.setWriteHandler('std','evaluateExpressions',function('vebugger#rdebug#_requestEvaluateExpression'))
|
||||||
call l:debugger.setWriteHandler('std','executeStatements',function('s:executeStatements'))
|
call l:debugger.setWriteHandler('std','executeStatements',function('vebugger#rdebug#_executeStatements'))
|
||||||
call l:debugger.setWriteHandler('std','removeAfterDisplayed',function('s:removeAfterDisplayed'))
|
call l:debugger.setWriteHandler('std','removeAfterDisplayed',function('vebugger#rdebug#_removeAfterDisplayed'))
|
||||||
|
|
||||||
call l:debugger.generateWriteActionsFromTemplate()
|
call l:debugger.generateWriteActionsFromTemplate()
|
||||||
|
|
||||||
@ -28,13 +28,13 @@ function! vebugger#rdebug#start(entryFile,args)
|
|||||||
return l:debugger
|
return l:debugger
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readProgramOutput(pipeName,line,readResult,debugger)
|
function! vebugger#rdebug#_readProgramOutput(pipeName,line,readResult,debugger)
|
||||||
if 'err'==a:pipeName
|
if 'err'==a:pipeName
|
||||||
let a:readResult.std.programOutput={'line':a:line}
|
let a:readResult.std.programOutput={'line':a:line}
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readWhere(pipeName,line,readResult,debugger)
|
function! vebugger#rdebug#_readWhere(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v^([^:]+)\:(\d+)\:(.*)$')
|
let l:matches=matchlist(a:line,'\v^([^:]+)\:(\d+)\:(.*)$')
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ function! s:readWhere(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeFlow(writeAction,debugger)
|
function! vebugger#rdebug#_writeFlow(writeAction,debugger)
|
||||||
if 'stepin'==a:writeAction
|
if 'stepin'==a:writeAction
|
||||||
call a:debugger.writeLine('step')
|
call a:debugger.writeLine('step')
|
||||||
elseif 'stepover'==a:writeAction
|
elseif 'stepover'==a:writeAction
|
||||||
@ -62,7 +62,7 @@ function! s:writeFlow(writeAction,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:writeBreakpoints(writeAction,debugger)
|
function! vebugger#rdebug#_writeBreakpoints(writeAction,debugger)
|
||||||
for l:breakpoint in a:writeAction
|
for l:breakpoint in a:writeAction
|
||||||
if 'add'==(l:breakpoint.action)
|
if 'add'==(l:breakpoint.action)
|
||||||
call a:debugger.writeLine('break '.fnameescape(l:breakpoint.file).':'.l:breakpoint.line)
|
call a:debugger.writeLine('break '.fnameescape(l:breakpoint.file).':'.l:breakpoint.line)
|
||||||
@ -72,13 +72,13 @@ function! s:writeBreakpoints(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:requestEvaluateExpression(writeAction,debugger)
|
function! vebugger#rdebug#_requestEvaluateExpression(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
call a:debugger.writeLine('display '.l:evalAction.expression)
|
call a:debugger.writeLine('display '.l:evalAction.expression)
|
||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:executeStatements(writeAction,debugger)
|
function! vebugger#rdebug#_executeStatements(writeAction,debugger)
|
||||||
for l:evalAction in a:writeAction
|
for l:evalAction in a:writeAction
|
||||||
if has_key(l:evalAction,'statement')
|
if has_key(l:evalAction,'statement')
|
||||||
"rdebug uses Ruby functions for commands
|
"rdebug uses Ruby functions for commands
|
||||||
@ -87,7 +87,7 @@ function! s:executeStatements(writeAction,debugger)
|
|||||||
endfor
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger)
|
function! vebugger#rdebug#_readEvaluatedExpressions(pipeName,line,readResult,debugger)
|
||||||
if 'out'==a:pipeName
|
if 'out'==a:pipeName
|
||||||
let l:matches=matchlist(a:line,'\v^(\d+)\: (.*) \= (.*)$')
|
let l:matches=matchlist(a:line,'\v^(\d+)\: (.*) \= (.*)$')
|
||||||
if 4<len(l:matches)
|
if 4<len(l:matches)
|
||||||
@ -102,7 +102,7 @@ function! s:readEvaluatedExpressions(pipeName,line,readResult,debugger)
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:removeAfterDisplayed(writeAction,debugger)
|
function! vebugger#rdebug#_removeAfterDisplayed(writeAction,debugger)
|
||||||
for l:removeAction in a:writeAction
|
for l:removeAction in a:writeAction
|
||||||
if has_key(l:removeAction,'id')
|
if has_key(l:removeAction,'id')
|
||||||
call a:debugger.writeLine('undisplay '.l:removeAction.id)
|
call a:debugger.writeLine('undisplay '.l:removeAction.id)
|
||||||
|
@ -242,7 +242,8 @@ sign define vebugger_breakpoint text=** linehl=ColorColumn
|
|||||||
function! vebugger#std#updateMarksForFile(state,filename)
|
function! vebugger#std#updateMarksForFile(state,filename)
|
||||||
let l:filename=fnamemodify(a:filename,":p")
|
let l:filename=fnamemodify(a:filename,":p")
|
||||||
if bufexists(l:filename)
|
if bufexists(l:filename)
|
||||||
exe 'sign unplace * file='.fnameescape(fnamemodify(l:filename,':p'))
|
exe 'sign unplace 1 file='.fnameescape(fnamemodify(l:filename,':p'))
|
||||||
|
exe 'sign unplace 2 file='.fnameescape(fnamemodify(l:filename,':p'))
|
||||||
|
|
||||||
for l:breakpoint in g:vebugger_breakpoints
|
for l:breakpoint in g:vebugger_breakpoints
|
||||||
if fnamemodify(l:breakpoint.file,':p')==fnamemodify(a:filename,':p')
|
if fnamemodify(l:breakpoint.file,':p')==fnamemodify(a:filename,':p')
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
Author: Idan Arye <https://github.com/idanarye/>
|
Author: Idan Arye <https://github.com/idanarye/>
|
||||||
License: Same terms as Vim itself (see |license|)
|
License: Same terms as Vim itself (see |license|)
|
||||||
|
|
||||||
Version: 1.2.1
|
Version: 1.2.1+
|
||||||
|
|
||||||
INTRODUCTION *vebugger*
|
INTRODUCTION *vebugger*
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user