Added callstack support
Currently only sets the state with the current callstack
This commit is contained in:
parent
a820f6b777
commit
9788f69c3e
@ -196,3 +196,7 @@ function! vebugger#showLogBuffer()
|
|||||||
call s:debugger.showLogBuffer()
|
call s:debugger.showLogBuffer()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! vebugger#getActiveDebugger()
|
||||||
|
return s:debugger
|
||||||
|
endfunction
|
||||||
|
@ -32,13 +32,19 @@ function! s: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)
|
||||||
if '1'==l:matches[1] " check that this is the innermost stackframe
|
|
||||||
let l:file=s:findFolderFromStackTrace(a:debugger.state.std.srcpath,l:matches[2]).'/'.l:matches[3]
|
let l:file=s:findFolderFromStackTrace(a:debugger.state.std.srcpath,l:matches[2]).'/'.l:matches[3]
|
||||||
let l:file=fnamemodify(l:file,':~:.')
|
let l:file=fnamemodify(l:file,':~:.')
|
||||||
|
let l:frameNumber=str2nr(l:matches[1])
|
||||||
|
if 1==l:frameNumber " first stackframe is the current location
|
||||||
let a:readResult.std.location={
|
let a:readResult.std.location={
|
||||||
\'file':(l:file),
|
\'file':(l:file),
|
||||||
\'line':(l:matches[4])}
|
\'line':(l:matches[4])}
|
||||||
endif
|
endif
|
||||||
|
let a:readResult.std.callstack={
|
||||||
|
\'clearOld':('1'==l:frameNumber),
|
||||||
|
\'add':'after',
|
||||||
|
\'file':(l:file),
|
||||||
|
\'line':(l:matches[4])}
|
||||||
endif
|
endif
|
||||||
end
|
end
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -2,12 +2,14 @@
|
|||||||
function! vebugger#std#setStandardState(debugger)
|
function! vebugger#std#setStandardState(debugger)
|
||||||
let a:debugger.state.std={
|
let a:debugger.state.std={
|
||||||
\'srcpath':'.',
|
\'srcpath':'.',
|
||||||
\'location':{}}
|
\'location':{},
|
||||||
|
\'callstack':[]}
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! vebugger#std#setStandardReadResultTemplate(debugger)
|
function! vebugger#std#setStandardReadResultTemplate(debugger)
|
||||||
let a:debugger.readResultTemplate.std={
|
let a:debugger.readResultTemplate.std={
|
||||||
\'location':{}}
|
\'location':{},
|
||||||
|
\'callstack':{}}
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! vebugger#std#addStandardFunctions(debugger)
|
function! vebugger#std#addStandardFunctions(debugger)
|
||||||
@ -68,6 +70,21 @@ function! s:standardThinkHandlers.moveToCurrentLine(readResult,debugger) dict
|
|||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:standardThinkHandlers.updateCallStack(readResult,debugger) dict
|
||||||
|
let l:callstack=a:readResult.std.callstack
|
||||||
|
if !empty(l:callstack)
|
||||||
|
if get(l:callstack,'clearOld')
|
||||||
|
let a:debugger.state.std.callstack=[]
|
||||||
|
endif
|
||||||
|
let l:frame={'file':(l:callstack.file),'line':(l:callstack.line)}
|
||||||
|
if 'after'==get(l:callstack,'add')
|
||||||
|
call add(a:debugger.state.std.callstack,l:frame)
|
||||||
|
elseif 'before'==get(l:callstack,'add')
|
||||||
|
call insert(a:debugger.state.std.callstack,l:frame)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
let s:standardCloseHandlers={}
|
let s:standardCloseHandlers={}
|
||||||
function! s:standardCloseHandlers.removeCurrentMarker(debugger) dict
|
function! s:standardCloseHandlers.removeCurrentMarker(debugger) dict
|
||||||
sign unplace 1
|
sign unplace 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user