From b0a6dacc1c3d7aa57776079bcea01f78c7b90dce Mon Sep 17 00:00:00 2001 From: Konstantin Shaposhnikov Date: Wed, 28 Oct 2015 20:17:37 +0800 Subject: [PATCH] proc: handle rename of runtime.allg to runtime.allgs Use runtime.allgs instead of runtime.allg that has been removed in https://github.com/golang/go/commit/5a68eb9f25a2a6290800278df972e04a4085cee3 --- proc/proc.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/proc/proc.go b/proc/proc.go index d27e12f0..4edc951d 100644 --- a/proc/proc.go +++ b/proc/proc.go @@ -470,9 +470,13 @@ func (dbp *Process) GoroutinesInfo() ([]*G, error) { allglen := binary.LittleEndian.Uint64(allglenBytes) rdr.Seek(0) - allgentryaddr, err := rdr.AddrFor("runtime.allg") + allgentryaddr, err := rdr.AddrFor("runtime.allgs") if err != nil { - return nil, err + // try old name (pre Go 1.6) + allgentryaddr, err = rdr.AddrFor("runtime.allg") + if err != nil { + return nil, err + } } faddr, err := dbp.CurrentThread.readMemory(uintptr(allgentryaddr), dbp.arch.PtrSize()) allgptr := binary.LittleEndian.Uint64(faddr) -- GitLab