Documentation ¶
Index ¶
- Variables
- func Record(cmd []string, wd string, quiet bool) (tracedir string, err error)
- type ErrMalformedRRGdbCommand
- type GdbMalformedThreadIDError
- type GdbProtocolError
- type Process
- func LLDBAttach(pid int, path string) (*Process, error)
- func LLDBLaunch(cmd []string, wd string) (*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) AllGCache() *[]*proc.G
- 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) 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) Exited() bool
- func (p *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool)
- func (p *Process) FindThread(threadID int) (proc.Thread, bool)
- func (p *Process) Halt() error
- func (p *Process) Kill() error
- 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) 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) 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 (thread *Thread) SetCurrentBreakpoint() 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 ¶
var ErrDirChange = errors.New("direction change with internal breakpoints")
var ErrTooManyAttempts = errors.New("too many transmit attempts")
var ErrUnsupportedOS = errors.New("lldb backend not supported on windows")
Functions ¶
Types ¶
type ErrMalformedRRGdbCommand ¶
type ErrMalformedRRGdbCommand struct {
// contains filtered or unexported fields
}
func (*ErrMalformedRRGdbCommand) Error ¶
func (err *ErrMalformedRRGdbCommand) 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) ClearCheckpoint ¶
func (*Process) ClearInternalBreakpoints ¶
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) CurrentThread ¶
func (*Process) FindBreakpoint ¶
func (p *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool)
func (*Process) RequestManualStop ¶
func (*Process) ResumeNotify ¶
func (p *Process) ResumeNotify(ch chan<- struct{})
func (*Process) SelectedGoroutine ¶
func (*Process) SetBreakpoint ¶
func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error)
func (*Process) StepInstruction ¶
func (*Process) SwitchGoroutine ¶
func (*Process) SwitchThread ¶
func (*Process) ThreadList ¶
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