diff --git a/_scripts/rtype-out.txt b/_scripts/rtype-out.txt index dbe473a0..6716f0dc 100644 --- a/_scripts/rtype-out.txt +++ b/_scripts/rtype-out.txt @@ -27,7 +27,7 @@ type g struct { waitsince int64 waitreason waitReason (optional) stack stack - atomicstatus uint32 + atomicstatus anytype } type gobuf struct { diff --git a/pkg/proc/variables.go b/pkg/proc/variables.go index 11e2b2ba..d9d7ae84 100644 --- a/pkg/proc/variables.go +++ b/pkg/proc/variables.go @@ -918,7 +918,21 @@ func (v *Variable) parseG() (*G, error) { } } - status := loadInt64Maybe("atomicstatus") // +rtype uint32 + status := uint64(0) + if atomicStatus := v.loadFieldNamed("atomicstatus"); atomicStatus != nil { + if constant.Val(atomicStatus.Value) != nil { + status, _ = constant.Uint64Val(atomicStatus.Value) + } else { + vv := atomicStatus.fieldVariable("value") + if vv == nil { + unreadable = true + } else { + status, _ = constant.Uint64Val(vv.Value) + } + } + } else { + unreadable = true + } if unreadable { return nil, ErrUnreadableG