proctl

package
v0.0.0-...-7ca1251 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2015 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package proctl provides functions for attaching to and manipulating a process during the debug session.

Index

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 G

type G struct {
	// contains filtered or unexported fields
}

type Goroutine

type Goroutine struct {
	// contains filtered or unexported fields
}

func (*Goroutine) EvalSymbol

func (g *Goroutine) EvalSymbol(name string) (*Variable, error)

Returns the value of the named symbol.

type InvalidAddressError

type InvalidAddressError struct {
	// contains filtered or unexported fields
}

func (InvalidAddressError) Error

func (iae InvalidAddressError) Error() string

type M

type M struct {
	// contains filtered or unexported fields
}

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

type Registers

type Registers interface {
	PC() uint64
	SP() uint64
	SetPC(int, uint64) error
	Rflags() uint64
	SetRflags(int, uint64) error
}

type Variable

type Variable struct {
	Name  string
	Value string
	Type  string
}

Jump to

Keyboard shortcuts

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