forked from aniani/vim
patch 8.1.0089: error when ending the terminal debugger
Problem: error when ending the terminal debugger Solution: Fix deleting defined signs for breakpoints. Make the debugger work better on MS-Windows.
This commit is contained in:
parent
5319191a2a
commit
a15b0a936d
@ -408,7 +408,7 @@ func s:GdbOutCallback(channel, text)
|
|||||||
|
|
||||||
" Drop the gdb prompt, we have our own.
|
" Drop the gdb prompt, we have our own.
|
||||||
" Drop status and echo'd commands.
|
" Drop status and echo'd commands.
|
||||||
if a:text == '(gdb) ' || a:text == '^done' || a:text[0] == '&' || a:text[0] == '='
|
if a:text == '(gdb) ' || a:text == '^done' || a:text[0] == '&'
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
if a:text =~ '^^error,msg='
|
if a:text =~ '^^error,msg='
|
||||||
@ -439,7 +439,7 @@ endfunc
|
|||||||
" to the next ", unescaping characters.
|
" to the next ", unescaping characters.
|
||||||
func s:DecodeMessage(quotedText)
|
func s:DecodeMessage(quotedText)
|
||||||
if a:quotedText[0] != '"'
|
if a:quotedText[0] != '"'
|
||||||
echoerr 'DecodeMessage(): missing quote'
|
echoerr 'DecodeMessage(): missing quote in ' . a:quotedText
|
||||||
return
|
return
|
||||||
endif
|
endif
|
||||||
let result = ''
|
let result = ''
|
||||||
@ -459,6 +459,16 @@ func s:DecodeMessage(quotedText)
|
|||||||
return result
|
return result
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
" Extract the "name" value from a gdb message with fullname="name".
|
||||||
|
func s:GetFullname(msg)
|
||||||
|
let name = s:DecodeMessage(substitute(a:msg, '.*fullname=', '', ''))
|
||||||
|
if has('win32') && name =~ ':\\\\'
|
||||||
|
" sometimes the name arrives double-escaped
|
||||||
|
let name = substitute(name, '\\\\', '\\', 'g')
|
||||||
|
endif
|
||||||
|
return name
|
||||||
|
endfunc
|
||||||
|
|
||||||
func s:EndTermDebug(job, status)
|
func s:EndTermDebug(job, status)
|
||||||
exe 'bwipe! ' . s:commbuf
|
exe 'bwipe! ' . s:commbuf
|
||||||
unlet s:gdbwin
|
unlet s:gdbwin
|
||||||
@ -639,9 +649,13 @@ func s:DeleteCommands()
|
|||||||
for key in keys(s:breakpoints)
|
for key in keys(s:breakpoints)
|
||||||
exe 'sign unplace ' . (s:break_id + key)
|
exe 'sign unplace ' . (s:break_id + key)
|
||||||
endfor
|
endfor
|
||||||
sign undefine debugPC
|
|
||||||
sign undefine debugBreakpoint
|
|
||||||
unlet s:breakpoints
|
unlet s:breakpoints
|
||||||
|
|
||||||
|
sign undefine debugPC
|
||||||
|
for val in s:BreakpointSigns
|
||||||
|
exe "sign undefine debugBreakpoint" . val
|
||||||
|
endfor
|
||||||
|
unlet s:BreakpointSigns
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
" :Break - Set a breakpoint at the cursor position.
|
" :Break - Set a breakpoint at the cursor position.
|
||||||
@ -660,8 +674,9 @@ func s:SetBreakpoint()
|
|||||||
endif
|
endif
|
||||||
sleep 10m
|
sleep 10m
|
||||||
endif
|
endif
|
||||||
call s:SendCommand('-break-insert --source '
|
" Use the fname:lnum format, older gdb can't handle --source.
|
||||||
\ . fnameescape(expand('%:p')) . ' --line ' . line('.'))
|
call s:SendCommand('-break-insert '
|
||||||
|
\ . fnameescape(expand('%:p')) . ':' . line('.'))
|
||||||
if do_continue
|
if do_continue
|
||||||
call s:SendCommand('-exec-continue')
|
call s:SendCommand('-exec-continue')
|
||||||
endif
|
endif
|
||||||
@ -790,7 +805,11 @@ func s:HandleCursor(msg)
|
|||||||
|
|
||||||
call s:GotoSourcewinOrCreateIt()
|
call s:GotoSourcewinOrCreateIt()
|
||||||
|
|
||||||
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
|
if a:msg =~ 'fullname='
|
||||||
|
let fname = s:GetFullname(a:msg)
|
||||||
|
else
|
||||||
|
let fname = ''
|
||||||
|
endif
|
||||||
if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname)
|
if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname)
|
||||||
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
||||||
if lnum =~ '^[0-9]*$'
|
if lnum =~ '^[0-9]*$'
|
||||||
@ -816,13 +835,12 @@ func s:HandleCursor(msg)
|
|||||||
call win_gotoid(wid)
|
call win_gotoid(wid)
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
|
let s:BreakpointSigns = []
|
||||||
|
|
||||||
func s:CreateBreakpoint(nr)
|
func s:CreateBreakpoint(nr)
|
||||||
if !exists("s:BreakpointSigns")
|
|
||||||
let s:BreakpointSigns = []
|
|
||||||
endif
|
|
||||||
if index(s:BreakpointSigns, a:nr) == -1
|
if index(s:BreakpointSigns, a:nr) == -1
|
||||||
call add(s:BreakpointSigns, a:nr)
|
call add(s:BreakpointSigns, a:nr)
|
||||||
exe "sign define debugBreakpoint". a:nr . " text=" . a:nr . " texthl=debugBreakpoint"
|
exe "sign define debugBreakpoint" . a:nr . " text=" . a:nr . " texthl=debugBreakpoint"
|
||||||
endif
|
endif
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
@ -842,7 +860,7 @@ func s:HandleNewBreakpoint(msg)
|
|||||||
let s:breakpoints[nr] = entry
|
let s:breakpoints[nr] = entry
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
|
let fname = s:GetFullname(a:msg)
|
||||||
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
|
||||||
let entry['fname'] = fname
|
let entry['fname'] = fname
|
||||||
let entry['lnum'] = lnum
|
let entry['lnum'] = lnum
|
||||||
|
@ -761,6 +761,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
89,
|
||||||
/**/
|
/**/
|
||||||
88,
|
88,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user