mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 09:46:56 +08:00
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:
@ -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)
|
||||
|
||||
Reference in New Issue
Block a user