Versions in this module Expand all Collapse all v1 v1.5.0 Jun 28, 2021 Changes in this version + const FatalThrow + const FloatIsNaN + const FloatIsNegInf + const FloatIsNormal + const FloatIsPosInf + const GNUFlavour + const Gcopystack + const Gdead + const Genqueue + const Gidle + const GmoribundUnused + const GoFlavour + const Grunnable + const Grunning + const Gsyscall + const Gwaiting + const IMAGE_FILE_MACHINE_AM33 + const IMAGE_FILE_MACHINE_AMD64 + const IMAGE_FILE_MACHINE_ARM + const IMAGE_FILE_MACHINE_ARM64 + const IMAGE_FILE_MACHINE_ARMNT + const IMAGE_FILE_MACHINE_EBC + const IMAGE_FILE_MACHINE_I386 + const IMAGE_FILE_MACHINE_IA64 + const IMAGE_FILE_MACHINE_M32R + const IMAGE_FILE_MACHINE_MIPS16 + const IMAGE_FILE_MACHINE_MIPSFPU + const IMAGE_FILE_MACHINE_MIPSFPU16 + const IMAGE_FILE_MACHINE_POWERPC + const IMAGE_FILE_MACHINE_POWERPCFP + const IMAGE_FILE_MACHINE_R4000 + const IMAGE_FILE_MACHINE_SH3 + const IMAGE_FILE_MACHINE_SH3DSP + const IMAGE_FILE_MACHINE_SH4 + const IMAGE_FILE_MACHINE_SH5 + const IMAGE_FILE_MACHINE_THUMB + const IMAGE_FILE_MACHINE_UNKNOWN + const IMAGE_FILE_MACHINE_WCEMIPSV2 + const IntelFlavour + const STT_FUNC + const UnrecoveredPanic + const VariableArgument + const VariableConstant + const VariableEscaped + const VariableFakeAddress + const VariableReturnArgument + const VariableShadowed + var ErrCouldNotDetermineRelocation = errors.New("could not determine the base address of a PIE") + var ErrNoDebugInfoFound = errors.New("could not open debug info") + var ErrNoRuntimeAllG = errors.New("could not find goroutine array") + var ErrNotRecorded = errors.New("not a recording") + var ErrProcessDetached = errors.New("detached from the process") + var ErrUnknownRegister = errors.New("unknown register") + var ErrUnreadableG = errors.New("could not read G struct") + var PEMachineString = map[uint16]string + func DisableAsyncPreemptEnv() []string + func EvalExpressionWithCalls(t *Target, g *G, expr string, retLoadCfg LoadConfig, checkEscape bool) error + func FindDeferReturnCalls(text []AsmInstruction) []uint64 + func FindFileLocation(p Process, fileName string, lineno int) ([]uint64, error) + func FindFunctionLocation(p Process, funcName string, lineOffset int) ([]uint64, error) + func FirstPCAfterPrologue(p Process, fn *Function, sameline bool) (uint64, error) + type Ancestor struct + ID int64 + Unreadable error + func Ancestors(p Process, g *G, n int) ([]Ancestor, error) + func (a *Ancestor) Stack(n int) ([]Stackframe, error) + type Arch struct + DwarfRegisterToString func(int, *op.DwarfRegister) (string, bool, string) + Name string + RegistersToDwarfRegisters func(uint64, Registers) op.DwarfRegisters + func AMD64Arch(goos string) *Arch + func ARM64Arch(goos string) *Arch + func I386Arch(goos string) *Arch + func (a *Arch) BreakInstrMovesPC() bool + func (a *Arch) BreakpointInstruction() []byte + func (a *Arch) BreakpointSize() int + func (a *Arch) DerefTLS() bool + func (a *Arch) MaxInstructionLength() int + func (a *Arch) Prologues() []opcodeSeq + func (a *Arch) PtrSize() int + type AsmInstruction struct + AtPC bool + Breakpoint bool + Bytes []byte + DestLoc *Location + Inst archInst + Kind AsmInstructionKind + Loc Location + Size int + func Disassemble(mem MemoryReadWriter, regs Registers, breakpoints *BreakpointMap, ...) ([]AsmInstruction, error) + func (inst *AsmInstruction) Text(flavour AssemblyFlavour, bi *BinaryInfo) string + func (instr *AsmInstruction) IsCall() bool + func (instr *AsmInstruction) IsJmp() bool + func (instr *AsmInstruction) IsRet() bool + type AsmInstructionKind uint8 + const CallInstruction + const JmpInstruction + const OtherInstruction + const RetInstruction + type AssemblyFlavour int + type BinaryInfo struct + Arch *Arch + ElfDynamicSection ElfDynamicSection + Functions []Function + GOOS string + Images []*Image + LookupFunc map[string]*Function + PackageMap map[string][]string + Sources []string + SymNames map[uint64]*elf.Symbol + func NewBinaryInfo(goos, goarch string) *BinaryInfo + func (bi *BinaryInfo) AddImage(path string, addr uint64) error + func (bi *BinaryInfo) AllPCsForFileLines(filename string, linenos []int) map[int][]uint64 + func (bi *BinaryInfo) Close() error + func (bi *BinaryInfo) GStructOffset() uint64 + func (bi *BinaryInfo) LastModified() time.Time + func (bi *BinaryInfo) LineToPC(filename string, lineno int) (pcs []uint64, err error) + func (bi *BinaryInfo) ListPackagesBuildInfo(includeFiles bool) []*PackageBuildInfo + func (bi *BinaryInfo) LoadBinaryInfo(path string, entryPoint uint64, debugInfoDirs []string) error + func (bi *BinaryInfo) LoadImageFromData(dwdata *dwarf.Data, debugFrameBytes, debugLineBytes, debugLocBytes []byte) + func (bi *BinaryInfo) Location(entry godwarf.Entry, attr dwarf.Attr, pc uint64, regs op.DwarfRegisters) (int64, []op.Piece, *locationExpr, error) + func (bi *BinaryInfo) LocationCovers(entry *dwarf.Entry, attr dwarf.Attr) ([][2]uint64, error) + func (bi *BinaryInfo) PCToFunc(pc uint64) *Function + func (bi *BinaryInfo) PCToImage(pc uint64) *Image + func (bi *BinaryInfo) PCToInlineFunc(pc uint64) *Function + func (bi *BinaryInfo) PCToLine(pc uint64) (string, int, *Function) + func (bi *BinaryInfo) Producer() string + func (bi *BinaryInfo) Types() ([]string, error) + type Breakpoint struct + Addr uint64 + Cond ast.Expr + DeferReturns []uint64 + File string + FunctionName string + Goroutine bool + HitCount map[int]uint64 + Kind BreakpointKind + Line int + LoadArgs *LoadConfig + LoadLocals *LoadConfig + LogicalID int + Name string + OriginalData []byte + Stacktrace int + TotalHitCount uint64 + TraceReturn bool + Tracepoint bool + Variables []string + func (bp *Breakpoint) CheckCondition(thread Thread) BreakpointState + func (bp *Breakpoint) IsInternal() bool + func (bp *Breakpoint) IsUser() bool + func (bp *Breakpoint) String() string + type BreakpointExistsError struct + Addr uint64 + File string + Line int + func (bpe BreakpointExistsError) Error() string + type BreakpointKind uint16 + const NextBreakpoint + const NextDeferBreakpoint + const StepBreakpoint + const UserBreakpoint + type BreakpointManipulation interface + Breakpoints func() *BreakpointMap + ClearBreakpoint func(addr uint64) (*Breakpoint, error) + ClearInternalBreakpoints func() error + SetBreakpoint func(addr uint64, kind BreakpointKind, cond ast.Expr) (*Breakpoint, error) + type BreakpointMap struct + M map[uint64]*Breakpoint + func NewBreakpointMap() BreakpointMap + func (bpmap *BreakpointMap) Clear(addr uint64, clearBreakpoint clearBreakpointFn) (*Breakpoint, error) + func (bpmap *BreakpointMap) ClearInternalBreakpoints(clearBreakpoint clearBreakpointFn) error + func (bpmap *BreakpointMap) HasInternalBreakpoints() bool + func (bpmap *BreakpointMap) ResetBreakpointIDCounter() + func (bpmap *BreakpointMap) Set(addr uint64, kind BreakpointKind, cond ast.Expr, ...) (*Breakpoint, error) + func (bpmap *BreakpointMap) SetWithID(id int, addr uint64, writeBreakpoint WriteBreakpointFn) (*Breakpoint, error) + type BreakpointState struct + Active bool + CondError error + Internal bool + func (bpstate *BreakpointState) Clear() + func (bpstate *BreakpointState) String() string + type Checkpoint struct + ID int + When string + Where string + type CommonThread struct + func (t *CommonThread) ReturnValues(cfg LoadConfig) []*Variable + type CpuArch interface + String func() string + type Defer struct + DeferPC uint64 + DeferredPC uint64 + SP uint64 + Unreadable error + func (d *Defer) EvalScope(thread Thread) (*EvalScope, error) + func (d *Defer) Next() *Defer + type Direction int8 + const Backward + const Forward + type ElfDynamicSection struct + Addr uint64 + Size uint64 + type ErrCouldNotFindLine struct + func (err *ErrCouldNotFindLine) Error() string + type ErrFunctionNotFound struct + FuncName string + func (err *ErrFunctionNotFound) Error() string + type ErrNoBuildIDNote struct + func (e *ErrNoBuildIDNote) Error() string + type ErrNoGoroutine struct + func (ng ErrNoGoroutine) Error() string + type ErrNoSourceForPC struct + func (err *ErrNoSourceForPC) Error() string + type ErrProcessExited struct + Pid int + Status int + func (pe ErrProcessExited) Error() string + type ErrThreadBlocked struct + func (tbe ErrThreadBlocked) Error() string + type ErrUnsupportedArch struct + func (e *ErrUnsupportedArch) Error() string + type EvalScope struct + BinInfo *BinaryInfo + Mem MemoryReadWriter + Regs op.DwarfRegisters + func ConvertEvalScope(dbp *Target, gid, frame, deferCall int) (*EvalScope, error) + func FrameToScope(bi *BinaryInfo, thread MemoryReadWriter, g *G, frames ...Stackframe) *EvalScope + func GoroutineScope(thread Thread) (*EvalScope, error) + func ThreadScope(thread Thread) (*EvalScope, error) + func (scope *EvalScope) DwarfReader() *reader.Reader + func (scope *EvalScope) EvalExpression(expr string, cfg LoadConfig) (*Variable, error) + func (scope *EvalScope) EvalVariable(name string, cfg LoadConfig) (*Variable, error) + func (scope *EvalScope) FunctionArguments(cfg LoadConfig) ([]*Variable, error) + func (scope *EvalScope) LocalVariables(cfg LoadConfig) ([]*Variable, error) + func (scope *EvalScope) Locals() ([]*Variable, error) + func (scope *EvalScope) PackageVariables(cfg LoadConfig) ([]*Variable, error) + func (scope *EvalScope) PtrSize() int + func (scope *EvalScope) SetVariable(name, value string) error + type Function struct + End uint64 + Entry uint64 + InlinedCalls []InlinedCall + Name string + func (fn *Function) BaseName() string + func (fn *Function) Optimized() bool + func (fn *Function) PackageName() string + func (fn *Function) PrologueEndPC() uint64 + func (fn *Function) ReceiverName() string + type G struct + BP uint64 + CurrentLoc Location + GoPC uint64 + ID int + LR uint64 + PC uint64 + SP uint64 + StartPC uint64 + Status uint64 + SystemStack bool + Thread Thread + Unreadable error + func FindGoroutine(dbp *Target, gid int) (*G, error) + func GetG(thread Thread) (*G, error) + func GoroutinesInfo(dbp *Target, start, count int) ([]*G, int, error) + func (g *G) Defer() *Defer + func (g *G) Go() Location + func (g *G) Labels() map[string]string + func (g *G) Stacktrace(depth int, opts StacktraceOptions) ([]Stackframe, error) + func (g *G) StartLoc() Location + func (g *G) UserCurrent() Location + type Image struct + Path string + StaticBase uint64 + func (image *Image) Close() error + func (image *Image) LoadError() error + func (image *Image) Type(offset dwarf.Offset) (godwarf.Type, error) + func (so *Image) DwarfReader() *reader.Reader + type Info interface + BinInfo func() *BinaryInfo + EntryPoint func() (uint64, error) + Pid func() int + ResumeNotify func(chan<- struct{}) + Valid func() (bool, error) + type InlinedCall struct + HighPC uint64 + LowPC uint64 + type InvalidAddressError struct + Address uint64 + func (iae InvalidAddressError) Error() string + type IsNilErr struct + func (err *IsNilErr) Error() string + type LoadConfig struct + FollowPointers bool + MaxArrayValues int + MaxMapBuckets int + MaxStringLen int + MaxStructFields int + MaxVariableRecurse int + type Location struct + File string + Fn *Function + Line int + PC uint64 + type MemoryReadWriter interface + WriteMemory func(addr uintptr, data []byte) (written int, err error) + func DereferenceMemory(mem MemoryReadWriter) MemoryReadWriter + type MemoryReader interface + ReadMemory func(buf []byte, addr uintptr) (n int, err error) + type NewTargetConfig struct + DebugInfoDirs []string + DisableAsyncPreempt bool + Path string + StopReason StopReason + WriteBreakpoint WriteBreakpointFn + type NoBreakpointError struct + Addr uint64 + func (nbp NoBreakpointError) Error() string + type NullAddrError struct + func (n NullAddrError) Error() string + type PEMachine uint16 + func (m PEMachine) String() string + type PackageBuildInfo struct + DirectoryPath string + Files map[string]struct{} + ImportPath string + type Process interface + type ProcessInternal interface + ContinueOnce func() (trapthread Thread, stopReason StopReason, err error) + Detach func(bool) error + Restart func(pos string) error + SetCurrentThread func(Thread) + type ProcessManipulation interface + CheckAndClearManualStopRequest func() bool + RequestManualStop func() error + type RecordingManipulation interface + ChangeDirection func(Direction) error + Checkpoint func(where string) (id int, err error) + Checkpoints func() ([]Checkpoint, error) + ClearCheckpoint func(id int) error + GetDirection func() Direction + Recorded func() (recorded bool, tracedir string) + When func() (string, error) + type Register struct + Name string + Reg *op.DwarfRegister + func AppendBytesRegister(regs []Register, name string, value []byte) []Register + func AppendUint64Register(regs []Register, name string, value uint64) []Register + type Registers interface + BP func() uint64 + Copy func() (Registers, error) + GAddr func() (uint64, bool) + Get func(int) (uint64, error) + PC func() uint64 + SP func() uint64 + Slice func(floatingPoint bool) ([]Register, error) + TLS func() uint64 + type Stackframe struct + Bottom bool + Call Location + Current Location + Defers []*Defer + Err error + Inlined bool + Regs op.DwarfRegisters + Ret uint64 + SystemStack bool + TopmostDefer *Defer + func ThreadStacktrace(thread Thread, depth int) ([]Stackframe, error) + func (frame *Stackframe) FrameOffset() int64 + func (frame *Stackframe) FramePointerOffset() int64 + type StacktraceOptions uint16 + const StacktraceG + const StacktraceReadDefers + const StacktraceSimple + type StopReason uint8 + const StopAttached + const StopBreakpoint + const StopCallReturned + const StopExited + const StopHardcodedBreakpoint + const StopLaunched + const StopManual + const StopNextFinished + const StopUnknown + type Target struct + StopReason StopReason + func NewTarget(p Process, cfg NewTargetConfig) (*Target, error) + func (dbp *Target) Continue() error + func (dbp *Target) Next() (err error) + func (dbp *Target) Step() (err error) + func (dbp *Target) StepInstruction() (err error) + func (dbp *Target) StepOut() error + func (p *Target) SwitchGoroutine(g *G) error + func (p *Target) SwitchThread(tid int) error + func (t *Target) ClearAllGCache() + func (t *Target) Detach(kill bool) error + func (t *Target) Restart(from string) error + func (t *Target) SelectedGoroutine() *G + func (t *Target) SupportsFunctionCalls() bool + type Thread interface + BinInfo func() *BinaryInfo + Blocked func() bool + Breakpoint func() *BreakpointState + Common func() *CommonThread + Location func() (*Location, error) + Registers func() (Registers, error) + RestoreRegisters func(Registers) error + SetCurrentBreakpoint func(adjustPC bool) error + SetDX func(uint64) error + SetPC func(uint64) error + SetSP func(uint64) error + StepInstruction func() error + ThreadID func() int + type ThreadInfo interface + CurrentThread func() Thread + FindThread func(threadID int) (Thread, bool) + ThreadList func() []Thread + type Variable struct + Addr uintptr + Base uintptr + Cap int64 + Children []Variable + DeclLine int64 + DwarfType godwarf.Type + Flags variableFlags + FloatSpecial floatSpecial + Kind reflect.Kind + Len int64 + LocationExpr *locationExpr + Name string + OnlyAddr bool + RealType godwarf.Type + Unreadable error + Value constant.Value + func (v *Variable) ConstDescr() string + func (v *Variable) TypeString() string + type WriteBreakpointFn func(addr uint64) (file string, line int, fn *Function, originalData []byte, err error)