Documentation ¶
Overview ¶
Package proctl provides functions for attaching to and manipulating a process during the debug session.
Index ¶
- type Breakpoint
- type BreakpointExistsError
- type DebuggedProcess
- func (dbp *DebuggedProcess) AllM() ([]*M, error)
- func (dbp *DebuggedProcess) Break(addr uint64) (*Breakpoint, error)
- func (dbp *DebuggedProcess) BreakByLocation(loc string) (*Breakpoint, error)
- func (dbp *DebuggedProcess) BreakpointExists(addr uint64) bool
- func (dbp *DebuggedProcess) Clear(addr uint64) (*Breakpoint, error)
- func (dbp *DebuggedProcess) ClearByLocation(loc string) (*Breakpoint, error)
- func (dbp *DebuggedProcess) CurrentPC() (uint64, error)
- func (dbp *DebuggedProcess) CurrentPCForDisplay() (uint64, error)
- func (dbp *DebuggedProcess) DwarfReader() *reader.Reader
- func (dbp *DebuggedProcess) EvalSymbol(name string) (*Variable, error)
- func (dbp *DebuggedProcess) FindLocation(str string) (uint64, error)
- func (dbp *DebuggedProcess) FunctionArguments() ([]*Variable, error)
- func (dbp *DebuggedProcess) Listen(handler func())
- func (dbp *DebuggedProcess) LoadInformation() error
- func (dbp *DebuggedProcess) LocalVariables() ([]*Variable, error)
- func (dbp *DebuggedProcess) PrintBreakpoints()
- func (dbp *DebuggedProcess) PrintGoroutinesInfo() error
- func (dbp *DebuggedProcess) PrintRegs()
- func (dbp *DebuggedProcess) PrintThreadInfo() error
- type G
- type Goroutine
- type InvalidAddressError
- type M
- type ManualStopError
- type ProcessExitedError
- type Registers
- type Variable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Breakpoint ¶
type Breakpoint struct { FunctionName string File string Line int Addr uint64 OriginalData []byte ID int // contains filtered or unexported fields }
Represents a single breakpoint. Stores information on the break point including the byte of data that originally was stored at that address.
type BreakpointExistsError ¶
type BreakpointExistsError struct {
// contains filtered or unexported fields
}
func (BreakpointExistsError) Error ¶
func (bpe BreakpointExistsError) Error() string
type DebuggedProcess ¶
type DebuggedProcess struct { Pid int Process *os.Process Dwarf *dwarf.Data GoSymTable *gosym.Table FrameEntries *frame.FrameDescriptionEntries HWBreakpoints [4]*Breakpoint Breakpoints map[uint64]*Breakpoint // contains filtered or unexported fields }
Struct representing a debugged process. Holds onto pid, register values, process struct and process state.
func Launch ¶
func Launch(cmd []string) (*DebuggedProcess, error)
func (*DebuggedProcess) AllM ¶
func (dbp *DebuggedProcess) AllM() ([]*M, error)
Parses and returns select info on the internal M data structures used by the Go scheduler.
func (*DebuggedProcess) Break ¶
func (dbp *DebuggedProcess) Break(addr uint64) (*Breakpoint, error)
Sets a breakpoint in the current thread.
func (*DebuggedProcess) BreakByLocation ¶
func (dbp *DebuggedProcess) BreakByLocation(loc string) (*Breakpoint, error)
Sets a breakpoint by location string (function, file+line, address)
func (*DebuggedProcess) BreakpointExists ¶
func (dbp *DebuggedProcess) BreakpointExists(addr uint64) bool
func (*DebuggedProcess) Clear ¶
func (dbp *DebuggedProcess) Clear(addr uint64) (*Breakpoint, error)
Clears a breakpoint in the current thread.
func (*DebuggedProcess) ClearByLocation ¶
func (dbp *DebuggedProcess) ClearByLocation(loc string) (*Breakpoint, error)
Clears a breakpoint by location (function, file+line, address, breakpoint id)
func (*DebuggedProcess) CurrentPC ¶
func (dbp *DebuggedProcess) CurrentPC() (uint64, error)
func (*DebuggedProcess) CurrentPCForDisplay ¶
func (dbp *DebuggedProcess) CurrentPCForDisplay() (uint64, error)
func (*DebuggedProcess) DwarfReader ¶
func (dbp *DebuggedProcess) DwarfReader() *reader.Reader
Returns a reader for the dwarf data
func (*DebuggedProcess) EvalSymbol ¶
func (dbp *DebuggedProcess) EvalSymbol(name string) (*Variable, error)
Returns the value of the named symbol.
func (*DebuggedProcess) FindLocation ¶
func (dbp *DebuggedProcess) FindLocation(str string) (uint64, error)
Find a location by string (file+line, function, breakpoint id, addr)
func (*DebuggedProcess) FunctionArguments ¶
func (dbp *DebuggedProcess) FunctionArguments() ([]*Variable, error)
FunctionArguments returns the name, value, and type of all current function arguments
func (*DebuggedProcess) Listen ¶
func (dbp *DebuggedProcess) Listen(handler func())
func (*DebuggedProcess) LoadInformation ¶
func (dbp *DebuggedProcess) LoadInformation() error
Finds the executable from /proc/<pid>/exe and then uses that to parse the following information: * Dwarf .debug_frame section * Dwarf .debug_line section * Go symbol table.
func (*DebuggedProcess) LocalVariables ¶
func (dbp *DebuggedProcess) LocalVariables() ([]*Variable, error)
LocalVariables returns all local variables from the current function scope
func (*DebuggedProcess) PrintBreakpoints ¶
func (dbp *DebuggedProcess) PrintBreakpoints()
func (*DebuggedProcess) PrintGoroutinesInfo ¶
func (dbp *DebuggedProcess) PrintGoroutinesInfo() error
func (*DebuggedProcess) PrintRegs ¶
func (dbp *DebuggedProcess) PrintRegs()
func (*DebuggedProcess) PrintThreadInfo ¶
func (dbp *DebuggedProcess) PrintThreadInfo() error
Loop through all threads, printing their information to the console.
type InvalidAddressError ¶
type InvalidAddressError struct {
// contains filtered or unexported fields
}
func (InvalidAddressError) Error ¶
func (iae InvalidAddressError) Error() string
type ManualStopError ¶
type ManualStopError struct{}
func (ManualStopError) Error ¶
func (mse ManualStopError) Error() string
type ProcessExitedError ¶
type ProcessExitedError struct {
// contains filtered or unexported fields
}
func (ProcessExitedError) Error ¶
func (pe ProcessExitedError) Error() string