未验证 提交 b03d468b 编写于 作者: P polinasok 提交者: GitHub

go.mod: update google/go-dap to 0.6.0 (#2710)

Co-authored-by: NPolina Sokolova <polinasok@users.noreply.github.com>
上级 ff52a37a
...@@ -7,7 +7,7 @@ require ( ...@@ -7,7 +7,7 @@ require (
github.com/cosiner/argv v0.1.0 github.com/cosiner/argv v0.1.0
github.com/creack/pty v1.1.9 github.com/creack/pty v1.1.9
github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9 github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9
github.com/google/go-dap v0.5.1-0.20210713061233-c91b005e3987 github.com/google/go-dap v0.6.0
github.com/hashicorp/golang-lru v0.5.4 github.com/hashicorp/golang-lru v0.5.4
github.com/mattn/go-colorable v0.0.9 github.com/mattn/go-colorable v0.0.9
github.com/mattn/go-isatty v0.0.3 github.com/mattn/go-isatty v0.0.3
......
...@@ -70,8 +70,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z ...@@ -70,8 +70,8 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-dap v0.5.1-0.20210713061233-c91b005e3987 h1:aghNk+kvabZ5I1OC3cNHWvfZ8svcoDLAGyKYimqyGVk= github.com/google/go-dap v0.6.0 h1:Y1RHGUtv3R8y6sXq2dtGRMYrFB2hSqyFVws7jucrzX4=
github.com/google/go-dap v0.5.1-0.20210713061233-c91b005e3987/go.mod h1:5q8aYQFnHOAZEMP+6vmq25HKYAEwE+LF5yh7JKrrhSQ= github.com/google/go-dap v0.6.0/go.mod h1:5q8aYQFnHOAZEMP+6vmq25HKYAEwE+LF5yh7JKrrhSQ=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
......
# For Travis to run this for pending PRs and pushes to the master branch, make
# sure to add a Webhook in the Github repository Settings to send all events to
# https://notify.travis-ci.org
language: go
go:
- 1.14.x
- 1.15.x
- 1.16.x
env:
global:
- GOPROXY=https://proxy.golang.org
- GO111MODULE=on
script:
- 'internal/test.sh'
# go-dap: Go implementation of the Debug Adapter Protocol # go-dap: Go implementation of the Debug Adapter Protocol
[![PkgGoDev](https://pkg.go.dev/badge/github.com/google/go-dap)](https://pkg.go.dev/github.com/google/go-dap) [![PkgGoDev](https://pkg.go.dev/badge/github.com/google/go-dap)](https://pkg.go.dev/github.com/google/go-dap)
[![Build Status](https://travis-ci.org/google/go-dap.svg?branch=master)](https://travis-ci.org/google/go-dap) [![Build Status](https://github.com/google/go-dap/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/google/go-dap/actions)
[![Go Report Card](https://goreportcard.com/badge/github.com/google/go-dap)](https://goreportcard.com/report/github.com/google/go-dap) [![Go Report Card](https://goreportcard.com/badge/github.com/google/go-dap)](https://goreportcard.com/report/github.com/google/go-dap)
For an overview of DAP, see For an overview of DAP, see
......
...@@ -73,61 +73,6 @@ func decodeRequest(data []byte) (Message, error) { ...@@ -73,61 +73,6 @@ func decodeRequest(data []byte) (Message, error) {
return nil, &DecodeProtocolMessageFieldError{r.GetSeq(), "Request", "command", r.Command} return nil, &DecodeProtocolMessageFieldError{r.GetSeq(), "Request", "command", r.Command}
} }
// Mapping of request commands and corresponding struct constructors that
// can be passed to json.Unmarshal.
var requestCtor = map[string]messageCtor{
"cancel": func() Message { return &CancelRequest{} },
"runInTerminal": func() Message { return &RunInTerminalRequest{} },
"initialize": func() Message {
return &InitializeRequest{
Arguments: InitializeRequestArguments{
// Set the default values specified here: https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Initialize.
LinesStartAt1: true,
ColumnsStartAt1: true,
PathFormat: "path",
},
}
},
"configurationDone": func() Message { return &ConfigurationDoneRequest{} },
"launch": func() Message { return &LaunchRequest{} },
"attach": func() Message { return &AttachRequest{} },
"restart": func() Message { return &RestartRequest{} },
"disconnect": func() Message { return &DisconnectRequest{} },
"terminate": func() Message { return &TerminateRequest{} },
"breakpointLocations": func() Message { return &BreakpointLocationsRequest{} },
"setBreakpoints": func() Message { return &SetBreakpointsRequest{} },
"setFunctionBreakpoints": func() Message { return &SetFunctionBreakpointsRequest{} },
"setExceptionBreakpoints": func() Message { return &SetExceptionBreakpointsRequest{} },
"dataBreakpointInfo": func() Message { return &DataBreakpointInfoRequest{} },
"setDataBreakpoints": func() Message { return &SetDataBreakpointsRequest{} },
"continue": func() Message { return &ContinueRequest{} },
"next": func() Message { return &NextRequest{} },
"stepIn": func() Message { return &StepInRequest{} },
"stepOut": func() Message { return &StepOutRequest{} },
"stepBack": func() Message { return &StepBackRequest{} },
"reverseContinue": func() Message { return &ReverseContinueRequest{} },
"restartFrame": func() Message { return &RestartFrameRequest{} },
"goto": func() Message { return &GotoRequest{} },
"pause": func() Message { return &PauseRequest{} },
"stackTrace": func() Message { return &StackTraceRequest{} },
"scopes": func() Message { return &ScopesRequest{} },
"variables": func() Message { return &VariablesRequest{} },
"setVariable": func() Message { return &SetVariableRequest{} },
"source": func() Message { return &SourceRequest{} },
"threads": func() Message { return &ThreadsRequest{} },
"terminateThreads": func() Message { return &TerminateThreadsRequest{} },
"modules": func() Message { return &ModulesRequest{} },
"loadedSources": func() Message { return &LoadedSourcesRequest{} },
"evaluate": func() Message { return &EvaluateRequest{} },
"setExpression": func() Message { return &SetExpressionRequest{} },
"stepInTargets": func() Message { return &StepInTargetsRequest{} },
"gotoTargets": func() Message { return &GotoTargetsRequest{} },
"completions": func() Message { return &CompletionsRequest{} },
"exceptionInfo": func() Message { return &ExceptionInfoRequest{} },
"readMemory": func() Message { return &ReadMemoryRequest{} },
"disassemble": func() Message { return &DisassembleRequest{} },
}
// decodeResponse determines what response type in the ProtocolMessage hierarchy // decodeResponse determines what response type in the ProtocolMessage hierarchy
// data corresponds to and uses json.Unmarshal to populate the corresponding // data corresponds to and uses json.Unmarshal to populate the corresponding
// struct to be returned. // struct to be returned.
...@@ -149,52 +94,6 @@ func decodeResponse(data []byte) (Message, error) { ...@@ -149,52 +94,6 @@ func decodeResponse(data []byte) (Message, error) {
return nil, &DecodeProtocolMessageFieldError{r.GetSeq(), "Response", "command", r.Command} return nil, &DecodeProtocolMessageFieldError{r.GetSeq(), "Response", "command", r.Command}
} }
// Mapping of response commands and corresponding struct constructors that
// can be passed to json.Unmarshal.
var responseCtor = map[string]messageCtor{
"cancel": func() Message { return &CancelResponse{} },
"runInTerminal": func() Message { return &RunInTerminalResponse{} },
"initialize": func() Message { return &InitializeResponse{} },
"configurationDone": func() Message { return &ConfigurationDoneResponse{} },
"launch": func() Message { return &LaunchResponse{} },
"attach": func() Message { return &AttachResponse{} },
"restart": func() Message { return &RestartResponse{} },
"disconnect": func() Message { return &DisconnectResponse{} },
"terminate": func() Message { return &TerminateResponse{} },
"breakpointLocations": func() Message { return &BreakpointLocationsResponse{} },
"setBreakpoints": func() Message { return &SetBreakpointsResponse{} },
"setFunctionBreakpoints": func() Message { return &SetFunctionBreakpointsResponse{} },
"setExceptionBreakpoints": func() Message { return &SetExceptionBreakpointsResponse{} },
"dataBreakpointInfo": func() Message { return &DataBreakpointInfoResponse{} },
"setDataBreakpoints": func() Message { return &SetDataBreakpointsResponse{} },
"continue": func() Message { return &ContinueResponse{} },
"next": func() Message { return &NextResponse{} },
"stepIn": func() Message { return &StepInResponse{} },
"stepOut": func() Message { return &StepOutResponse{} },
"stepBack": func() Message { return &StepBackResponse{} },
"reverseContinue": func() Message { return &ReverseContinueResponse{} },
"restartFrame": func() Message { return &RestartFrameResponse{} },
"goto": func() Message { return &GotoResponse{} },
"pause": func() Message { return &PauseResponse{} },
"stackTrace": func() Message { return &StackTraceResponse{} },
"scopes": func() Message { return &ScopesResponse{} },
"variables": func() Message { return &VariablesResponse{} },
"setVariable": func() Message { return &SetVariableResponse{} },
"source": func() Message { return &SourceResponse{} },
"threads": func() Message { return &ThreadsResponse{} },
"terminateThreads": func() Message { return &TerminateThreadsResponse{} },
"modules": func() Message { return &ModulesResponse{} },
"loadedSources": func() Message { return &LoadedSourcesResponse{} },
"evaluate": func() Message { return &EvaluateResponse{} },
"setExpression": func() Message { return &SetExpressionResponse{} },
"stepInTargets": func() Message { return &StepInTargetsResponse{} },
"gotoTargets": func() Message { return &GotoTargetsResponse{} },
"completions": func() Message { return &CompletionsResponse{} },
"exceptionInfo": func() Message { return &ExceptionInfoResponse{} },
"readMemory": func() Message { return &ReadMemoryResponse{} },
"disassemble": func() Message { return &DisassembleResponse{} },
}
// decodeEvent determines what event type in the ProtocolMessage hierarchy // decodeEvent determines what event type in the ProtocolMessage hierarchy
// data corresponds to and uses json.Unmarshal to populate the corresponding // data corresponds to and uses json.Unmarshal to populate the corresponding
// struct to be returned. // struct to be returned.
...@@ -210,20 +109,3 @@ func decodeEvent(data []byte) (Message, error) { ...@@ -210,20 +109,3 @@ func decodeEvent(data []byte) (Message, error) {
} }
return nil, &DecodeProtocolMessageFieldError{e.GetSeq(), "Event", "event", e.Event} return nil, &DecodeProtocolMessageFieldError{e.GetSeq(), "Event", "event", e.Event}
} }
// Mapping of event ids and corresponding struct constructors that
// can be passed to json.Unmarshal.
var eventCtor = map[string]messageCtor{
"initialized": func() Message { return &InitializedEvent{} },
"stopped": func() Message { return &StoppedEvent{} },
"continued": func() Message { return &ContinuedEvent{} },
"exited": func() Message { return &ExitedEvent{} },
"terminated": func() Message { return &TerminatedEvent{} },
"thread": func() Message { return &ThreadEvent{} },
"output": func() Message { return &OutputEvent{} },
"breakpoint": func() Message { return &BreakpointEvent{} },
"module": func() Message { return &ModuleEvent{} },
"loadedSource": func() Message { return &LoadedSourceEvent{} },
"process": func() Message { return &ProcessEvent{} },
"capabilities": func() Message { return &CapabilitiesEvent{} },
}
...@@ -394,6 +394,23 @@ type InvalidatedEventBody struct { ...@@ -394,6 +394,23 @@ type InvalidatedEventBody struct {
func (e *InvalidatedEvent) GetEvent() *Event { return &e.Event } func (e *InvalidatedEvent) GetEvent() *Event { return &e.Event }
// MemoryEvent: This event indicates that some memory range has been updated. It should only be sent if the debug adapter has received a value true for the `supportsMemoryEvent` capability of the `initialize` request.
// Clients typically react to the event by re-issuing a `readMemory` request if they show the memory identified by the `memoryReference` and if the updated memory range overlaps the displayed range. Clients should not make assumptions how individual memory references relate to each other, so they should not assume that they are part of a single continuous address range and might overlap.
// Debug adapters can use this event to indicate that the contents of a memory range has changed due to some other DAP request like `setVariable` or `setExpression`. Debug adapters are not expected to emit this event for each and every memory change of a running program, because that information is typically not available from debuggers and it would flood clients with too many events.
type MemoryEvent struct {
Event
Body MemoryEventBody `json:"body"`
}
type MemoryEventBody struct {
MemoryReference string `json:"memoryReference"`
Offset int `json:"offset"`
Count int `json:"count"`
}
func (e *MemoryEvent) GetEvent() *Event { return &e.Event }
// RunInTerminalRequest: This optional request is sent from the debug adapter to the client to run a command in a terminal. // RunInTerminalRequest: This optional request is sent from the debug adapter to the client to run a command in a terminal.
// This is typically used to launch the debuggee in a terminal provided by the client. // This is typically used to launch the debuggee in a terminal provided by the client.
// This request should only be called if the client has passed the value true for the 'supportsRunInTerminalRequest' capability of the 'initialize' request. // This request should only be called if the client has passed the value true for the 'supportsRunInTerminalRequest' capability of the 'initialize' request.
...@@ -456,6 +473,7 @@ type InitializeRequestArguments struct { ...@@ -456,6 +473,7 @@ type InitializeRequestArguments struct {
SupportsMemoryReferences bool `json:"supportsMemoryReferences,omitempty"` SupportsMemoryReferences bool `json:"supportsMemoryReferences,omitempty"`
SupportsProgressReporting bool `json:"supportsProgressReporting,omitempty"` SupportsProgressReporting bool `json:"supportsProgressReporting,omitempty"`
SupportsInvalidatedEvent bool `json:"supportsInvalidatedEvent,omitempty"` SupportsInvalidatedEvent bool `json:"supportsInvalidatedEvent,omitempty"`
SupportsMemoryEvent bool `json:"supportsMemoryEvent,omitempty"`
} }
// InitializeResponse: Response to 'initialize' request. // InitializeResponse: Response to 'initialize' request.
...@@ -1133,6 +1151,7 @@ type VariablesResponseBody struct { ...@@ -1133,6 +1151,7 @@ type VariablesResponseBody struct {
func (r *VariablesResponse) GetResponse() *Response { return &r.Response } func (r *VariablesResponse) GetResponse() *Response { return &r.Response }
// SetVariableRequest: Set the variable with the given name in the variable container to a new value. Clients should only call this request if the capability 'supportsSetVariable' is true. // SetVariableRequest: Set the variable with the given name in the variable container to a new value. Clients should only call this request if the capability 'supportsSetVariable' is true.
// If a debug adapter implements both setVariable and setExpression, a client will only use setExpression if the variable has an evaluateName property.
type SetVariableRequest struct { type SetVariableRequest struct {
Request Request
...@@ -1334,6 +1353,7 @@ func (r *EvaluateResponse) GetResponse() *Response { return &r.Response } ...@@ -1334,6 +1353,7 @@ func (r *EvaluateResponse) GetResponse() *Response { return &r.Response }
// SetExpressionRequest: Evaluates the given 'value' expression and assigns it to the 'expression' which must be a modifiable l-value. // SetExpressionRequest: Evaluates the given 'value' expression and assigns it to the 'expression' which must be a modifiable l-value.
// The expressions have access to any variables and arguments that are in scope of the specified frame. // The expressions have access to any variables and arguments that are in scope of the specified frame.
// Clients should only call this request if the capability 'supportsSetExpression' is true. // Clients should only call this request if the capability 'supportsSetExpression' is true.
// If a debug adapter implements both setExpression and setVariable, a client will only use setExpression if the variable has an evaluateName property.
type SetExpressionRequest struct { type SetExpressionRequest struct {
Request Request
...@@ -1523,6 +1543,38 @@ type ReadMemoryResponseBody struct { ...@@ -1523,6 +1543,38 @@ type ReadMemoryResponseBody struct {
func (r *ReadMemoryResponse) GetResponse() *Response { return &r.Response } func (r *ReadMemoryResponse) GetResponse() *Response { return &r.Response }
// WriteMemoryRequest: Writes bytes to memory at the provided location.
// Clients should only call this request if the capability 'supportsWriteMemoryRequest' is true.
type WriteMemoryRequest struct {
Request
Arguments WriteMemoryArguments `json:"arguments"`
}
func (r *WriteMemoryRequest) GetRequest() *Request { return &r.Request }
// WriteMemoryArguments: Arguments for 'writeMemory' request.
type WriteMemoryArguments struct {
MemoryReference string `json:"memoryReference"`
Offset int `json:"offset,omitempty"`
AllowPartial bool `json:"allowPartial,omitempty"`
Data string `json:"data"`
}
// WriteMemoryResponse: Response to 'writeMemory' request.
type WriteMemoryResponse struct {
Response
Body WriteMemoryResponseBody `json:"body,omitempty"`
}
type WriteMemoryResponseBody struct {
Offset int `json:"offset,omitempty"`
BytesWritten int `json:"bytesWritten,omitempty"`
}
func (r *WriteMemoryResponse) GetResponse() *Response { return &r.Response }
// DisassembleRequest: Disassembles code stored at the provided location. // DisassembleRequest: Disassembles code stored at the provided location.
// Clients should only call this request if the capability 'supportsDisassembleRequest' is true. // Clients should only call this request if the capability 'supportsDisassembleRequest' is true.
type DisassembleRequest struct { type DisassembleRequest struct {
...@@ -1587,6 +1639,7 @@ type Capabilities struct { ...@@ -1587,6 +1639,7 @@ type Capabilities struct {
SupportsTerminateRequest bool `json:"supportsTerminateRequest,omitempty"` SupportsTerminateRequest bool `json:"supportsTerminateRequest,omitempty"`
SupportsDataBreakpoints bool `json:"supportsDataBreakpoints,omitempty"` SupportsDataBreakpoints bool `json:"supportsDataBreakpoints,omitempty"`
SupportsReadMemoryRequest bool `json:"supportsReadMemoryRequest,omitempty"` SupportsReadMemoryRequest bool `json:"supportsReadMemoryRequest,omitempty"`
SupportsWriteMemoryRequest bool `json:"supportsWriteMemoryRequest,omitempty"`
SupportsDisassembleRequest bool `json:"supportsDisassembleRequest,omitempty"` SupportsDisassembleRequest bool `json:"supportsDisassembleRequest,omitempty"`
SupportsCancelRequest bool `json:"supportsCancelRequest,omitempty"` SupportsCancelRequest bool `json:"supportsCancelRequest,omitempty"`
SupportsBreakpointLocationsRequest bool `json:"supportsBreakpointLocationsRequest,omitempty"` SupportsBreakpointLocationsRequest bool `json:"supportsBreakpointLocationsRequest,omitempty"`
...@@ -1612,7 +1665,7 @@ type ErrorMessage struct { ...@@ -1612,7 +1665,7 @@ type ErrorMessage struct {
Format string `json:"format"` Format string `json:"format"`
Variables map[string]string `json:"variables,omitempty"` Variables map[string]string `json:"variables,omitempty"`
SendTelemetry bool `json:"sendTelemetry,omitempty"` SendTelemetry bool `json:"sendTelemetry,omitempty"`
ShowUser bool `json:"showUser,omitempty"` ShowUser bool `json:"showUser"`
Url string `json:"url,omitempty"` Url string `json:"url,omitempty"`
UrlLabel string `json:"urlLabel,omitempty"` UrlLabel string `json:"urlLabel,omitempty"`
} }
...@@ -1901,3 +1954,130 @@ type DisassembledInstruction struct { ...@@ -1901,3 +1954,130 @@ type DisassembledInstruction struct {
// InvalidatedAreas: Logical areas that can be invalidated by the 'invalidated' event. // InvalidatedAreas: Logical areas that can be invalidated by the 'invalidated' event.
type InvalidatedAreas string type InvalidatedAreas string
// Mapping of request commands and corresponding struct constructors that
// can be passed to json.Unmarshal.
var requestCtor = map[string]messageCtor{
"cancel": func() Message { return &CancelRequest{} },
"runInTerminal": func() Message { return &RunInTerminalRequest{} },
"initialize": func() Message {
return &InitializeRequest{
Arguments: InitializeRequestArguments{
// Set the default values specified here: https://microsoft.github.io/debug-adapter-protocol/specification#Requests_Initialize.
LinesStartAt1: true,
ColumnsStartAt1: true,
PathFormat: "path",
},
}
},
"configurationDone": func() Message { return &ConfigurationDoneRequest{} },
"launch": func() Message { return &LaunchRequest{} },
"attach": func() Message { return &AttachRequest{} },
"restart": func() Message { return &RestartRequest{} },
"disconnect": func() Message { return &DisconnectRequest{} },
"terminate": func() Message { return &TerminateRequest{} },
"breakpointLocations": func() Message { return &BreakpointLocationsRequest{} },
"setBreakpoints": func() Message { return &SetBreakpointsRequest{} },
"setFunctionBreakpoints": func() Message { return &SetFunctionBreakpointsRequest{} },
"setExceptionBreakpoints": func() Message { return &SetExceptionBreakpointsRequest{} },
"dataBreakpointInfo": func() Message { return &DataBreakpointInfoRequest{} },
"setDataBreakpoints": func() Message { return &SetDataBreakpointsRequest{} },
"setInstructionBreakpoints": func() Message { return &SetInstructionBreakpointsRequest{} },
"continue": func() Message { return &ContinueRequest{} },
"next": func() Message { return &NextRequest{} },
"stepIn": func() Message { return &StepInRequest{} },
"stepOut": func() Message { return &StepOutRequest{} },
"stepBack": func() Message { return &StepBackRequest{} },
"reverseContinue": func() Message { return &ReverseContinueRequest{} },
"restartFrame": func() Message { return &RestartFrameRequest{} },
"goto": func() Message { return &GotoRequest{} },
"pause": func() Message { return &PauseRequest{} },
"stackTrace": func() Message { return &StackTraceRequest{} },
"scopes": func() Message { return &ScopesRequest{} },
"variables": func() Message { return &VariablesRequest{} },
"setVariable": func() Message { return &SetVariableRequest{} },
"source": func() Message { return &SourceRequest{} },
"threads": func() Message { return &ThreadsRequest{} },
"terminateThreads": func() Message { return &TerminateThreadsRequest{} },
"modules": func() Message { return &ModulesRequest{} },
"loadedSources": func() Message { return &LoadedSourcesRequest{} },
"evaluate": func() Message { return &EvaluateRequest{} },
"setExpression": func() Message { return &SetExpressionRequest{} },
"stepInTargets": func() Message { return &StepInTargetsRequest{} },
"gotoTargets": func() Message { return &GotoTargetsRequest{} },
"completions": func() Message { return &CompletionsRequest{} },
"exceptionInfo": func() Message { return &ExceptionInfoRequest{} },
"readMemory": func() Message { return &ReadMemoryRequest{} },
"writeMemory": func() Message { return &WriteMemoryRequest{} },
"disassemble": func() Message { return &DisassembleRequest{} },
}
// Mapping of response commands and corresponding struct constructors that
// can be passed to json.Unmarshal.
var responseCtor = map[string]messageCtor{
"cancel": func() Message { return &CancelResponse{} },
"runInTerminal": func() Message { return &RunInTerminalResponse{} },
"initialize": func() Message { return &InitializeResponse{} },
"configurationDone": func() Message { return &ConfigurationDoneResponse{} },
"launch": func() Message { return &LaunchResponse{} },
"attach": func() Message { return &AttachResponse{} },
"restart": func() Message { return &RestartResponse{} },
"disconnect": func() Message { return &DisconnectResponse{} },
"terminate": func() Message { return &TerminateResponse{} },
"breakpointLocations": func() Message { return &BreakpointLocationsResponse{} },
"setBreakpoints": func() Message { return &SetBreakpointsResponse{} },
"setFunctionBreakpoints": func() Message { return &SetFunctionBreakpointsResponse{} },
"setExceptionBreakpoints": func() Message { return &SetExceptionBreakpointsResponse{} },
"dataBreakpointInfo": func() Message { return &DataBreakpointInfoResponse{} },
"setDataBreakpoints": func() Message { return &SetDataBreakpointsResponse{} },
"setInstructionBreakpoints": func() Message { return &SetInstructionBreakpointsResponse{} },
"continue": func() Message { return &ContinueResponse{} },
"next": func() Message { return &NextResponse{} },
"stepIn": func() Message { return &StepInResponse{} },
"stepOut": func() Message { return &StepOutResponse{} },
"stepBack": func() Message { return &StepBackResponse{} },
"reverseContinue": func() Message { return &ReverseContinueResponse{} },
"restartFrame": func() Message { return &RestartFrameResponse{} },
"goto": func() Message { return &GotoResponse{} },
"pause": func() Message { return &PauseResponse{} },
"stackTrace": func() Message { return &StackTraceResponse{} },
"scopes": func() Message { return &ScopesResponse{} },
"variables": func() Message { return &VariablesResponse{} },
"setVariable": func() Message { return &SetVariableResponse{} },
"source": func() Message { return &SourceResponse{} },
"threads": func() Message { return &ThreadsResponse{} },
"terminateThreads": func() Message { return &TerminateThreadsResponse{} },
"modules": func() Message { return &ModulesResponse{} },
"loadedSources": func() Message { return &LoadedSourcesResponse{} },
"evaluate": func() Message { return &EvaluateResponse{} },
"setExpression": func() Message { return &SetExpressionResponse{} },
"stepInTargets": func() Message { return &StepInTargetsResponse{} },
"gotoTargets": func() Message { return &GotoTargetsResponse{} },
"completions": func() Message { return &CompletionsResponse{} },
"exceptionInfo": func() Message { return &ExceptionInfoResponse{} },
"readMemory": func() Message { return &ReadMemoryResponse{} },
"writeMemory": func() Message { return &WriteMemoryResponse{} },
"disassemble": func() Message { return &DisassembleResponse{} },
}
// Mapping of event ids and corresponding struct constructors that
// can be passed to json.Unmarshal.
var eventCtor = map[string]messageCtor{
"initialized": func() Message { return &InitializedEvent{} },
"stopped": func() Message { return &StoppedEvent{} },
"continued": func() Message { return &ContinuedEvent{} },
"exited": func() Message { return &ExitedEvent{} },
"terminated": func() Message { return &TerminatedEvent{} },
"thread": func() Message { return &ThreadEvent{} },
"output": func() Message { return &OutputEvent{} },
"breakpoint": func() Message { return &BreakpointEvent{} },
"module": func() Message { return &ModuleEvent{} },
"loadedSource": func() Message { return &LoadedSourceEvent{} },
"process": func() Message { return &ProcessEvent{} },
"capabilities": func() Message { return &CapabilitiesEvent{} },
"progressStart": func() Message { return &ProgressStartEvent{} },
"progressUpdate": func() Message { return &ProgressUpdateEvent{} },
"progressEnd": func() Message { return &ProgressEndEvent{} },
"invalidated": func() Message { return &InvalidatedEvent{} },
"memory": func() Message { return &MemoryEvent{} },
}
...@@ -13,7 +13,7 @@ github.com/creack/pty ...@@ -13,7 +13,7 @@ github.com/creack/pty
# github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9 # github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9
## explicit ## explicit
github.com/derekparker/trie github.com/derekparker/trie
# github.com/google/go-dap v0.5.1-0.20210713061233-c91b005e3987 # github.com/google/go-dap v0.6.0
## explicit ## explicit
github.com/google/go-dap github.com/google/go-dap
# github.com/hashicorp/golang-lru v0.5.4 # github.com/hashicorp/golang-lru v0.5.4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册