Documentation ¶
Index ¶
- Variables
- func Record(cmd []string, wd string, quiet bool) (tracedir string, err error)
- type ErrBackendUnavailable
- type ErrMalformedRRGdbCommand
- type ErrPerfEventParanoid
- type GdbMalformedThreadIDError
- type GdbProtocolError
- type Process
- func LLDBAttach(pid int, path string) (*Process, error)
- func LLDBLaunch(cmd []string, wd string, foreground bool) (*Process, error)
- func New(process *os.Process) *Process
- func RecordAndReplay(cmd []string, wd string, quiet bool) (p *Process, tracedir string, err error)
- func Replay(tracedir string, quiet bool) (*Process, error)
- func (p *Process) BinInfo() *proc.BinaryInfo
- func (p *Process) Breakpoints() *proc.BreakpointMap
- func (p *Process) CheckAndClearManualStopRequest() bool
- func (p *Process) Checkpoint(where string) (int, error)
- func (p *Process) Checkpoints() ([]proc.Checkpoint, error)
- func (p *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error)
- func (p *Process) ClearCheckpoint(id int) error
- func (p *Process) ClearInternalBreakpoints() error
- func (p *Process) Common() *proc.CommonProcess
- func (p *Process) Connect(conn net.Conn, path string, pid int) error
- func (p *Process) ContinueOnce() (proc.Thread, error)
- func (p *Process) CurrentThread() proc.Thread
- func (p *Process) Detach(kill bool) error
- func (p *Process) Dial(addr string, path string, pid int) error
- func (p *Process) Direction(dir proc.Direction) error
- func (p *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool)
- func (p *Process) FindThread(threadID int) (proc.Thread, bool)
- func (p *Process) Listen(listener net.Listener, path string, pid int) error
- func (p *Process) Pid() int
- func (p *Process) Recorded() (bool, string)
- func (p *Process) RequestManualStop() error
- func (p *Process) Restart(pos string) error
- func (p *Process) ResumeNotify(ch chan<- struct{})
- func (p *Process) SelectedGoroutine() *proc.G
- func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error)
- func (p *Process) StepInstruction() error
- func (p *Process) SwitchGoroutine(gid int) error
- func (p *Process) SwitchThread(tid int) error
- func (p *Process) ThreadList() []proc.Thread
- func (p *Process) Valid() (bool, error)
- func (p *Process) When() (string, error)
- type Thread
- func (t *Thread) Arch() proc.Arch
- func (t *Thread) BinInfo() *proc.BinaryInfo
- func (t *Thread) Blocked() bool
- func (t *Thread) Breakpoint() proc.BreakpointState
- func (t *Thread) Common() *proc.CommonThread
- func (t *Thread) Location() (*proc.Location, error)
- func (t *Thread) ReadMemory(data []byte, addr uintptr) (n int, err error)
- func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error)
- func (t *Thread) RestoreRegisters(regs proc.SavedRegisters) error
- func (thread *Thread) SetCurrentBreakpoint() error
- func (t *Thread) SetDX(dx uint64) error
- func (t *Thread) SetPC(pc uint64) error
- func (t *Thread) SetSP(sp uint64) error
- func (t *Thread) StepInstruction() error
- func (t *Thread) ThreadID() int
- func (t *Thread) WriteMemory(addr uintptr, data []byte) (written int, err error)
Constants ¶
This section is empty.
Variables ¶
Functions ¶
Types ¶
type ErrBackendUnavailable ¶
type ErrBackendUnavailable struct { }
ErrBackendUnavailable is returned when the stub program can not be found.
func (*ErrBackendUnavailable) Error ¶
func (err *ErrBackendUnavailable) Error() string
type ErrMalformedRRGdbCommand ¶
type ErrMalformedRRGdbCommand struct {
// contains filtered or unexported fields
}
func (*ErrMalformedRRGdbCommand) Error ¶
func (err *ErrMalformedRRGdbCommand) Error() string
type ErrPerfEventParanoid ¶
type ErrPerfEventParanoid struct {
// contains filtered or unexported fields
}
ErrPerfEventParanoid is the error returned by Reply and Record if /proc/sys/kernel/perf_event_paranoid is greater than 1.
func (ErrPerfEventParanoid) Error ¶
func (err ErrPerfEventParanoid) Error() string
type GdbMalformedThreadIDError ¶
type GdbMalformedThreadIDError struct {
// contains filtered or unexported fields
}
GdbMalformedThreadIDError is returned when a the stub responds with a thread ID that does not conform with the Gdb Remote Serial Protocol specification.
func (*GdbMalformedThreadIDError) Error ¶
func (err *GdbMalformedThreadIDError) Error() string
type GdbProtocolError ¶
type GdbProtocolError struct {
// contains filtered or unexported fields
}
GdbProtocolError is an error response (Exx) of Gdb Remote Serial Protocol or an "unsupported command" response (empty packet).
func (*GdbProtocolError) Error ¶
func (err *GdbProtocolError) Error() string
type Process ¶
type Process struct {
// contains filtered or unexported fields
}
Process implements proc.Process using a connection to a debugger stub that understands Gdb Remote Serial Protocol.
func LLDBAttach ¶
LLDBAttach starts an instance of lldb-server and connects to it, asking it to attach to the specified pid. Path is path to the target's executable, path only needs to be specified for some stubs that do not provide an automated way of determining it (for example debugserver).
func LLDBLaunch ¶
LLDBLaunch starts an instance of lldb-server and connects to it, asking it to launch the specified target program with the specified arguments (cmd) on the specified directory wd.
func New ¶
New creates a new Process instance. If process is not nil it is the stub's process and will be killed after Detach. Use Listen, Dial or Connect to complete connection.
func RecordAndReplay ¶
RecordAndReplay acts like calling Record and then Replay.
func Replay ¶
Replay starts an instance of rr in replay mode, with the specified trace directory, and connects to it.
func (*Process) BinInfo ¶
func (p *Process) BinInfo() *proc.BinaryInfo
func (*Process) Breakpoints ¶
func (p *Process) Breakpoints() *proc.BreakpointMap
func (*Process) CheckAndClearManualStopRequest ¶
func (*Process) Checkpoints ¶
func (p *Process) Checkpoints() ([]proc.Checkpoint, error)
func (*Process) ClearBreakpoint ¶
func (p *Process) ClearBreakpoint(addr uint64) (*proc.Breakpoint, error)
func (*Process) Common ¶
func (p *Process) Common() *proc.CommonProcess
func (*Process) Connect ¶
Connect connects to a stub and performs a handshake.
Path and pid are, respectively, the path to the executable of the target program and the PID of the target process, both are optional, however some stubs do not provide ways to determine path and pid automatically and Connect will be unable to function without knowing them.
func (*Process) Dial ¶
Dial attempts to connect to the stub.
func (*Process) FindBreakpoint ¶
func (p *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool)
func (*Process) Listen ¶
Listen waits for a connection from the stub.
func (*Process) SetBreakpoint ¶
func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error)
type Thread ¶
type Thread struct { ID int CurrentBreakpoint proc.BreakpointState // contains filtered or unexported fields }
Thread is a thread.
func (*Thread) BinInfo ¶
func (t *Thread) BinInfo() *proc.BinaryInfo
func (*Thread) Breakpoint ¶
func (t *Thread) Breakpoint() proc.BreakpointState
func (*Thread) Common ¶
func (t *Thread) Common() *proc.CommonThread
func (*Thread) ReadMemory ¶
func (*Thread) RestoreRegisters ¶
func (t *Thread) RestoreRegisters(regs proc.SavedRegisters) error