2015-03-20 21:11:11 +00:00
|
|
|
package service
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/derekparker/delve/service/api"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Client represents a debugger service client. All client methods are
|
|
|
|
// synchronous.
|
|
|
|
type Client interface {
|
2015-07-03 20:35:22 +00:00
|
|
|
// Returns the pid of the process we are debugging.
|
|
|
|
ProcessPid() int
|
|
|
|
|
2015-03-20 21:11:11 +00:00
|
|
|
// Detach detaches the debugger, optionally killing the process.
|
|
|
|
Detach(killProcess bool) error
|
|
|
|
|
2015-07-03 20:35:22 +00:00
|
|
|
// Restarts program.
|
|
|
|
Restart() error
|
|
|
|
|
2015-03-20 21:11:11 +00:00
|
|
|
// GetState returns the current debugger state.
|
|
|
|
GetState() (*api.DebuggerState, error)
|
|
|
|
|
|
|
|
// Continue resumes process execution.
|
2015-06-28 15:00:56 +00:00
|
|
|
Continue() <-chan *api.DebuggerState
|
2015-03-20 21:11:11 +00:00
|
|
|
// Next continues to the next source line, not entering function calls.
|
|
|
|
Next() (*api.DebuggerState, error)
|
|
|
|
// Step continues to the next source line, entering function calls.
|
|
|
|
Step() (*api.DebuggerState, error)
|
|
|
|
// SwitchThread switches the current thread context.
|
|
|
|
SwitchThread(threadID int) (*api.DebuggerState, error)
|
|
|
|
// Halt suspends the process.
|
|
|
|
Halt() (*api.DebuggerState, error)
|
|
|
|
|
2015-06-12 19:32:32 +00:00
|
|
|
// GetBreakpoint gets a breakpoint by ID.
|
|
|
|
GetBreakpoint(id int) (*api.Breakpoint, error)
|
|
|
|
// CreateBreakpoint creates a new breakpoint.
|
|
|
|
CreateBreakpoint(*api.Breakpoint) (*api.Breakpoint, error)
|
|
|
|
// ListBreakpoints gets all breakpoints.
|
|
|
|
ListBreakpoints() ([]*api.Breakpoint, error)
|
|
|
|
// ClearBreakpoint deletes a breakpoint by ID.
|
|
|
|
ClearBreakpoint(id int) (*api.Breakpoint, error)
|
2015-03-20 21:11:11 +00:00
|
|
|
|
|
|
|
// ListThreads lists all threads.
|
|
|
|
ListThreads() ([]*api.Thread, error)
|
|
|
|
// GetThread gets a thread by its ID.
|
|
|
|
GetThread(id int) (*api.Thread, error)
|
|
|
|
|
|
|
|
// ListPackageVariables lists all package variables in the context of the current thread.
|
|
|
|
ListPackageVariables(filter string) ([]api.Variable, error)
|
2015-06-12 19:04:14 +00:00
|
|
|
// EvalVariable returns a variable in the context of the current thread.
|
|
|
|
EvalVariable(symbol string) (*api.Variable, error)
|
2015-03-20 21:11:11 +00:00
|
|
|
// ListPackageVariablesFor lists all package variables in the context of a thread.
|
|
|
|
ListPackageVariablesFor(threadID int, filter string) ([]api.Variable, error)
|
2015-06-12 19:04:14 +00:00
|
|
|
// EvalVariableFor returns a variable in the context of the specified thread.
|
|
|
|
EvalVariableFor(threadID int, symbol string) (*api.Variable, error)
|
2015-03-20 21:11:11 +00:00
|
|
|
|
|
|
|
// ListSources lists all source files in the process matching filter.
|
|
|
|
ListSources(filter string) ([]string, error)
|
|
|
|
// ListFunctions lists all functions in the process matching filter.
|
|
|
|
ListFunctions(filter string) ([]string, error)
|
2015-05-08 20:16:22 +00:00
|
|
|
// ListLocals lists all local variables in scope.
|
|
|
|
ListLocalVariables() ([]api.Variable, error)
|
|
|
|
// ListFunctionArgs lists all arguments to the current function.
|
|
|
|
ListFunctionArgs() ([]api.Variable, error)
|
2015-06-19 07:20:10 +00:00
|
|
|
// ListRegisters lists registers and their values.
|
|
|
|
ListRegisters() (string, error)
|
2015-03-20 21:11:11 +00:00
|
|
|
|
|
|
|
// ListGoroutines lists all goroutines.
|
|
|
|
ListGoroutines() ([]*api.Goroutine, error)
|
2015-06-17 17:11:57 +00:00
|
|
|
|
|
|
|
// Returns stacktrace
|
2015-06-28 15:00:56 +00:00
|
|
|
Stacktrace(goroutineId, depth int) ([]api.Location, error)
|
2015-03-20 21:11:11 +00:00
|
|
|
}
|