api

package
v0.8.1-alpha Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2015 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Continue resumes process execution.
	Continue = "continue"
	// Step continues for a single instruction, entering function calls.
	Step = "step"
	// Next continues to the next source line, not entering function calls.
	Next = "next"
	// SwitchThread switches the debugger's current thread context.
	SwitchThread = "switchThread"
	// SwitchGoroutine switches the debugger's current thread context to the thread running the specified goroutine
	SwitchGoroutine = "switchGoroutine"
	// Halt suspends the process.
	Halt = "halt"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Breakpoint

type Breakpoint struct {
	// ID is a unique identifier for the breakpoint.
	ID int `json:"id"`
	// Addr is the address of the breakpoint.
	Addr uint64 `json:"addr"`
	// File is the source file for the breakpoint.
	File string `json:"file"`
	// Line is a line in File for the breakpoint.
	Line int `json:"line"`
	// FunctionName is the name of the function at the current breakpoint, and
	// may not always be available.
	FunctionName string `json:"functionName,omitempty"`

	// tracepoint flag
	Tracepoint bool `json:"continue"`
	// number of stack frames to retrieve
	Stacktrace int `json:"stacktrace"`
	// retrieve goroutine information
	Goroutine bool `json:"goroutine"`
	// variables to evaluate
	Variables []string `json:"variables,omitempty"`
}

Breakpoint addresses a location at which process execution may be suspended.

func ConvertBreakpoint

func ConvertBreakpoint(bp *proc.Breakpoint) *Breakpoint

convertBreakpoint converts an internal breakpoint to an API Breakpoint.

type BreakpointInfo

type BreakpointInfo struct {
	Stacktrace []Location `json:"stacktrace,omitempty"`
	Goroutine  *Goroutine `json:"goroutine,omitempty"`
	Variables  []Variable `json:"variables,omitempty"`
	Arguments  []Variable `json:"arguments,omitempty"`
}

Informations about the current breakpoint

type DebuggerCommand

type DebuggerCommand struct {
	// Name is the command to run.
	Name string `json:"name"`
	// ThreadID is used to specify which thread to use with the SwitchThread
	// command.
	ThreadID int `json:"threadID,omitempty"`
	// GoroutineID is used to specify which thread to use with the SwitchGoroutine
	// command.
	GoroutineID int `json:"goroutineID,omitempty"`
}

DebuggerCommand is a command which changes the debugger's execution state.

type DebuggerState

type DebuggerState struct {
	// Breakpoint is the current breakpoint at which the debugged process is
	// suspended, and may be empty if the process is not suspended.
	Breakpoint *Breakpoint `json:"breakPoint,omitempty"`
	// CurrentThread is the currently selected debugger thread.
	CurrentThread *Thread `json:"currentThread,omitempty"`
	// SelectedGoroutine is the currently selected goroutine
	SelectedGoroutine *Goroutine `json:"currentGoroutine,omitempty"`
	// Information requested by the current breakpoint
	BreakpointInfo *BreakpointInfo `json:"breakPointInfo,omitrempty"`
	// Exited indicates whether the debugged process has exited.
	Exited     bool `json:"exited"`
	ExitStatus int  `json:"exitStatus"`

	// Filled by RPCClient.Continue, indicates an error
	Err error `json:"-"`
}

DebuggerState represents the current context of the debugger.

type EvalScope

type EvalScope struct {
	GoroutineID int
	Frame       int
}

type Function

type Function struct {
	// Name is the function name.
	Name   string `json:"name"`
	Value  uint64 `json:"value"`
	Type   byte   `json:"type"`
	GoType uint64 `json:"goType"`
	// Args are the function arguments in a thread context.
	Args []Variable `json:"args"`
	// Locals are the thread local variables.
	Locals []Variable `json:"locals"`
}

Function represents thread-scoped function information.

func ConvertFunction

func ConvertFunction(fn *gosym.Func) *Function

type Goroutine

type Goroutine struct {
	// ID is a unique identifier for the goroutine.
	ID int `json:"id"`
	// PC is the current program counter for the goroutine.
	PC uint64 `json:"pc"`
	// File is the file for the program counter.
	File string `json:"file"`
	// Line is the line number for the program counter.
	Line int `json:"line"`
	// Function is function information at the program counter. May be nil.
	Function *Function `json:"function,omitempty"`
}

Goroutine represents the information relevant to Delve from the runtime's internal G structure.

func ConvertGoroutine

func ConvertGoroutine(g *proc.G) *Goroutine

convertGoroutine converts an internal Goroutine to an API Goroutine.

type Location

type Location struct {
	PC       uint64    `json:"pc"`
	File     string    `json:"file"`
	Line     int       `json:"line"`
	Function *Function `json:"function,omitempty"`
}

func ConvertLocation

func ConvertLocation(loc proc.Location) Location

type Thread

type Thread struct {
	// ID is a unique identifier for the thread.
	ID int `json:"id"`
	// PC is the current program counter for the thread.
	PC uint64 `json:"pc"`
	// File is the file for the program counter.
	File string `json:"file"`
	// Line is the line number for the program counter.
	Line int `json:"line"`
	// Function is function information at the program counter. May be nil.
	Function *Function `json:"function,omitempty"`
}

Thread is a thread within the debugged process.

func ConvertThread

func ConvertThread(th *proc.Thread) *Thread

convertThread converts an internal thread to an API Thread.

type Variable

type Variable struct {
	Name  string `json:"name"`
	Value string `json:"value"`
	Type  string `json:"type"`
}

Variable describes a variable.

func ConvertVar

func ConvertVar(v *proc.Variable) Variable

convertVar converts an internal variable to an API Variable.

Jump to

Keyboard shortcuts

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