File tree Expand file tree Collapse file tree
runtime/pack/dist/opt/termdebug/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1325,6 +1325,11 @@ def DeleteCommands()
13251325 sign_undefine (BreakpointSigns- >map (" 'debugBreakpoint' .. v:val" ))
13261326enddef
13271327
1328+ def QuoteArg (x : string ): string
1329+ # Find all the occurrences of " and \ and escape them and double quote
1330+ # the resulting string .
1331+ return printf (' "%s"' , x - >substitute (' [\\"]' , ' \\&' , ' g' ))
1332+ enddef
13281333
13291334# :Until - Execute until past a specified position or current line
13301335def Until (at: string )
@@ -1335,7 +1340,7 @@ def Until(at: string)
13351340 ch_log (' assume that program is running after this command' )
13361341
13371342 # Use the fname:lnum format
1338- var AT = empty (at) ? $ " \" {expand('%:p')}:{line('.')}\" " : at
1343+ var AT = empty (at) ? QuoteArg ( $ " {expand('%:p')}:{line('.')}" ) : at
13391344 SendCommand ($ ' -exec-until {AT}' )
13401345 else
13411346 ch_log (' dropping command, program is running: exec-until' )
@@ -1354,7 +1359,7 @@ def SetBreakpoint(at: string, tbreak=false)
13541359 endif
13551360
13561361 # Use the fname:lnum format, older gdb can't handle -- source .
1357- var AT = empty (at) ? $ " \" {expand('%:p')}:{line('.')}\" " : at
1362+ var AT = empty (at) ? QuoteArg ( $ " {expand('%:p')}:{line('.')}" ) : at
13581363 var cmd = ' '
13591364 if tbreak
13601365 cmd = $ ' -break-insert -t {AT}'
You can’t perform that action at this time.
0 commit comments