diff --git a/pkg/proc/proc.go b/pkg/proc/proc.go index baf1d04936ae4a2cda538f3d0a4194e5ea5dea51..6618cab4976f45945dfe4e394272099cd7e1a1cb 100644 --- a/pkg/proc/proc.go +++ b/pkg/proc/proc.go @@ -220,7 +220,7 @@ func Step(dbp Process) (err error) { if err = next(dbp, true); err != nil { switch err.(type) { - case ThreadBlockedError, NoReturnAddr: // Noop + case ThreadBlockedError: // Noop default: dbp.ClearInternalBreakpoints() return diff --git a/pkg/proc/proc_test.go b/pkg/proc/proc_test.go index 559aafa97e80b7eb29eb60febbf1b8fd797c913c..362cc9d340a79f2b3ba93aa8fe2a978fa8f37899 100644 --- a/pkg/proc/proc_test.go +++ b/pkg/proc/proc_test.go @@ -676,7 +676,7 @@ func returnAddress(thread proc.Thread) (uint64, error) { return 0, err } if len(locations) < 2 { - return 0, proc.NoReturnAddr{locations[0].Current.Fn.BaseName()} + return 0, fmt.Errorf("no return address for function: %s", locations[0].Current.Fn.BaseName()) } return locations[1].Current.PC, nil } diff --git a/pkg/proc/stack.go b/pkg/proc/stack.go index a764348c5c079380349453b5e23821968198d4b1..eb27bdd446cb94a2189eb140ccc9486fa22da568 100644 --- a/pkg/proc/stack.go +++ b/pkg/proc/stack.go @@ -13,16 +13,6 @@ import ( // This code is partly adaped from runtime.gentraceback in // $GOROOT/src/runtime/traceback.go -// NoReturnAddr is returned when return address -// could not be found during stack trace. -type NoReturnAddr struct { - Fn string -} - -func (nra NoReturnAddr) Error() string { - return fmt.Sprintf("could not find return address for %s", nra.Fn) -} - // Stackframe represents a frame in a system stack. type Stackframe struct { // Address the function above this one on the call stack will return to. diff --git a/pkg/proc/variables.go b/pkg/proc/variables.go index 6d71e142495c151f1f345e2a3be05f29d2640d8d..c559c7ec73868545f49e59e5fe10a412b8c24925 100644 --- a/pkg/proc/variables.go +++ b/pkg/proc/variables.go @@ -360,12 +360,6 @@ func (scope *EvalScope) PtrSize() int { return scope.BinInfo.Arch.PtrSize() } -// ChanRecvBlocked returns whether the goroutine is blocked on -// a channel read operation. -func (g *G) ChanRecvBlocked() bool { - return (g.Thread == nil) && (g.WaitReason == chanRecv) -} - // NoGError returned when a G could not be found // for a specific thread. type NoGError struct {