gdbserial

package
v1.0.0-rc.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2017 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDirChange = errors.New("direction change with internal breakpoints")
View Source
var ErrTooManyAttempts = errors.New("too many transmit attempts")
View Source
var ErrUnsupportedOS = errors.New("lldb backend not supported on windows")

Functions

func Record

func Record(cmd []string, wd string, quiet bool) (tracedir string, err error)

Record uses rr to record the execution of the specified program and returns the trace directory's path.

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

func LLDBAttach(pid int, path string) (*Process, error)

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

func LLDBLaunch(cmd []string, wd string) (*Process, error)

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

func New(process *os.Process) *Process

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

func RecordAndReplay(cmd []string, wd string, quiet bool) (p *Process, tracedir string, err error)

RecordAndReplay acts like calling Record and then Replay.

func Replay

func Replay(tracedir string, quiet bool) (*Process, error)

Replay starts an instance of rr in replay mode, with the specified trace directory, and connects to it.

func (*Process) AllGCache

func (p *Process) AllGCache() *[]*proc.G

func (*Process) BinInfo

func (p *Process) BinInfo() *proc.BinaryInfo

func (*Process) Breakpoints

func (p *Process) Breakpoints() map[uint64]*proc.Breakpoint

func (*Process) Checkpoint

func (p *Process) Checkpoint(where string) (int, error)

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 (p *Process) ClearCheckpoint(id int) error

func (*Process) ClearInternalBreakpoints

func (p *Process) ClearInternalBreakpoints() error

func (*Process) Connect

func (p *Process) Connect(conn net.Conn, path string, pid int) error

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) ContinueOnce

func (p *Process) ContinueOnce() (proc.Thread, error)

func (*Process) CurrentThread

func (p *Process) CurrentThread() proc.Thread

func (*Process) Detach

func (p *Process) Detach(kill bool) error

func (*Process) Dial

func (p *Process) Dial(addr string, path string, pid int) error

Dial attempts to connect to the stub.

func (*Process) Direction

func (p *Process) Direction(dir proc.Direction) error

func (*Process) Exited

func (p *Process) Exited() bool

func (*Process) FindBreakpoint

func (p *Process) FindBreakpoint(pc uint64) (*proc.Breakpoint, bool)

func (*Process) FindThread

func (p *Process) FindThread(threadID int) (proc.Thread, bool)

func (*Process) Halt

func (p *Process) Halt() error

func (*Process) Kill

func (p *Process) Kill() error

func (*Process) Listen

func (p *Process) Listen(listener net.Listener, path string, pid int) error

Listen waits for a connection from the stub.

func (*Process) ManualStopRequested

func (p *Process) ManualStopRequested() bool

func (*Process) Pid

func (p *Process) Pid() int

func (*Process) Recorded

func (p *Process) Recorded() (bool, string)

func (*Process) RequestManualStop

func (p *Process) RequestManualStop() error

func (*Process) Restart

func (p *Process) Restart(pos string) error

func (*Process) ResumeNotify

func (p *Process) ResumeNotify(ch chan<- struct{})

func (*Process) SelectedGoroutine

func (p *Process) SelectedGoroutine() *proc.G

func (*Process) SetBreakpoint

func (p *Process) SetBreakpoint(addr uint64, kind proc.BreakpointKind, cond ast.Expr) (*proc.Breakpoint, error)

func (*Process) StepInstruction

func (p *Process) StepInstruction() error

func (*Process) SwitchGoroutine

func (p *Process) SwitchGoroutine(gid int) error

func (*Process) SwitchThread

func (p *Process) SwitchThread(tid int) error

func (*Process) ThreadList

func (p *Process) ThreadList() []proc.Thread

func (*Process) When

func (p *Process) When() (string, error)

type Thread

type Thread struct {
	ID int

	CurrentBreakpoint        *proc.Breakpoint
	BreakpointConditionMet   bool
	BreakpointConditionError error
	// contains filtered or unexported fields
}

Thread is a thread.

func (*Thread) Arch

func (t *Thread) Arch() proc.Arch

func (*Thread) BinInfo

func (t *Thread) BinInfo() *proc.BinaryInfo

func (*Thread) Blocked

func (t *Thread) Blocked() bool

func (*Thread) Breakpoint

func (t *Thread) Breakpoint() (breakpoint *proc.Breakpoint, active bool, condErr error)

func (*Thread) Location

func (t *Thread) Location() (*proc.Location, error)

func (*Thread) ReadMemory

func (t *Thread) ReadMemory(data []byte, addr uintptr) (n int, err error)

func (*Thread) Registers

func (t *Thread) Registers(floatingPoint bool) (proc.Registers, error)

func (*Thread) SetCurrentBreakpoint

func (thread *Thread) SetCurrentBreakpoint() error

func (*Thread) StepInstruction

func (t *Thread) StepInstruction() error

func (*Thread) ThreadID

func (t *Thread) ThreadID() int

func (*Thread) WriteMemory

func (t *Thread) WriteMemory(addr uintptr, data []byte) (written int, err error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL