From 55e37e2fc81df3a0b38f5417caef9119a291297f Mon Sep 17 00:00:00 2001 From: Alessandro Arzilli Date: Wed, 4 May 2022 19:56:41 +0200 Subject: [PATCH] proc/core: return true for calls to Recorded (#2979) The recent refactoring that introduced ContinueOnceContext broke this old behavior. Fixes #2978 --- pkg/proc/core/core.go | 4 +++- pkg/proc/core/core_test.go | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/proc/core/core.go b/pkg/proc/core/core.go index 9bc08998..3efd765b 100644 --- a/pkg/proc/core/core.go +++ b/pkg/proc/core/core.go @@ -248,7 +248,9 @@ func (p *process) WriteBreakpoint(*proc.Breakpoint) error { func (p *process) Recorded() (bool, string) { return true, "" } // Restart will only return an error for core files, as they are not executing. -func (p *process) Restart(string) (proc.Thread, error) { return nil, ErrContinueCore } +func (p *process) Restart(*proc.ContinueOnceContext, string) (proc.Thread, error) { + return nil, ErrContinueCore +} // ChangeDirection will only return an error as you cannot continue a core process. func (p *process) ChangeDirection(proc.Direction) error { return ErrContinueCore } diff --git a/pkg/proc/core/core_test.go b/pkg/proc/core/core_test.go index 25c08826..3a2bfd23 100644 --- a/pkg/proc/core/core_test.go +++ b/pkg/proc/core/core_test.go @@ -257,6 +257,11 @@ func TestCore(t *testing.T) { } p := withCoreFile(t, "panic", "") + recorded, _ := p.Recorded() + if !recorded { + t.Fatalf("expecting recorded to be true") + } + gs, _, err := proc.GoroutinesInfo(p, 0, 0) if err != nil || len(gs) == 0 { t.Fatalf("GoroutinesInfo() = %v, %v; wanted at least one goroutine", gs, err)