commit
c10e27f7c7
@ -26,11 +26,9 @@ function! vebugger#mdbg#start(binaryFile,args)
|
|||||||
if !get(a:args,'noConsole')
|
if !get(a:args,'noConsole')
|
||||||
call l:debugger.writeLine('mode nc on')
|
call l:debugger.writeLine('mode nc on')
|
||||||
endif
|
endif
|
||||||
call l:debugger.writeLine('run '.shellescape(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('s:readProgramOutput'))
|
||||||
call l:debugger.addReadHandler(function('s:readWhere'))
|
call l:debugger.addReadHandler(function('s:readWhere'))
|
||||||
call l:debugger.addReadHandler(function('s:readFinish'))
|
call l:debugger.addReadHandler(function('s:readFinish'))
|
||||||
@ -52,12 +50,29 @@ function! vebugger#mdbg#start(binaryFile,args)
|
|||||||
return l:debugger
|
return l:debugger
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! s:pathToMdbgStyle(path)
|
||||||
|
if has('win32unix')
|
||||||
|
return substitute(system('cygpath -w '.shellescape(a:path)),'\n$','','')
|
||||||
|
else
|
||||||
|
return a:path
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
function! s:pathToVimStyle(path)
|
||||||
|
if has('win32unix')
|
||||||
|
return substitute(system('cygpath -u '.shellescape(a:path)),'\n$','','')
|
||||||
|
else
|
||||||
|
return a:path
|
||||||
|
endif
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! s:findFilePath(src,fileName,methodName)
|
function! s:findFilePath(src,fileName,methodName)
|
||||||
if vebugger#util#isPathAbsolute(a:fileName)
|
let l:fileName = s:pathToVimStyle(a:fileName)
|
||||||
return fnamemodify(a:fileName,':p') "Return the normalized full path
|
if vebugger#util#isPathAbsolute(l:fileName)
|
||||||
|
return fnamemodify(l:fileName,':p') "Return the normalized full path
|
||||||
endif
|
endif
|
||||||
let l:path=fnamemodify(a:src,':p')
|
let l:path=fnamemodify(a:src,':p')
|
||||||
let l:files=glob(l:path.'**/'.a:fileName,0,1)
|
let l:files=glob(l:path.'**/'.l:fileName,0,1)
|
||||||
for l:dirname in split(a:methodName,'\.')
|
for l:dirname in split(a:methodName,'\.')
|
||||||
if empty(l:files)
|
if empty(l:files)
|
||||||
return ''
|
return ''
|
||||||
@ -121,8 +136,8 @@ function! s: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)
|
||||||
call a:debugger.writeLine('break '.fnameescape(l:fullFileName).':'.l:breakpoint.line)
|
call a:debugger.writeLine('break '.s:pathToMdbgStyle(l:fullFileName).':'.l:breakpoint.line)
|
||||||
let a:debugger.state.mdbg.breakpointNumbers[l:fullFileName.':'.l:breakpoint.line]={}
|
let a:debugger.state.mdbg.breakpointNumbers[s:pathToVimStyle(l:fullFileName).':'.l:breakpoint.line]={}
|
||||||
elseif 'remove'==l:breakpoint.action
|
elseif 'remove'==l:breakpoint.action
|
||||||
call a:debugger.writeLine('delete '.a:debugger.state.mdbg.breakpointNumbers[l:fullFileName.':'.l:breakpoint.line].number)
|
call a:debugger.writeLine('delete '.a:debugger.state.mdbg.breakpointNumbers[l:fullFileName.':'.l:breakpoint.line].number)
|
||||||
call remove(a:debugger.state.mdbg.breakpointNumbers,l:fullFileName.':'.l:breakpoint.line)
|
call remove(a:debugger.state.mdbg.breakpointNumbers,l:fullFileName.':'.l:breakpoint.line)
|
||||||
@ -135,7 +150,7 @@ function! s:readBreakpointBound(pipeName,line,readResult,debugger)
|
|||||||
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)
|
||||||
let a:readResult.mdbg.breakpointBound={
|
let a:readResult.mdbg.breakpointBound={
|
||||||
\'fileNameTail':l:matches[3],
|
\'fileNameTail':s:pathToVimStyle(l:matches[3]),
|
||||||
\'line':l:matches[2],
|
\'line':l:matches[2],
|
||||||
\'breakpointNumber':l:matches[1]}
|
\'breakpointNumber':l:matches[1]}
|
||||||
endif
|
endif
|
||||||
|
@ -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.0
|
Version: 1.2.1
|
||||||
|
|
||||||
INTRODUCTION *vebugger*
|
INTRODUCTION *vebugger*
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user