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.
This commit is contained in:
parent
283128aeab
commit
4121fb1f96
@ -642,7 +642,14 @@ func (p *Process) StepInstruction() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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 {
|
func (p *Process) SwitchThread(tid int) error {
|
||||||
|
|||||||
@ -316,7 +316,14 @@ func (dbp *Process) StepInstruction() (err error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
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`.
|
// SwitchThread changes from current thread to the thread specified by `tid`.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user