pkg/terminal: clear erroneous name setting on postfix if (#3702)

When a breakpoint was set on the current line via `break if i ==3` style
condition setting, we would erroneously set the breakpoint name to be
'if'.
This commit is contained in:
Derek Parker
2024-04-15 01:07:36 -07:00
committed by GitHub
parent 2e88b7ead3
commit 6d3556784d
2 changed files with 11 additions and 2 deletions

View File

@ -1858,6 +1858,7 @@ func setBreakpoint(t *Term, ctx callContext, tracepoint bool, argstr string) ([]
if findLocErr != nil {
r := regexp.MustCompile(`^if | if `)
if match := r.FindStringIndex(argstr); match != nil {
requestedBp.Name = ""
cond = argstr[match[1]:]
argstr = argstr[:match[0]]
args = config.Split2PartsBySpace(argstr)