提交 4121fb1f 编写于 作者: A aarzilli 提交者: Derek Parker

proc/native,proc/gdbserial: set selectedGoroutine after StepInstruction

When stepping through runtime sometimes the current goroutine will
change. It is impossible to handle this in Next, Step and StepOut but
StepInstruction can reset the current goroutine correctly.
上级 283128ae
......@@ -642,7 +642,14 @@ func (p *Process) StepInstruction() error {
if err != nil {
return err
}
return thread.SetCurrentBreakpoint()
err = thread.SetCurrentBreakpoint()
if err != nil {
return err
}
if g, _ := proc.GetG(thread); g != nil {
p.selectedGoroutine = g
}
return nil
}
func (p *Process) SwitchThread(tid int) error {
......
......@@ -316,7 +316,14 @@ func (dbp *Process) StepInstruction() (err error) {
if err != nil {
return err
}
return thread.SetCurrentBreakpoint()
err = thread.SetCurrentBreakpoint()
if err != nil {
return err
}
if g, _ := proc.GetG(thread); g != nil {
dbp.selectedGoroutine = g
}
return nil
}
// SwitchThread changes from current thread to the thread specified by `tid`.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册