mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
runtime(termdebug): quote filename arguments using double quotes
closes: #15270 Signed-off-by: Ubaldo Tiberi <ubaldo.tiberi@google.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
parent
1724ddbe3a
commit
27f53346a3
@ -1325,6 +1325,11 @@ def DeleteCommands()
|
|||||||
sign_undefine(BreakpointSigns->map("'debugBreakpoint' .. v:val"))
|
sign_undefine(BreakpointSigns->map("'debugBreakpoint' .. v:val"))
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def QuoteArg(x: string): string
|
||||||
|
# Find all the occurrences of " and \ and escape them and double quote
|
||||||
|
# the resulting string.
|
||||||
|
return printf('"%s"', x ->substitute('[\\"]', '\\&', 'g'))
|
||||||
|
enddef
|
||||||
|
|
||||||
# :Until - Execute until past a specified position or current line
|
# :Until - Execute until past a specified position or current line
|
||||||
def Until(at: string)
|
def Until(at: string)
|
||||||
@ -1335,7 +1340,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) ? $"\"{expand('%:p')}:{line('.')}\"" : at
|
var AT = empty(at) ? QuoteArg($"{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')
|
||||||
@ -1354,7 +1359,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) ? $"\"{expand('%:p')}:{line('.')}\"" : at
|
var AT = empty(at) ? QuoteArg($"{expand('%:p')}:{line('.')}") : at
|
||||||
var cmd = ''
|
var cmd = ''
|
||||||
if tbreak
|
if tbreak
|
||||||
cmd = $'-break-insert -t {AT}'
|
cmd = $'-break-insert -t {AT}'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user