2016-02-16 17:32:15 -05:00
|
|
|
"Read bytes from pipe to buffer
|
|
|
|
function! s:fillBufferFromPipe(pipeObject)
|
|
|
|
let l:text = a:pipeObject.pipe.read(1024, 0)
|
|
|
|
let l:totalBytesRead = 0
|
|
|
|
while 0 < len(l:text)
|
|
|
|
let l:totalBytesRead += len(l:text)
|
|
|
|
let a:pipeObject.buffer .= l:text
|
|
|
|
let l:text = a:pipeObject.pipe.read(1024, 0)
|
2015-02-28 12:16:25 -05:00
|
|
|
endwhile
|
2016-02-16 17:32:15 -05:00
|
|
|
return l:totalBytesRead
|
2013-12-23 16:37:18 -05:00
|
|
|
endfunction
|
|
|
|
|
2013-12-25 13:33:12 -05:00
|
|
|
let s:f_debugger={}
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Terminate the debugger
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:f_debugger.kill() dict
|
2015-02-28 12:16:25 -05:00
|
|
|
if self.shell.is_valid
|
|
|
|
call self.addLineToTerminal('','== DEBUGGER TERMINATED ==')
|
|
|
|
endif
|
2017-01-06 17:01:30 -05:00
|
|
|
if !has('timers')
|
|
|
|
let &updatetime=self.prevUpdateTime
|
|
|
|
endif
|
2015-02-28 12:16:25 -05:00
|
|
|
call self.shell.kill(15)
|
|
|
|
if exists('s:debugger')
|
|
|
|
for l:closeHandler in s:debugger.closeHandlers
|
|
|
|
call l:closeHandler.handle(self)
|
|
|
|
endfor
|
|
|
|
endif
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Write a line to the debugger's interactive shell
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:f_debugger.writeLine(line) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
call self.shell.stdin.write(a:line."\n")
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Check for new lines from the debugger's interactive shell and handle them
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:f_debugger.invokeReading() dict
|
2016-02-16 17:32:15 -05:00
|
|
|
let l:newLines = {}
|
2015-02-28 12:16:25 -05:00
|
|
|
for l:k in keys(self.pipes)
|
2016-02-16 17:32:15 -05:00
|
|
|
let l:pipe = self.pipes[l:k]
|
|
|
|
if 0 < s:fillBufferFromPipe(l:pipe)
|
|
|
|
let l:nl = l:pipe.bufferer()
|
|
|
|
if 0 < len(l:nl)
|
|
|
|
let l:newLines[l:k] = l:nl
|
|
|
|
endif
|
2015-02-28 12:16:25 -05:00
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
for l:k in keys(l:newLines)
|
|
|
|
for l:line in l:newLines[l:k]
|
2016-02-16 17:32:15 -05:00
|
|
|
call self.handleLine(l:k, l:line)
|
2015-02-28 12:16:25 -05:00
|
|
|
endfor
|
|
|
|
endfor
|
|
|
|
|
|
|
|
let l:checkpid=self.shell.checkpid()
|
|
|
|
if 'exit'==l:checkpid[0]
|
|
|
|
\|| 'error'==l:checkpid[0]
|
|
|
|
call self.kill()
|
|
|
|
endif
|
2017-01-06 17:01:30 -05:00
|
|
|
if !has('timers')
|
|
|
|
call feedkeys("f\e", '\n') " Make sure the CursorHold event is refired even if the user does nothing
|
|
|
|
endif
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Handle a single line from the debugger's interactive shell
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:f_debugger.handleLine(pipeName,line) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
call self.addLineToTerminal(a:pipeName,a:line)
|
2013-12-25 13:33:12 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
let l:readResult=deepcopy(self.readResultTemplate,1)
|
2013-12-25 13:33:12 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
for l:readHandler in self.readHandlers
|
|
|
|
call l:readHandler.handle(a:pipeName,a:line,l:readResult,self)
|
|
|
|
endfor
|
2013-12-25 13:33:12 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
for l:thinkHandler in self.thinkHandlers
|
|
|
|
call l:thinkHandler.handle(l:readResult,self)
|
|
|
|
endfor
|
2013-12-27 16:52:57 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
call self.performWriteActions()
|
2013-12-27 16:52:57 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Perform all write actions
|
2013-12-27 16:52:57 -05:00
|
|
|
function! s:f_debugger.performWriteActions() dict
|
2015-02-28 12:16:25 -05:00
|
|
|
for l:namespace in keys(self.writeActions)
|
|
|
|
let l:handlers=get(self.writeHandlers,l:namespace)
|
|
|
|
if !empty(l:handlers)
|
|
|
|
for l:writeAction in items(self.writeActions[l:namespace])
|
|
|
|
if !empty(l:writeAction[1])
|
|
|
|
if has_key(l:handlers,l:writeAction[0])
|
|
|
|
call l:handlers[l:writeAction[0]].handle(l:writeAction[1],self)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
endif
|
|
|
|
endfor
|
|
|
|
call self.generateWriteActionsFromTemplate()
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Show the terminal buffer that gets it's content from the debugger's
|
|
|
|
"interactive shell
|
2014-05-14 14:52:55 -04:00
|
|
|
function! s:f_debugger.showTerminalBuffer() dict
|
2015-02-28 12:16:25 -05:00
|
|
|
if has_key(self,'terminalBuffer')
|
|
|
|
if -1<bufwinnr(self.terminalBuffer)
|
|
|
|
return
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
new
|
|
|
|
setlocal buftype=nofile
|
|
|
|
setlocal bufhidden=wipe
|
2017-12-13 08:23:28 -05:00
|
|
|
setlocal filetype=VebuggerTerminal
|
2015-02-28 12:16:25 -05:00
|
|
|
let self.terminalBuffer=bufnr('')
|
2016-01-26 12:21:19 -05:00
|
|
|
silent file Vebugger:Terminal
|
2015-02-28 12:16:25 -05:00
|
|
|
wincmd p
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Close the terminal buffer
|
2014-05-14 14:52:55 -04:00
|
|
|
function! s:f_debugger.closeTerminalBuffer() dict
|
2015-02-28 12:16:25 -05:00
|
|
|
if has_key(self,'terminalBuffer')
|
|
|
|
if -1<bufwinnr(self.terminalBuffer)
|
|
|
|
let l:bufwin=bufwinnr(self.terminalBuffer)
|
|
|
|
exe l:bufwin.'wincmd w'
|
|
|
|
wincmd c
|
|
|
|
wincmd p
|
|
|
|
endif
|
|
|
|
endif
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Check if the terminal buffer associated with this debugger is currently open
|
2014-05-14 14:52:55 -04:00
|
|
|
function! s:f_debugger.isTerminalBufferOpen() dict
|
2015-02-28 12:16:25 -05:00
|
|
|
if has_key(self,'terminalBuffer')
|
|
|
|
if -1<bufwinnr(self.terminalBuffer)
|
|
|
|
return 1
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
return 0
|
2013-12-27 17:08:42 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Turn on and off the terminal buffer associated with this debugger
|
2014-05-14 14:52:55 -04:00
|
|
|
function! s:f_debugger.toggleTerminalBuffer() dict
|
2015-02-28 12:16:25 -05:00
|
|
|
if self.isTerminalBufferOpen()
|
|
|
|
call self.closeTerminalBuffer()
|
|
|
|
else
|
|
|
|
call self.showTerminalBuffer()
|
|
|
|
endif
|
2013-12-27 17:08:42 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Write a line to the terminal buffer. This function does not process the line
|
2014-05-14 14:52:55 -04:00
|
|
|
function! s:f_debugger.addLineToTerminal(pipeName,line) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
if has_key(self,'terminalBuffer')
|
|
|
|
let l:bufwin=bufwinnr(self.terminalBuffer)
|
|
|
|
if -1<l:bufwin
|
|
|
|
exe l:bufwin.'wincmd w'
|
|
|
|
if has_key(self,'pipes')
|
|
|
|
\&&has_key(self.pipes,a:pipeName)
|
|
|
|
\&&has_key(self.pipes[a:pipeName],'annotation')
|
|
|
|
call append (line('$'),(self.pipes[a:pipeName].annotation).(a:line))
|
|
|
|
else
|
|
|
|
call append (line('$'),a:line)
|
|
|
|
endif
|
|
|
|
normal G
|
|
|
|
wincmd p
|
|
|
|
endif
|
|
|
|
endif
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Add an handler to a handler list
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:addHandler(list,handler)
|
2015-02-28 12:16:25 -05:00
|
|
|
if type(a:handler) == type({})
|
|
|
|
call add(a:list,a:handler)
|
|
|
|
elseif type(a:handler) == type(function('tr'))
|
|
|
|
call add(a:list,{'handle':a:handler})
|
|
|
|
endif
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Set a named handler in a handler dictionary
|
2013-12-27 16:52:57 -05:00
|
|
|
function! s:setHandler(dict,namespace,name,handler)
|
2015-02-28 12:16:25 -05:00
|
|
|
if !has_key(a:dict,a:namespace)
|
|
|
|
let a:dict[a:namespace]={}
|
|
|
|
endif
|
|
|
|
if type(a:handler) == type({})
|
|
|
|
let a:dict[a:namespace][a:name]=a:handler
|
|
|
|
elseif type(a:handler) == type(function('tr'))
|
|
|
|
let a:dict[a:namespace][a:name]={'handle':a:handler}
|
|
|
|
endif
|
2013-12-27 16:52:57 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Add a read handler. Read handlers process output from the debugger's
|
|
|
|
"interactive shell and modify read result objects with structured information
|
|
|
|
"parsed from those lines
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:f_debugger.addReadHandler(handler) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
call s:addHandler(self.readHandlers,a:handler)
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Add a think handler. Think handlers are debugger agnostic - they look at
|
|
|
|
"read result objects and decide what to do with them.
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:f_debugger.addThinkHandler(handler) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
call s:addHandler(self.thinkHandlers,a:handler)
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Set a write handler. Write handlers get write action objects and convert them
|
|
|
|
"to debugger specific commands. A write action can only handle a write action
|
|
|
|
"of the namespace and name it is registered for, to prevent the same write
|
|
|
|
"action handled by multiple write handlers.
|
2013-12-27 16:52:57 -05:00
|
|
|
function! s:f_debugger.setWriteHandler(namespace,name,handler) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
call s:setHandler(self.writeHandlers,a:namespace,a:name,a:handler)
|
2013-12-27 16:52:57 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Add a close handler. Close handlers are called when the debugger is closed to
|
|
|
|
"tidy things up.
|
2013-12-25 13:33:12 -05:00
|
|
|
function! s:f_debugger.addCloseHandler(handler) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
call s:addHandler(self.closeHandlers,a:handler)
|
2013-12-25 13:33:12 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Create an empty write action that follows the write actions template. That
|
|
|
|
"action will later be filled by think handlers or from outside.
|
2013-12-27 16:52:57 -05:00
|
|
|
function! s:f_debugger.generateWriteActionsFromTemplate() dict
|
2015-02-28 12:16:25 -05:00
|
|
|
let self.writeActions=deepcopy(self.writeActionsTemplate)
|
2013-12-27 16:52:57 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Set a write action of a specific namespace and name, for write actions that
|
|
|
|
"do not support a list
|
2013-12-27 16:52:57 -05:00
|
|
|
function! s:f_debugger.setWriteAction(namespace,name,value) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
let self.writeActions[a:namespace][a:name]=a:value
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
"Set a write action and perform it
|
|
|
|
function! s:f_debugger.setWriteActionAndPerform(namespace, name, value) dict
|
|
|
|
call self.setWriteAction(a:namespace, a:name, a:value)
|
|
|
|
call self.performWriteActions()
|
2013-12-27 16:52:57 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Add a write action of a specific namespace and name, for write actions that supports a list
|
2013-12-28 15:23:33 -05:00
|
|
|
function! s:f_debugger.addWriteAction(namespace,name,value) dict
|
2015-02-28 12:16:25 -05:00
|
|
|
call add(self.writeActions[a:namespace][a:name],a:value)
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
"Add a write action and perform it
|
|
|
|
function! s:f_debugger.addWriteActionAndPerform(namespace, name, value) dict
|
|
|
|
call self.addWriteAction(a:namespace, a:name, a:value)
|
|
|
|
call self.performWriteActions()
|
2013-12-28 15:23:33 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Create a bare debugger object from a raw shell line
|
2013-12-25 13:33:12 -05:00
|
|
|
function! vebugger#createDebugger(command)
|
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
let l:debugger=deepcopy(s:f_debugger)
|
2013-12-25 13:33:12 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
let l:debugger.shell=vimproc#ptyopen(a:command,3)
|
2014-05-16 10:42:22 -04:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
let l:debugger.outBuffer=''
|
|
|
|
let l:debugger.errBuffer=''
|
2013-12-23 16:37:18 -05:00
|
|
|
|
2016-02-16 17:32:15 -05:00
|
|
|
let l:debugger.pipes = {
|
|
|
|
\ 'out': {'pipe':(l:debugger.shell.stdout), 'buffer': ''},
|
|
|
|
\ 'err': {'pipe':(l:debugger.shell.stderr), 'buffer': '', 'annotation': "err:\t\t"}}
|
|
|
|
for l:pipe in values(l:debugger.pipes)
|
|
|
|
"let l:pipe.buffer = ''
|
|
|
|
"let l:pipe.readIntoBuffer = function('vebugger#readIntoBuffer')
|
|
|
|
"let l:pipe.bufferer = function('vebugger#readNewLinesFromPipe')
|
|
|
|
endfor
|
2013-12-23 16:37:18 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
let l:debugger.readResultTemplate={}
|
|
|
|
let l:debugger.state={}
|
|
|
|
let l:debugger.writeActionsTemplate={}
|
2013-12-25 13:33:12 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
let l:debugger.readHandlers=[]
|
|
|
|
let l:debugger.thinkHandlers=[]
|
|
|
|
let l:debugger.writeHandlers={}
|
|
|
|
let l:debugger.closeHandlers=[]
|
2013-12-24 18:21:41 -05:00
|
|
|
|
2017-01-06 17:01:30 -05:00
|
|
|
if !has('timers')
|
|
|
|
let l:debugger.prevUpdateTime=&updatetime
|
|
|
|
set updatetime=500
|
|
|
|
endif
|
2013-12-24 18:21:41 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
return l:debugger
|
2013-12-23 16:37:18 -05:00
|
|
|
endfunction
|
|
|
|
|
2017-01-06 17:01:30 -05:00
|
|
|
if has('timers')
|
|
|
|
function! s:readingTimerCallback(timerId)
|
|
|
|
call s:debugger.invokeReading()
|
|
|
|
endfunction
|
|
|
|
endif
|
2013-12-23 16:37:18 -05:00
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Create a debugger and set it as the currently active debugger
|
2013-12-23 16:37:18 -05:00
|
|
|
function! vebugger#startDebugger(command)
|
2015-02-28 12:16:25 -05:00
|
|
|
call vebugger#killDebugger()
|
2013-12-23 16:37:18 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
let s:debugger=vebugger#createDebugger(a:command)
|
2013-12-23 16:37:18 -05:00
|
|
|
|
2017-01-06 17:01:30 -05:00
|
|
|
if has('timers')
|
|
|
|
let s:timerId = timer_start(500, function('s:readingTimerCallback'), {'repeat': -1})
|
|
|
|
else
|
|
|
|
augroup vebugger_shell
|
|
|
|
autocmd!
|
|
|
|
autocmd CursorHold * call s:debugger.invokeReading()
|
|
|
|
augroup END
|
|
|
|
endif
|
2013-12-25 13:33:12 -05:00
|
|
|
|
2015-02-28 12:16:25 -05:00
|
|
|
return s:debugger
|
2013-12-23 16:37:18 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Terminate the currently active debugger
|
2013-12-23 16:37:18 -05:00
|
|
|
function! vebugger#killDebugger()
|
2017-01-06 17:01:30 -05:00
|
|
|
if has('timers')
|
|
|
|
if exists('s:timerId')
|
|
|
|
call timer_stop(s:timerId)
|
|
|
|
unlet s:timerId
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
augroup vebugger_shell
|
|
|
|
autocmd!
|
|
|
|
augroup END
|
|
|
|
endif
|
2015-02-28 12:16:25 -05:00
|
|
|
if exists('s:debugger')
|
2015-06-27 08:03:03 -04:00
|
|
|
call vebugger#std#closeShellBuffer(s:debugger)
|
2015-02-28 12:16:25 -05:00
|
|
|
call s:debugger.closeTerminalBuffer()
|
|
|
|
call s:debugger.kill()
|
|
|
|
unlet s:debugger
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
2015-02-28 12:37:54 -05:00
|
|
|
"Perform an action on the actvie debugger, and register that action
|
2015-02-28 12:16:25 -05:00
|
|
|
function! vebugger#userAction(action, ...)
|
|
|
|
if exists('s:debugger')
|
|
|
|
if has_key(s:debugger, a:action)
|
2015-02-28 12:37:54 -05:00
|
|
|
let s:debugger.lastUserAction = {
|
|
|
|
\'action': a:action,
|
|
|
|
\'args': a:000}
|
|
|
|
|
|
|
|
try
|
|
|
|
doautocmd User Vebugger_PreUserAction
|
2015-03-01 14:32:20 -05:00
|
|
|
finally
|
|
|
|
call call(s:debugger[a:action], a:000, s:debugger)
|
2015-02-28 12:37:54 -05:00
|
|
|
doautocmd User Vebugger_PostUserAction
|
|
|
|
endtry
|
2015-02-28 12:16:25 -05:00
|
|
|
else
|
|
|
|
throw 'Current debugger does not support action '.a:action
|
|
|
|
endif
|
|
|
|
endif
|
2013-12-23 16:37:18 -05:00
|
|
|
endfunction
|
|
|
|
|
2015-02-28 12:37:54 -05:00
|
|
|
augroup vebugger_hooks
|
|
|
|
autocmd!
|
|
|
|
"Make a blank action hook to prevent 'No matching autocommands" warning
|
|
|
|
autocmd User Vebugger_* echo
|
|
|
|
augroup END
|
|
|
|
|
|
|
|
"Repeat the last action performed on the active debugger
|
|
|
|
function! vebugger#repeatLastUserAction()
|
|
|
|
if exists('s:debugger')
|
|
|
|
if has_key(s:debugger, 'lastUserAction')
|
|
|
|
let l:lastUserAction = s:debugger.lastUserAction
|
|
|
|
call call(s:debugger[l:lastUserAction.action], l:lastUserAction.args, s:debugger)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Write a line to the currently active debugger
|
2013-12-23 16:37:18 -05:00
|
|
|
function! vebugger#writeLine(line)
|
2015-02-28 12:16:25 -05:00
|
|
|
if exists('s:debugger')
|
|
|
|
call s:debugger.writeLine(a:line)
|
|
|
|
endif
|
2013-12-23 16:37:18 -05:00
|
|
|
endfunction
|
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Invoke reading for the currently active debugger
|
2013-12-23 16:37:18 -05:00
|
|
|
function! vebugger#invokeReading()
|
2015-02-28 12:16:25 -05:00
|
|
|
if exists('s:debugger')
|
|
|
|
call s:debugger.invokeReading()
|
|
|
|
endif
|
2013-12-23 16:37:18 -05:00
|
|
|
endfunction
|
2013-12-27 16:09:58 -05:00
|
|
|
|
2014-05-17 15:43:18 -04:00
|
|
|
"Fetch the currently active debugger object
|
2013-12-27 16:09:58 -05:00
|
|
|
function! vebugger#getActiveDebugger()
|
2015-02-28 12:16:25 -05:00
|
|
|
if exists('s:debugger')
|
|
|
|
return s:debugger
|
|
|
|
else
|
|
|
|
return {}
|
|
|
|
endif
|
2013-12-28 15:23:33 -05:00
|
|
|
endfunction
|