diff --git a/pkg/proc/proc_test.go b/pkg/proc/proc_test.go index c83bde52732c545b5b9b33aae948a64625d8969b..2c6ff9959490f75c00d75a62fbac369df57cbee3 100644 --- a/pkg/proc/proc_test.go +++ b/pkg/proc/proc_test.go @@ -1861,13 +1861,23 @@ func TestStepParked(t *testing.T) { assertNoError(err, t, "GoroutinesInfo()") for _, g := range gs { - if g.thread == nil { + if g.thread == nil && g.CurrentLoc.Fn != nil && g.CurrentLoc.Fn.Name == "main.sayhi" { parkedg = g break LookForParkedG } } } + t.Logf("Parked g is: %v\n", parkedg) + frames, _ := parkedg.Stacktrace(20) + for _, frame := range frames { + name := "" + if frame.Call.Fn != nil { + name = frame.Call.Fn.Name + } + t.Logf("\t%s:%d in %s (%#x)", frame.Call.File, frame.Call.Line, name, frame.Current.PC) + } + assertNoError(p.SwitchGoroutine(parkedg.ID), t, "SwitchGoroutine()") p.ClearBreakpoint(bp.Addr) assertNoError(p.Step(), t, "Step()")