1
0
forked from aniani/vim

runtime(termdebug): fix a few issues

Fix a few minor issues:
1. filename with whitespaces issue should be fixed now, fixes: #12357
2. ":Termdebug args" should work now, fixes: #15254

closes: #15261

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com>
This commit is contained in:
Ubaldo Tiberi 2024-07-14 16:58:32 +02:00 committed by Christian Brabandt
parent bb5d27dc79
commit c3837a46ff
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -522,7 +522,7 @@ def CreateGdbConsole(dict: dict<any>, pty: string, commpty: string): string
# ---- gdb started. Next, let's set the MI interface. --- # ---- gdb started. Next, let's set the MI interface. ---
# Set arguments to be run. # Set arguments to be run.
if len(proc_args) if !empty(proc_args)
term_sendkeys(gdbbufnr, $"server set args {join(proc_args)}\r") term_sendkeys(gdbbufnr, $"server set args {join(proc_args)}\r")
endif endif
@ -1321,12 +1321,8 @@ def DeleteCommands()
endif endif
sign_unplace('TermDebug') sign_unplace('TermDebug')
breakpoints = {}
breakpoint_locations = {}
sign_undefine('debugPC') sign_undefine('debugPC')
sign_undefine(BreakpointSigns->map("'debugBreakpoint' .. v:val")) sign_undefine(BreakpointSigns->map("'debugBreakpoint' .. v:val"))
BreakpointSigns = []
enddef enddef
@ -1339,7 +1335,7 @@ def Until(at: string)
ch_log('assume that program is running after this command') ch_log('assume that program is running after this command')
# Use the fname:lnum format # Use the fname:lnum format
var AT = empty(at) ? $"{fnameescape(expand('%:p'))}:{line('.')}" : at var AT = empty(at) ? $"\"{expand('%:p')}:{line('.')}\"" : at
SendCommand($'-exec-until {AT}') SendCommand($'-exec-until {AT}')
else else
ch_log('dropping command, program is running: exec-until') ch_log('dropping command, program is running: exec-until')
@ -1358,7 +1354,7 @@ def SetBreakpoint(at: string, tbreak=false)
endif endif
# Use the fname:lnum format, older gdb can't handle --source. # Use the fname:lnum format, older gdb can't handle --source.
var AT = empty(at) ? $"{fnameescape(expand('%:p'))}:{line('.')}" : at var AT = empty(at) ? $"\"{expand('%:p')}:{line('.')}\"" : at
var cmd = '' var cmd = ''
if tbreak if tbreak
cmd = $'-break-insert -t {AT}' cmd = $'-break-insert -t {AT}'