Versions in this module Expand all Collapse all v0 v0.0.1 Oct 27, 2024 Changes in this version + const FakeAddressBase + const FatalThrow + const FloatIsNaN + const FloatIsNegInf + const FloatIsNormal + const FloatIsPosInf + const Gcopystack + const Gdead + const Genqueue + const Gidle + const GmoribundUnused + const Grunnable + const Grunning + const Gsyscall + const Gwaiting + const HardcodedBreakpoint + const NoLogicalID + const UnrecoveredPanic + const VariableArgument + const VariableCPURegister + const VariableCPtr + const VariableConstant + const VariableEscaped + const VariableFakeAddress + const VariableReturnArgument + const VariableShadowed + var ErrCouldNotDetermineRelocation = errors.New("could not determine the base address of a PIE") + var ErrHWBreakUnsupported = errors.New("hardware breakpoints not implemented") + var ErrMemoryMapNotSupported = errors.New("MemoryMap not supported") + 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 ErrWaitForNotImplemented = errors.New("waitfor not implemented") + func CreateCompositeMemory(mem MemoryReadWriter, arch *Arch, regs op.DwarfRegisters, pieces []op.Piece, ...) (*compositeMemory, error) + func DisableAsyncPreemptEnv() []string + func EvalExpressionWithCalls(grp *TargetGroup, 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) + func NewGroup(procgrp ProcessGroup, cfg NewTargetGroupConfig) (*TargetGroup, AddTargetFunc) + func ReadVarEntry(entry *godwarf.Tree, image *Image) (name string, typ godwarf.Type, err error) + func Restart(grp, oldgrp *TargetGroup, discard func(*LogicalBreakpoint, error)) + func RuntimeTypeToDIE(_type *Variable, dataAddr uint64, mds []ModuleData) (typ godwarf.Type, kind int64, err error) + type AddTargetFunc func(ProcessInternal, int, Thread, string, StopReason, string) (*Target, error) + type Ancestor struct + ID int64 + Unreadable error + func Ancestors(p *Target, g *G, n int) ([]Ancestor, error) + func (a *Ancestor) Stack(n int) ([]Stackframe, error) + type Arch struct + BPRegNum uint64 + ContextRegNum uint64 + DwarfRegisterToString func(int, *op.DwarfRegister) (string, bool, string) + LRRegNum uint64 + Name string + PCRegNum uint64 + RegisterNameToDwarf func(s string) (int, bool) + RegistersToDwarfRegisters func(uint64, Registers) *op.DwarfRegisters + RegnumToString func(uint64) string + SPRegNum uint64 + func AMD64Arch(goos string) *Arch + func ARM64Arch(goos string) *Arch + func I386Arch(goos string) *Arch + func PPC64LEArch(goos string) *Arch + func (a *Arch) AltBreakpointInstruction() []byte + 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) 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 (instr *AsmInstruction) IsCall() bool + func (instr *AsmInstruction) IsHardBreak() bool + func (instr *AsmInstruction) IsJmp() bool + func (instr *AsmInstruction) IsRet() bool + func (instr *AsmInstruction) Text(flavour AssemblyFlavour, bi *BinaryInfo) string + type AsmInstructionKind uint8 + const CallInstruction + const HardBreakInstruction + const JmpInstruction + const OtherInstruction + const RetInstruction + type AssemblyFlavour int + const GNUFlavour + const GoFlavour + const IntelFlavour + type BinaryInfo struct + Arch *Arch + DebugInfoDirectories []string + ElfDynamicSection ElfDynamicSection + Functions []Function + GOOS string + Images []*Image + 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) EntryLineForFunc(fn *Function) (string, int) + func (bi *BinaryInfo) FindFunction(funcName string) ([]*Function, error) + func (bi *BinaryInfo) FindType(name string) (godwarf.Type, error) + func (bi *BinaryInfo) GStructOffset(mem MemoryReadWriter) (uint64, error) + func (bi *BinaryInfo) LastModified() time.Time + 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) LookupFunc() map[string][]*Function + func (bi *BinaryInfo) LookupGenericFunc() map[string][]*Function + func (bi *BinaryInfo) PCToFunc(pc uint64) *Function + func (bi *BinaryInfo) PCToImage(pc uint64) *Image + func (bi *BinaryInfo) PCToLine(pc uint64) (string, int, *Function) + func (bi *BinaryInfo) Producer() string + func (bi *BinaryInfo) Types() ([]string, error) + type Breaklet struct + Cond ast.Expr + DeferReturns []uint64 + Kind BreakpointKind + LogicalID int + type Breakpoint struct + Addr uint64 + Breaklets []*Breaklet + File string + FunctionName string + HWBreakIndex uint8 + Line int + Logical *LogicalBreakpoint + OriginalData []byte + RootFuncName string + TraceFollowCalls int + WatchExpr string + WatchType WatchType + func (bp *Breakpoint) IsStepping() bool + func (bp *Breakpoint) IsUser() bool + func (bp *Breakpoint) LogicalID() int + func (bp *Breakpoint) String() string + func (bp *Breakpoint) UserBreaklet() *Breaklet + func (bp *Breakpoint) VerboseDescr() []string + type BreakpointExistsError struct + Addr uint64 + File string + Line int + func (bpe BreakpointExistsError) Error() string + type BreakpointKind uint16 + const NextBreakpoint + const NextDeferBreakpoint + const NextInactivatedBreakpoint + const PluginOpenBreakpoint + const StackResizeBreakpoint + const StepBreakpoint + const StepIntoNewProcBreakpoint + const StepIntoRangeOverFuncBodyBreakpoint + const UserBreakpoint + const WatchOutOfScopeBreakpoint + type BreakpointMap struct + Logical map[int]*LogicalBreakpoint + M map[uint64]*Breakpoint + WatchOutOfScope []*Breakpoint + func NewBreakpointMap() BreakpointMap + func (bpmap *BreakpointMap) HasHWBreakpoints() bool + func (bpmap *BreakpointMap) HasSteppingBreakpoints() bool + type BreakpointState struct + Active bool + CondError error + Stepping bool + SteppingInto bool + SteppingIntoRangeOverFuncBody bool + func (bpstate *BreakpointState) Clear() + func (bpstate *BreakpointState) String() string + type Checkpoint struct + ID int + When string + Where string + type CommonThread struct + CallReturn bool + func (t *CommonThread) ReturnValues(cfg LoadConfig) []*Variable + type ContinueOnceContext struct + ResumeChan chan<- struct{} + StopMu sync.Mutex + func (cctx *ContinueOnceContext) CheckAndClearManualStopRequest() bool + func (cctx *ContinueOnceContext) GetManualStopRequested() bool + type Defer struct + DeferPC uint64 + DwrapPC uint64 + SP uint64 + Unreadable error + func (d *Defer) DeferredFunc(p *Target) (file string, line int, fn *Function) + func (d *Defer) EvalScope(t *Target, thread Thread) (*EvalScope, error) + func (d *Defer) Next() *Defer + type Direction int8 + const Backward + const Forward + type DumpFlags uint16 + const DumpPlatformIndependent + type DumpState struct + AllDone bool + Canceled bool + DoneChan chan struct{} + Dumping bool + Err error + MemDone uint64 + MemTotal uint64 + Mutex sync.Mutex + ThreadsDone int + ThreadsTotal int + 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 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 ErrUnsupportedArch struct + func (e *ErrUnsupportedArch) Error() string + type EvalScope struct + BinInfo *BinaryInfo + Mem MemoryReadWriter + Regs op.DwarfRegisters + func ConvertEvalScope(dbp *Target, gid int64, frame, deferCall int) (*EvalScope, error) + func FrameToScope(t *Target, thread MemoryReadWriter, g *G, threadID int, frames ...Stackframe) *EvalScope + func GoroutineScope(t *Target, thread Thread) (*EvalScope, error) + func ThreadScope(t *Target, thread Thread) (*EvalScope, error) + func (scope *EvalScope) ChanGoroutines(expr string, start, count int) ([]int64, error) + func (scope *EvalScope) EvalExpression(expr 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(flags localsFlags, wantedName string) ([]*Variable, error) + func (scope *EvalScope) PackageVariables(cfg LoadConfig) ([]*Variable, error) + func (scope *EvalScope) SetVariable(name, value string) error + type Function struct + End uint64 + Entry uint64 + InlinedCalls []InlinedCall + Name string + func (fn *Function) AllPCs(excludeFile string, excludeLine int) ([]uint64, error) + func (fn *Function) BaseName() string + func (fn *Function) GetDwarfTree() (*godwarf.Tree, error) + func (fn *Function) GetImage() *Image + func (fn *Function) NameWithoutTypeParams() 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 int64 + LR uint64 + PC uint64 + SP uint64 + StartPC uint64 + Status uint64 + SystemStack bool + Thread Thread + Unreadable error + WaitReason int64 + WaitSince int64 + func FindGoroutine(dbp *Target, gid int64) (*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) StartLoc(tgt *Target) Location + func (g *G) System(tgt *Target) bool + func (g *G) UserCurrent() Location + type Image struct + BuildID string + Path string + StaticBase uint64 + func (image *Image) Close() error + func (image *Image) LoadError() error + func (image *Image) Stripped() bool + func (image *Image) Type(offset dwarf.Offset) (godwarf.Type, error) + func (so *Image) DwarfReader() *reader.Reader + 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 KeepSteppingBreakpoints uint8 + const HaltKeepsSteppingBreakpoints + const TracepointKeepsSteppingBreakpoints + type LaunchFlags uint8 + const LaunchDisableASLR + const LaunchForeground + 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 LogicalBreakpoint struct + Cond ast.Expr + Enabled bool + File string + FunctionName string + Goroutine bool + HitCond ... + HitCondPerG bool + HitCount map[int64]uint64 + Line int + LoadArgs *LoadConfig + LoadLocals *LoadConfig + LogicalID int + Name string + RootFuncName string + Set SetBreakpoint + Stacktrace int + TotalHitCount uint64 + TraceFollowCalls int + TraceReturn bool + Tracepoint bool + UserData interface{} + Variables []string + type MemoryMapEntry struct + Addr uint64 + Exec bool + Filename string + Offset uint64 + Read bool + Size uint64 + Write bool + type MemoryReadWriter interface + WriteMemory func(addr uint64, data []byte) (written int, err error) + func CacheMemory(mem MemoryReadWriter, addr uint64, size int) MemoryReadWriter + func CreateLoadedCachedMemory(data []byte) MemoryReadWriter + func DereferenceMemory(mem MemoryReadWriter) MemoryReadWriter + type MemoryReader interface + ReadMemory func(buf []byte, addr uint64) (n int, err error) + type ModuleData struct + func LoadModuleData(bi *BinaryInfo, mem MemoryReadWriter) ([]ModuleData, error) + type NewTargetGroupConfig struct + CanDump bool + DebugInfoDirs []string + DisableAsyncPreempt bool + StopReason StopReason + type NoBreakpointError struct + Addr uint64 + func (nbp NoBreakpointError) Error() string + type NullAddrError struct + func (n NullAddrError) Error() string + type OutputRedirect struct + File *os.File + Path string + func Redirector() (reader io.ReadCloser, output OutputRedirect, err error) + type PackageBuildInfo struct + DirectoryPath string + Files map[string]struct{} + ImportPath string + type Parameter struct + InReg bool + Kind reflect.Kind + Name string + Offset int64 + Pieces []int + Ret bool + Size int64 + type PidAddr struct + Addr uint64 + Pid int + type ProcMemory struct + func (m *ProcMemory) ID() string + func (m *ProcMemory) ReadMemory(buf []byte, addr uint64) (n int, err error) + func (m *ProcMemory) WriteMemory(addr uint64, data []byte) (written int, err error) + type Process interface + BinInfo func() *BinaryInfo + Breakpoints func() *BreakpointMap + EntryPoint func() (uint64, error) + FindThread func(threadID int) (Thread, bool) + Memory func() MemoryReadWriter + ThreadList func() []Thread + type ProcessGroup interface + Close func() error + ContinueOnce func(*ContinueOnceContext) (Thread, StopReason, error) + Detach func(int, bool) error + StepInstruction func(int) error + type ProcessInternal interface + DumpProcessNotes func(notes []elfwriter.Note, threadDone func()) (bool, []elfwriter.Note, error) + EraseBreakpoint func(*Breakpoint) error + FollowExec func(bool) error + GetBufferedTracepoints func() []ebpf.RawUProbeParams + MemoryMap func() ([]MemoryMapEntry, error) + RequestManualStop func(cctx *ContinueOnceContext) error + SetUProbe func(string, int64, []ebpf.UProbeArgMap) error + StartCallInjection func() (func(), error) + SupportsBPF func() bool + Valid func() (bool, error) + WriteBreakpoint func(*Breakpoint) 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 RecordingManipulationInternal interface + Restart func(cctx *ContinueOnceContext, pos string) (Thread, 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) + LR func() uint64 + PC func() uint64 + SP func() uint64 + Slice func(floatingPoint bool) ([]Register, error) + TLS func() uint64 + type SetBreakpoint struct + Expr func(*Target) []uint64 + ExprString string + File string + FunctionName string + Line int + PidAddrs []PidAddr + 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 GoroutineStacktrace(tgt *Target, g *G, depth int, opts StacktraceOptions) ([]Stackframe, error) + func ThreadStacktrace(tgt *Target, 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 + const StopWatchpoint + func (sr StopReason) String() string + type Target struct + CmdLine string + StopReason StopReason + func (t *Target) ClearBreakpoint(addr uint64) error + func (t *Target) ClearCaches() + func (t *Target) ClearSteppingBreakpoints() error + func (t *Target) CurrentThread() Thread + func (t *Target) Dump(out elfwriter.WriteCloserSeeker, flags DumpFlags, state *DumpState) + func (t *Target) GetBufferedTracepoints() []*UProbeTraceResult + func (t *Target) IsCgo() bool + func (t *Target) Pid() int + func (t *Target) SelectedGoroutine() *G + func (t *Target) SetBreakpoint(logicalID int, addr uint64, kind BreakpointKind, cond ast.Expr) (*Breakpoint, error) + func (t *Target) SetEBPFTracepoint(fnName string) error + func (t *Target) SetWatchpoint(logicalID int, scope *EvalScope, expr string, wtype WatchType, cond ast.Expr) (*Breakpoint, error) + func (t *Target) SupportsFunctionCalls() bool + func (t *Target) SwitchGoroutine(g *G) error + func (t *Target) SwitchThread(tid int) error + func (t *Target) Valid() (bool, error) + type TargetGroup struct + CanDump bool + KeepSteppingBreakpoints KeepSteppingBreakpoints + LogicalBreakpoints map[int]*LogicalBreakpoint + Selected *Target + StopReason StopReason + func (grp *TargetGroup) ClearSteppingBreakpoints() error + func (grp *TargetGroup) Continue() error + func (grp *TargetGroup) Detach(kill bool) error + func (grp *TargetGroup) DisableBreakpoint(lbp *LogicalBreakpoint) error + func (grp *TargetGroup) EnableBreakpoint(lbp *LogicalBreakpoint) error + func (grp *TargetGroup) FollowExec(v bool, regex string) error + func (grp *TargetGroup) FollowExecEnabled() bool + func (grp *TargetGroup) HasSteppingBreakpoints() bool + func (grp *TargetGroup) Next() (err error) + func (grp *TargetGroup) RequestManualStop() error + func (grp *TargetGroup) Restart(from string) error + func (grp *TargetGroup) ResumeNotify(ch chan<- struct{}) + func (grp *TargetGroup) Step() (err error) + func (grp *TargetGroup) StepInstruction(skipCalls bool) (err error) + func (grp *TargetGroup) StepOut() error + func (grp *TargetGroup) TargetForThread(tid int) *Target + func (grp *TargetGroup) Targets() []*Target + func (grp *TargetGroup) ThreadList() []Thread + func (grp *TargetGroup) Valid() (bool, error) + type Thread interface + BinInfo func() *BinaryInfo + Breakpoint func() *BreakpointState + Common func() *CommonThread + Location func() (*Location, error) + ProcessMemory func() MemoryReadWriter + Registers func() (Registers, error) + RestoreRegisters func(Registers) error + SetCurrentBreakpoint func(adjustPC bool) error + SetReg func(uint64, *op.DwarfRegister) error + SoftExc func() bool + ThreadID func() int + type UProbeTraceResult struct + FnAddr int + GoroutineID int + InputParams []*Variable + IsRet bool + ReturnParams []*Variable + type ValidTargets struct + Group *TargetGroup + func (it *ValidTargets) Next() bool + func (it *ValidTargets) Reset() + type Variable struct + Addr uint64 + Base uint64 + 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 ConvertEntrytoVariable(entry reader.Variable, addr uint64, image *Image, bi *BinaryInfo, ...) (*Variable, error) + func (v *Variable) ConstDescr() string + func (v *Variable) LoadResliced(start int, cfg LoadConfig) (newV *Variable, err error) + func (v *Variable) LoadValue(cfg LoadConfig) + func (v *Variable) TypeString() string + type WaitFor struct + Duration time.Duration + Interval time.Duration + Name string + func (waitFor *WaitFor) Valid() bool + type WatchType uint8 + const WatchRead + const WatchWrite + func (wtype WatchType) Read() bool + func (wtype WatchType) Size() int + func (wtype WatchType) Write() bool v0.0.1-alpha Jan 10, 2025