diff --git a/pkg/proc/eval.go b/pkg/proc/eval.go index 8baae9ea1c..f3e83e9ede 100644 --- a/pkg/proc/eval.go +++ b/pkg/proc/eval.go @@ -966,10 +966,9 @@ func (stack *evalStack) executeOp() { var vars []*Variable var err error if op.Frame != 0 { - var frameScope *EvalScope - frameScope, err = ConvertEvalScope(scope.target, scope.g.ID, int(op.Frame), 0) - if err != nil { - stack.err = err + frameScope, err2 := ConvertEvalScope(scope.target, -1, int(op.Frame), 0) + if err2 != nil { + stack.err = err2 return } vars, err = frameScope.Locals(0) diff --git a/pkg/proc/target_exec.go b/pkg/proc/target_exec.go index 2e3f4748d4..29fc6e50c6 100644 --- a/pkg/proc/target_exec.go +++ b/pkg/proc/target_exec.go @@ -97,11 +97,18 @@ func (grp *TargetGroup) Continue() error { it := ValidTargets{Group: grp} for it.Next() { + // Both selectedGoroutine and current thread are stale here, since we can + // only set their definitive value *after* evaluating breakpoint + // conditions here we give them temporary non-stale values. + it.selectedGoroutine = nil + curthread := it.currentThread for _, thread := range it.ThreadList() { if thread.Breakpoint().Breakpoint != nil { + it.currentThread = thread thread.Breakpoint().Breakpoint.checkCondition(it.Target, thread, thread.Breakpoint()) } } + it.currentThread = curthread } if contOnceErr != nil {