delve/pkg/proc/interface.go

64 lines
1.6 KiB
Go
Raw Normal View History

package proc
2017-02-08 00:23:47 +00:00
import (
"go/ast"
)
// Process represents the target of the debugger. This
2017-02-08 00:23:47 +00:00
// target could be a system process, core file, etc.
type Process interface {
2017-02-08 00:23:47 +00:00
Info
ProcessManipulation
BreakpointManipulation
}
// Info is an interface that provides general information on the target.
type Info interface {
Pid() int
Exited() bool
Running() bool
BinInfo() *BinaryInfo
2017-02-08 00:23:47 +00:00
ThreadInfo
GoroutineInfo
}
// ThreadInfo is an interface for getting information on active threads
// in the process.
type ThreadInfo interface {
FindThread(threadID int) (Thread, bool)
ThreadList() []Thread
CurrentThread() Thread
2017-02-08 00:23:47 +00:00
}
// GoroutineInfo is an interface for getting information on running goroutines.
type GoroutineInfo interface {
SelectedGoroutine() *G
2017-02-08 00:23:47 +00:00
}
// ProcessManipulation is an interface for changing the execution state of a process.
type ProcessManipulation interface {
ContinueOnce() (trapthread Thread, err error)
2017-02-08 00:23:47 +00:00
StepInstruction() error
SwitchThread(int) error
SwitchGoroutine(int) error
RequestManualStop() error
Halt() error
Kill() error
Detach(bool) error
}
// BreakpointManipulation is an interface for managing breakpoints.
type BreakpointManipulation interface {
Breakpoints() map[uint64]*Breakpoint
SetBreakpoint(addr uint64, kind BreakpointKind, cond ast.Expr) (*Breakpoint, error)
ClearBreakpoint(addr uint64) (*Breakpoint, error)
2017-02-08 00:23:47 +00:00
ClearInternalBreakpoints() error
}
// VariableEval is an interface for dealing with eval scopes.
type VariableEval interface {
FrameToScope(Stackframe) *EvalScope
ConvertEvalScope(gid, frame int) (*EvalScope, error)
2017-02-08 00:23:47 +00:00
}