Documentation
¶
Index ¶
- Constants
- Variables
- func AsDebugString(i interface{}, raws ...bool) string
- func GetYakTestCasePath(p string) string
- func SafeReflectStructFieldInterface(refV reflect.Value, field reflect.Value) interface{}
- func SafeReflectValue(refV reflect.Value) reflect.Value
- type Client
- func (c *Client) CheckConfigurationDoneResponse(t *testing.T, m dap.Message) *dap.ConfigurationDoneResponse
- func (c *Client) CheckContinueResponse(t *testing.T, m dap.Message) *dap.ContinueResponse
- func (c *Client) CheckDisconnectResponse(t *testing.T, m dap.Message) *dap.DisconnectResponse
- func (c *Client) CheckErrorResponse(t *testing.T, m dap.Message) *dap.ErrorResponse
- func (c *Client) CheckEvaluateResponse(t *testing.T, m dap.Message) *dap.EvaluateResponse
- func (c *Client) CheckExceptionInfoResponse(t *testing.T, m dap.Message) *dap.ExceptionInfoResponse
- func (c *Client) CheckInitializeResponse(t *testing.T, m dap.Message) *dap.InitializeResponse
- func (c *Client) CheckInitializedEvent(t *testing.T, m dap.Message) *dap.InitializedEvent
- func (c *Client) CheckLaunchResponse(t *testing.T, m dap.Message) *dap.LaunchResponse
- func (c *Client) CheckNextResponse(t *testing.T, m dap.Message) *dap.NextResponse
- func (c *Client) CheckOutputEvent(t *testing.T, m dap.Message) *dap.OutputEvent
- func (c *Client) CheckScopesResponse(t *testing.T, m dap.Message) *dap.ScopesResponse
- func (c *Client) CheckSetBreakpointsResponse(t *testing.T, m dap.Message) *dap.SetBreakpointsResponse
- func (c *Client) CheckSetExceptionBreakpointsResponse(t *testing.T, m dap.Message) *dap.SetExceptionBreakpointsResponse
- func (c *Client) CheckSetExpressionResponse(t *testing.T, m dap.Message) *dap.SetExpressionResponse
- func (c *Client) CheckSetVariableResponse(t *testing.T, m dap.Message) *dap.SetVariableResponse
- func (c *Client) CheckStackTraceResponse(t *testing.T, m dap.Message) *dap.StackTraceResponse
- func (c *Client) CheckStepInResponse(t *testing.T, m dap.Message) *dap.StepInResponse
- func (c *Client) CheckStepOutResponse(t *testing.T, m dap.Message) *dap.StepOutResponse
- func (c *Client) CheckStopLocation(t *testing.T, thread int, name string, line int)
- func (c *Client) CheckStoppedEvent(t *testing.T, m dap.Message) *dap.StoppedEvent
- func (c *Client) CheckTerminatedEvent(t *testing.T, m dap.Message) *dap.TerminatedEvent
- func (c *Client) CheckThreadsResponse(t *testing.T, m dap.Message) *dap.ThreadsResponse
- func (c *Client) CheckVariablesResponse(t *testing.T, m dap.Message) *dap.VariablesResponse
- func (c *Client) Close()
- func (c *Client) ConfigurationDoneRequest()
- func (c *Client) ContinueRequest(thread int)
- func (c *Client) DisconnectRequest()
- func (c *Client) EvaluateRequest(expr string, fid int, context string)
- func (c *Client) ExceptionInfoRequest(threadID int)
- func (c *Client) ExpectConfigurationDoneResponse(t *testing.T) *dap.ConfigurationDoneResponse
- func (c *Client) ExpectContinueResponse(t *testing.T) *dap.ContinueResponse
- func (c *Client) ExpectDisconnectResponse(t *testing.T) *dap.DisconnectResponse
- func (c *Client) ExpectErrorResponse(t *testing.T) *dap.ErrorResponse
- func (c *Client) ExpectEvaluateResponse(t *testing.T) *dap.EvaluateResponse
- func (c *Client) ExpectExceptionInfoResponse(t *testing.T) *dap.ExceptionInfoResponse
- func (c *Client) ExpectInitializeResponse(t *testing.T) *dap.InitializeResponse
- func (c *Client) ExpectInitializeResponseAndCapabilities(t *testing.T) *dap.InitializeResponse
- func (c *Client) ExpectInitializedEvent(t *testing.T) *dap.InitializedEvent
- func (c *Client) ExpectInvisibleErrorResponse(t *testing.T) *dap.ErrorResponse
- func (c *Client) ExpectLaunchResponse(t *testing.T) *dap.LaunchResponse
- func (c *Client) ExpectMessage(t *testing.T) dap.Message
- func (c *Client) ExpectNextResponse(t *testing.T) *dap.NextResponse
- func (c *Client) ExpectOutputEvent(t *testing.T) *dap.OutputEvent
- func (c *Client) ExpectOutputEventDetaching(t *testing.T) *dap.OutputEvent
- func (c *Client) ExpectOutputEventHelpInfo(t *testing.T) *dap.OutputEvent
- func (c *Client) ExpectOutputEventRegex(t *testing.T, want string) *dap.OutputEvent
- func (c *Client) ExpectScopesResponse(t *testing.T) *dap.ScopesResponse
- func (c *Client) ExpectSetBreakpointsResponse(t *testing.T) *dap.SetBreakpointsResponse
- func (c *Client) ExpectSetExceptionBreakpointsResponse(t *testing.T) *dap.SetExceptionBreakpointsResponse
- func (c *Client) ExpectSetExpressionResponse(t *testing.T) *dap.SetExpressionResponse
- func (c *Client) ExpectSetVariableResponse(t *testing.T) *dap.SetVariableResponse
- func (c *Client) ExpectStackTraceResponse(t *testing.T) *dap.StackTraceResponse
- func (c *Client) ExpectStepInResponse(t *testing.T) *dap.StepInResponse
- func (c *Client) ExpectStepOutResponse(t *testing.T) *dap.StepOutResponse
- func (c *Client) ExpectStoppedEvent(t *testing.T) *dap.StoppedEvent
- func (c *Client) ExpectTerminatedEvent(t *testing.T) *dap.TerminatedEvent
- func (c *Client) ExpectThreadsResponse(t *testing.T) *dap.ThreadsResponse
- func (c *Client) ExpectVariablesResponse(t *testing.T) *dap.VariablesResponse
- func (c *Client) InitializeRequest()
- func (c *Client) LaunchRequest(mode, program string, stopOnEntry bool)
- func (c *Client) NextRequest(thread int)
- func (c *Client) PauseRequest(threadId int)
- func (c *Client) ReadMessage() (dap.Message, error)
- func (c *Client) ScopesRequest(frameID int)
- func (c *Client) SetBreakpointsRequest(file string, lines []int)
- func (c *Client) SetBreakpointsRequestWithArgs(file string, lines []int, ...)
- func (c *Client) SetExceptionBreakpointsRequest()
- func (c *Client) SetExpressionRequest()
- func (c *Client) SetVariableRequest(variablesRef int, name, value string)
- func (c *Client) StackTraceRequest(threadID, startFrame, levels int)
- func (c *Client) StepInRequest(thread int)
- func (c *Client) StepOutRequest(thread int)
- func (c *Client) ThreadsRequest()
- func (c *Client) VariablesRequest(variablesReference int)
- type DAPDebugger
- func (d *DAPDebugger) AddObserveBreakPoint(expr string) error
- func (d *DAPDebugger) AddObserveExpression(expr string) error
- func (d *DAPDebugger) AddVariableRef(v interface{}) int
- func (d *DAPDebugger) CallBack() func(g *yakvm.Debugger)
- func (d *DAPDebugger) ClearOtherBreakPoints(path string, existLines []int)
- func (d *DAPDebugger) Continue()
- func (d *DAPDebugger) CurrentFrameID() int
- func (d *DAPDebugger) CurrentThreadID() int
- func (d *DAPDebugger) EvalExpression(expr string, frameID int) (*yakvm.Value, error)
- func (d *DAPDebugger) ExistBreakPoint(path string, lineIndex int) (*yakvm.Breakpoint, bool)
- func (d *DAPDebugger) ForceSetVariableRef(id int, v interface{})
- func (d *DAPDebugger) GetAllObserveExpressions() map[string]*yakvm.Value
- func (d *DAPDebugger) GetScopes(frameID int) map[int]*yakvm.Scope
- func (d *DAPDebugger) GetStackTraces() map[int]*yakvm.StackTraces
- func (d *DAPDebugger) GetThreads() []*Thread
- func (d *DAPDebugger) GetVariablesByReference(ref int) (interface{}, bool)
- func (d *DAPDebugger) GetVariablesReference(v interface{}) (int, bool)
- func (d *DAPDebugger) Halt() error
- func (d *DAPDebugger) InCallbackState()
- func (d *DAPDebugger) Init() func(g *yakvm.Debugger)
- func (d *DAPDebugger) InitWGAdd()
- func (d *DAPDebugger) IsFinished() bool
- func (d *DAPDebugger) OutCallbackState()
- func (d *DAPDebugger) RemoveObserveBreakPoint(expr string) error
- func (d *DAPDebugger) RemoveObserveExpression(expr string) error
- func (d *DAPDebugger) Restart() bool
- func (d *DAPDebugger) SetBreakPoint(path string, lineIndex int, condition, hitCondition string) (int, error)
- func (d *DAPDebugger) SetDescription(desc string)
- func (d *DAPDebugger) SetRestart(b bool)
- func (d *DAPDebugger) StepIn() error
- func (d *DAPDebugger) StepNext() error
- func (d *DAPDebugger) StepOut() error
- func (d *DAPDebugger) VMPanic() *yakvm.VMPanic
- func (d *DAPDebugger) WaitInit()
- func (d *DAPDebugger) WaitProgramStart()
- type DAPServer
- type DAPServerConfig
- type DebugSession
- func (ds *DebugSession) Close()
- func (ds *DebugSession) ConvertVariable(v interface{}) int
- func (ds *DebugSession) GetConvertedVariable(ref int) (interface{}, bool)
- func (ds *DebugSession) GetConvertedVariableRef(v interface{}) int
- func (ds *DebugSession) GetEvaluateName(v interface{}) string
- func (ds *DebugSession) RunProgramInDebugMode(request *dap.LaunchRequest, debug bool, program string, args []string)
- func (ds *DebugSession) WaitProgramStart()
- type GernerateFuncTyp
- type LaunchConfig
- type MapKey
- type ScopeKV
- type Source
- type Thread
Constants ¶
View Source
const ( UnsupportedCommand int = 9999 InternalError int = 8888 NotYetImplemented int = 7777 FailedToLaunch = 3000 FailedToAttach = 3001 FailedToInitialize = 3002 UnableToSetBreakpoints = 2002 UnableToDisplayThreads = 2003 UnableToProduceStackTrace = 2004 UnableToListLocals = 2005 UnableToListArgs = 2006 UnableToListGlobals = 2007 UnableToLookupVariable = 2008 UnableToEvaluateExpression = 2009 UnableToHalt = 2010 UnableToGetExceptionInfo = 2011 UnableToSetVariable = 2012 UnableToDisassemble = 2013 UnableToListRegisters = 2014 UnableToRunDlvCommand = 2015 NoDebugIsRunning = 3000 DebuggeeIsRunning = 4000 DisconnectError = 5000 )
View Source
const (
DAVersion = "0.1.0"
)
View Source
const (
HelpInfo = `
h, help : show help info
`
)
Variables ¶
View Source
var ( SimpleYakTestCase = "simple.yak" FuncCallTestcase = "func_call.yak" IncrementTestcase = "increment.yak" GoroutineTestcase = "goroutine.yak" VariablesTestcase = "variables.yak" StepAndNExtTestcase = "step_and_next.yak" // HardCodeBreakPointTestcase = "hardcode_breakpoint.yak" PanicTestcase = "panic.yak" )
Functions ¶
func AsDebugString ¶
func GetYakTestCasePath ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewTestClient ¶
func NewTestClientFromConn ¶
func (*Client) CheckConfigurationDoneResponse ¶
func (*Client) CheckContinueResponse ¶
func (*Client) CheckDisconnectResponse ¶
func (*Client) CheckErrorResponse ¶
func (*Client) CheckEvaluateResponse ¶
func (*Client) CheckExceptionInfoResponse ¶
func (*Client) CheckInitializeResponse ¶
func (*Client) CheckInitializedEvent ¶
func (*Client) CheckLaunchResponse ¶
func (*Client) CheckNextResponse ¶
func (*Client) CheckOutputEvent ¶
func (*Client) CheckScopesResponse ¶
func (*Client) CheckSetBreakpointsResponse ¶
func (*Client) CheckSetExceptionBreakpointsResponse ¶
func (*Client) CheckSetExpressionResponse ¶
func (*Client) CheckSetVariableResponse ¶
func (*Client) CheckStackTraceResponse ¶
func (*Client) CheckStepInResponse ¶
func (*Client) CheckStepOutResponse ¶
func (*Client) CheckStopLocation ¶
func (*Client) CheckStoppedEvent ¶
func (*Client) CheckTerminatedEvent ¶
func (*Client) CheckThreadsResponse ¶
func (*Client) CheckVariablesResponse ¶
func (*Client) ConfigurationDoneRequest ¶
func (c *Client) ConfigurationDoneRequest()
func (*Client) ContinueRequest ¶
func (*Client) DisconnectRequest ¶
func (c *Client) DisconnectRequest()
func (*Client) EvaluateRequest ¶
func (*Client) ExceptionInfoRequest ¶
func (*Client) ExpectConfigurationDoneResponse ¶
func (*Client) ExpectContinueResponse ¶
func (*Client) ExpectDisconnectResponse ¶
func (*Client) ExpectErrorResponse ¶
func (*Client) ExpectEvaluateResponse ¶
func (*Client) ExpectExceptionInfoResponse ¶
func (*Client) ExpectInitializeResponse ¶
func (*Client) ExpectInitializeResponseAndCapabilities ¶
func (*Client) ExpectInitializedEvent ¶
func (*Client) ExpectInvisibleErrorResponse ¶
func (*Client) ExpectLaunchResponse ¶
func (*Client) ExpectMessage ¶
func (*Client) ExpectNextResponse ¶
func (*Client) ExpectOutputEvent ¶
func (*Client) ExpectOutputEventDetaching ¶
func (*Client) ExpectOutputEventHelpInfo ¶
func (*Client) ExpectOutputEventRegex ¶
func (*Client) ExpectScopesResponse ¶
func (*Client) ExpectSetBreakpointsResponse ¶
func (*Client) ExpectSetExceptionBreakpointsResponse ¶
func (*Client) ExpectSetExpressionResponse ¶
func (*Client) ExpectSetVariableResponse ¶
func (*Client) ExpectStackTraceResponse ¶
func (*Client) ExpectStepInResponse ¶
func (*Client) ExpectStepOutResponse ¶
func (*Client) ExpectStoppedEvent ¶
func (*Client) ExpectTerminatedEvent ¶
func (*Client) ExpectThreadsResponse ¶
func (*Client) ExpectVariablesResponse ¶
func (*Client) InitializeRequest ¶
func (c *Client) InitializeRequest()
func (*Client) LaunchRequest ¶
func (*Client) NextRequest ¶
func (*Client) PauseRequest ¶
func (*Client) ReadMessage ¶
func (*Client) ScopesRequest ¶
func (*Client) SetBreakpointsRequest ¶
func (*Client) SetBreakpointsRequestWithArgs ¶
func (*Client) SetExceptionBreakpointsRequest ¶
func (c *Client) SetExceptionBreakpointsRequest()
func (*Client) SetExpressionRequest ¶
func (c *Client) SetExpressionRequest()
func (*Client) SetVariableRequest ¶
func (*Client) StackTraceRequest ¶
func (*Client) StepInRequest ¶
func (*Client) StepOutRequest ¶
func (*Client) ThreadsRequest ¶
func (c *Client) ThreadsRequest()
func (*Client) VariablesRequest ¶
type DAPDebugger ¶
type DAPDebugger struct {
// contains filtered or unexported fields
}
func NewDAPDebugger ¶
func NewDAPDebugger() *DAPDebugger
func (*DAPDebugger) AddObserveBreakPoint ¶
func (d *DAPDebugger) AddObserveBreakPoint(expr string) error
func (*DAPDebugger) AddObserveExpression ¶
func (d *DAPDebugger) AddObserveExpression(expr string) error
func (*DAPDebugger) AddVariableRef ¶
func (d *DAPDebugger) AddVariableRef(v interface{}) int
func (*DAPDebugger) CallBack ¶
func (d *DAPDebugger) CallBack() func(g *yakvm.Debugger)
func (*DAPDebugger) ClearOtherBreakPoints ¶
func (d *DAPDebugger) ClearOtherBreakPoints(path string, existLines []int)
func (*DAPDebugger) Continue ¶
func (d *DAPDebugger) Continue()
func (*DAPDebugger) CurrentFrameID ¶
func (d *DAPDebugger) CurrentFrameID() int
func (*DAPDebugger) CurrentThreadID ¶
func (d *DAPDebugger) CurrentThreadID() int
func (*DAPDebugger) EvalExpression ¶
func (*DAPDebugger) ExistBreakPoint ¶
func (d *DAPDebugger) ExistBreakPoint(path string, lineIndex int) (*yakvm.Breakpoint, bool)
func (*DAPDebugger) ForceSetVariableRef ¶
func (d *DAPDebugger) ForceSetVariableRef(id int, v interface{})
func (*DAPDebugger) GetAllObserveExpressions ¶
func (d *DAPDebugger) GetAllObserveExpressions() map[string]*yakvm.Value
func (*DAPDebugger) GetStackTraces ¶
func (d *DAPDebugger) GetStackTraces() map[int]*yakvm.StackTraces
func (*DAPDebugger) GetThreads ¶
func (d *DAPDebugger) GetThreads() []*Thread
func (*DAPDebugger) GetVariablesByReference ¶
func (d *DAPDebugger) GetVariablesByReference(ref int) (interface{}, bool)
func (*DAPDebugger) GetVariablesReference ¶
func (d *DAPDebugger) GetVariablesReference(v interface{}) (int, bool)
func (*DAPDebugger) Halt ¶
func (d *DAPDebugger) Halt() error
func (*DAPDebugger) InCallbackState ¶
func (d *DAPDebugger) InCallbackState()
func (*DAPDebugger) Init ¶
func (d *DAPDebugger) Init() func(g *yakvm.Debugger)
func (*DAPDebugger) InitWGAdd ¶
func (d *DAPDebugger) InitWGAdd()
func (*DAPDebugger) IsFinished ¶
func (d *DAPDebugger) IsFinished() bool
func (*DAPDebugger) OutCallbackState ¶
func (d *DAPDebugger) OutCallbackState()
func (*DAPDebugger) RemoveObserveBreakPoint ¶
func (d *DAPDebugger) RemoveObserveBreakPoint(expr string) error
func (*DAPDebugger) RemoveObserveExpression ¶
func (d *DAPDebugger) RemoveObserveExpression(expr string) error
func (*DAPDebugger) Restart ¶
func (d *DAPDebugger) Restart() bool
func (*DAPDebugger) SetBreakPoint ¶
func (*DAPDebugger) SetDescription ¶
func (d *DAPDebugger) SetDescription(desc string)
func (*DAPDebugger) SetRestart ¶
func (d *DAPDebugger) SetRestart(b bool)
func (*DAPDebugger) StepIn ¶
func (d *DAPDebugger) StepIn() error
func (*DAPDebugger) StepNext ¶
func (d *DAPDebugger) StepNext() error
func (*DAPDebugger) StepOut ¶
func (d *DAPDebugger) StepOut() error
func (*DAPDebugger) VMPanic ¶
func (d *DAPDebugger) VMPanic() *yakvm.VMPanic
func (*DAPDebugger) WaitInit ¶
func (d *DAPDebugger) WaitInit()
func (*DAPDebugger) WaitProgramStart ¶
func (d *DAPDebugger) WaitProgramStart()
type DAPServer ¶
type DAPServer struct {
// contains filtered or unexported fields
}
func NewDAPServer ¶
func NewDAPServer(config *DAPServerConfig) *DAPServer
type DAPServerConfig ¶
type DAPServerConfig struct {
// contains filtered or unexported fields
}
type DebugSession ¶
type DebugSession struct { // wg LaunchWg sync.WaitGroup // contains filtered or unexported fields }
func NewDebugSession ¶
func NewDebugSession(conn net.Conn, config *DAPServerConfig) *DebugSession
func (*DebugSession) Close ¶
func (ds *DebugSession) Close()
func (*DebugSession) ConvertVariable ¶
func (ds *DebugSession) ConvertVariable(v interface{}) int
func (*DebugSession) GetConvertedVariable ¶
func (ds *DebugSession) GetConvertedVariable(ref int) (interface{}, bool)
func (*DebugSession) GetConvertedVariableRef ¶
func (ds *DebugSession) GetConvertedVariableRef(v interface{}) int
func (*DebugSession) GetEvaluateName ¶
func (ds *DebugSession) GetEvaluateName(v interface{}) string
获取handleValue对应的ref,然后在从保存的dap.Variable中拿到变量名
func (*DebugSession) RunProgramInDebugMode ¶
func (ds *DebugSession) RunProgramInDebugMode(request *dap.LaunchRequest, debug bool, program string, args []string)
func (*DebugSession) WaitProgramStart ¶
func (ds *DebugSession) WaitProgramStart()
type GernerateFuncTyp ¶
type GernerateFuncTyp func() (path string)
type LaunchConfig ¶
type LaunchConfig struct { // Acceptable values are: // "debug": // "exec": executes a yak script and begins a debug session. // Default is "exec". Mode string `json:"mode,omitempty"` // Path to the program folder (or any go file within that folder) // when in `debug` or `test` mode, and to the pre-built binary file // to debug in `exec` mode. Program string `json:"program,omitempty"` // Command line arguments passed to the debugged program. // Relative paths used in Args will be interpreted as paths relative // to `cwd`. Args []string `json:"args,omitempty"` // Working directory of the program being debugged. // If a relative path is provided, it will be interpreted as // a relative path to Delve's working directory. This is Cwd string `json:"cwd,omitempty"` // NoDebug is used to run the program without debugging. NoDebug bool `json:"noDebug,omitempty"` // Env specifies optional environment variables for Delve server // in addition to the environment variables Delve initially // started with. // Variables with 'nil' values can be used to unset the named // environment variables. // Values are interpreted verbatim. Variable substitution or // reference to other environment variables is not supported. Env map[string]*string `json:"env,omitempty"` // The output mode specifies how to handle the program's output. OutputMode string `json:"outputMode,omitempty"` // Automatically stop program after launch or attach. StopOnEntry bool `json:"stopOnEntry,omitempty"` // StackTraceDepth is the maximum length of the returned list of stack frames. StackTraceDepth int `cfgName:"stackTraceDepth"` }
LaunchConfig is the collection of launch request attributes recognized by DAP implementation.
Click to show internal directories.
Click to hide internal directories.