Documentation ¶
Index ¶
- type Field
- type Flags
- type Frame
- type Func
- type Goroutine
- type Kind
- type Object
- type Process
- func (p *Process) Addr(x Object) core.Address
- func (p *Process) BuildVersion() string
- func (p *Process) FindFunc(pc core.Address) *Func
- func (p *Process) FindObject(a core.Address) (Object, int64)
- func (p *Process) ForEachFreeRegion(fn func(core.Address, int64) bool)
- func (p *Process) ForEachObject(fn func(x Object) bool)
- func (p *Process) ForEachPtr(x Object, fn func(int64, Object, int64) bool)
- func (p *Process) ForEachReversePtr(y Object, fn func(x Object, r *Root, i, j int64) bool)
- func (p *Process) ForEachRoot(fn func(r *Root) bool)
- func (p *Process) ForEachRootPtr(r *Root, fn func(int64, Object, int64) bool)
- func (p *Process) Globals() []*Root
- func (p *Process) Goroutines() []*Goroutine
- func (p *Process) IsPtr(a core.Address) bool
- func (p *Process) Process() *core.Process
- func (p *Process) Size(x Object) int64
- func (p *Process) Stats() *Stats
- func (p *Process) Type(x Object) (*Type, int64)
- type Root
- type Stats
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Frame ¶
type Frame struct { // Set of locations that contain a live pointer. Note that this set // may contain locations outside the frame (in particular, the args // for the frame). Live map[core.Address]bool // contains filtered or unexported fields }
func (*Frame) PC ¶
PC returns the program counter of the next instruction to be executed by this frame.
type Func ¶
type Func struct {
// contains filtered or unexported fields
}
type Goroutine ¶
type Goroutine struct {
// contains filtered or unexported fields
}
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
func Core ¶
Core takes a loaded core file and extracts Go information from it. flags is a bitmask of data that should be extracted from the core.
func (*Process) BuildVersion ¶
BuildVersion returns the Go version that was used to build the inferior binary.
func (*Process) FindFunc ¶
FindFunc returns the function which contains the code at address pc, if any.
func (*Process) FindObject ¶
FindObject finds the object containing a. Returns that object and the offset within that object to which a points. Returns 0,0 if a doesn't point to a live heap object.
func (*Process) ForEachFreeRegion ¶
ForEachFreeRegion calls fn with each free region in the Go heap. It calls fn with:
the address of the start of the free region the size of the free region
If fn returns false, ForEachFreeRegion returns immediately. A free region is one which could satisfy an allocation of the reported size or less. Free regions do not include garbage objects (those which aren't reachable, but haven't been noticed as unreachable yet by the runtime).
func (*Process) ForEachObject ¶
ForEachObject calls fn with each object in the Go heap. If fn returns false, ForEachObject returns immediately.
func (*Process) ForEachPtr ¶
ForEachPtr calls fn for all heap pointers it finds in x. It calls fn with:
the offset of the pointer slot in x the pointed-to object y the offset in y where the pointer points.
If fn returns false, ForEachPtr returns immediately. For an edge from an object to its finalizer, the first argument passed to fn will be -1.
func (*Process) ForEachReversePtr ¶
ForEachReversePtr calls fn for all pointers it finds pointing to y. It calls fn with:
the object or root which points to y (exactly one will be non-nil) the offset i in that object or root where the pointer appears. the offset j in y where the pointer points.
If fn returns false, ForEachReversePtr returns immediately. FlagReverse must have been passed to Core when p was constructed.
func (*Process) ForEachRoot ¶
ForEachRoot calls fn with each garbage collection root. If fn returns false, ForEachRoot returns immediately.
func (*Process) ForEachRootPtr ¶
ForEachRootPtr behaves like ForEachPtr but it starts with a Root instead of an Object.
func (*Process) Goroutines ¶
type Root ¶
type Root struct { Name string Addr core.Address Type *Type // Frame, if non-nil, points to the frame in which this root lives. // Roots with non-nil Frame fields should use Frame.Live to filter the live pointers in this Root. Frame *Frame }
A Root is an area of memory that might have pointers into the heap.
type Stats ¶
A Stats struct is the node of a tree representing the entire memory usage of the Go program. Children of a node break its usage down by category. We maintain the invariant that, if there are children, Size == sum(c.Size for c in Children).
type Type ¶
type Type struct { Size int64 Kind Kind // Fields only valid for a subset of kinds. Count int64 // for kind == KindArray Elem *Type // for kind == Kind{Ptr,Array,Slice,String}. nil for unsafe.Pointer. Always uint8 for KindString. Fields []Field // for kind == KindStruct // contains filtered or unexported fields }
A Type is the representation of the type of a Go object.