diff --git a/go.mod b/go.mod index 7decf342b1541742f9c143c4cef2e9c93b091d45..4ba1ded6fe16b0ad8d3542ddb4abcc546b9e1d90 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/cosiner/argv v0.1.0 github.com/creack/pty v1.1.9 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/mattn/go-colorable v0.0.9 github.com/mattn/go-isatty v0.0.3 diff --git a/go.sum b/go.sum index 261e8a59c489bbb8d3167cc76ba8122f02dc56f5..ab2954078c76d7e552730086a36dd3eab4f0700a 100644 --- a/go.sum +++ b/go.sum @@ -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/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-dap v0.5.1-0.20210713061233-c91b005e3987 h1:aghNk+kvabZ5I1OC3cNHWvfZ8svcoDLAGyKYimqyGVk= -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 h1:Y1RHGUtv3R8y6sXq2dtGRMYrFB2hSqyFVws7jucrzX4= +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/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= diff --git a/vendor/github.com/google/go-dap/.travis.yml b/vendor/github.com/google/go-dap/.travis.yml deleted file mode 100644 index b02126890467deedefdb2d0d18548bf36ce53b94..0000000000000000000000000000000000000000 --- a/vendor/github.com/google/go-dap/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# 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' diff --git a/vendor/github.com/google/go-dap/README.md b/vendor/github.com/google/go-dap/README.md index 4e5d11c8f48a7c6e324b0352858e7dff33f367e4..fbbe01e68efdc7ec8f6f985dcc848bd3db9fe2ea 100644 --- a/vendor/github.com/google/go-dap/README.md +++ b/vendor/github.com/google/go-dap/README.md @@ -1,7 +1,7 @@ # 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) -[![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) For an overview of DAP, see diff --git a/vendor/github.com/google/go-dap/codec.go b/vendor/github.com/google/go-dap/codec.go index f9cd799d5a84091bdd19d4a21be7d0ab96fd4774..50b14a50183ef860ca0bac76adb7908e6c5624cb 100644 --- a/vendor/github.com/google/go-dap/codec.go +++ b/vendor/github.com/google/go-dap/codec.go @@ -73,61 +73,6 @@ func decodeRequest(data []byte) (Message, error) { 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 // data corresponds to and uses json.Unmarshal to populate the corresponding // struct to be returned. @@ -149,52 +94,6 @@ func decodeResponse(data []byte) (Message, error) { 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 // data corresponds to and uses json.Unmarshal to populate the corresponding // struct to be returned. @@ -210,20 +109,3 @@ func decodeEvent(data []byte) (Message, error) { } 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{} }, -} diff --git a/vendor/github.com/google/go-dap/schematypes.go b/vendor/github.com/google/go-dap/schematypes.go index 6397822ae2baa75dd692ecb4aa79628ed1a78636..1d93058f2433184889205c603108910de3a9b41e 100644 --- a/vendor/github.com/google/go-dap/schematypes.go +++ b/vendor/github.com/google/go-dap/schematypes.go @@ -394,6 +394,23 @@ type InvalidatedEventBody struct { 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. // 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. @@ -456,6 +473,7 @@ type InitializeRequestArguments struct { SupportsMemoryReferences bool `json:"supportsMemoryReferences,omitempty"` SupportsProgressReporting bool `json:"supportsProgressReporting,omitempty"` SupportsInvalidatedEvent bool `json:"supportsInvalidatedEvent,omitempty"` + SupportsMemoryEvent bool `json:"supportsMemoryEvent,omitempty"` } // InitializeResponse: Response to 'initialize' request. @@ -1133,6 +1151,7 @@ type VariablesResponseBody struct { 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. +// 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 { Request @@ -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. // 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. +// 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 { Request @@ -1523,6 +1543,38 @@ type ReadMemoryResponseBody struct { 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. // Clients should only call this request if the capability 'supportsDisassembleRequest' is true. type DisassembleRequest struct { @@ -1587,6 +1639,7 @@ type Capabilities struct { SupportsTerminateRequest bool `json:"supportsTerminateRequest,omitempty"` SupportsDataBreakpoints bool `json:"supportsDataBreakpoints,omitempty"` SupportsReadMemoryRequest bool `json:"supportsReadMemoryRequest,omitempty"` + SupportsWriteMemoryRequest bool `json:"supportsWriteMemoryRequest,omitempty"` SupportsDisassembleRequest bool `json:"supportsDisassembleRequest,omitempty"` SupportsCancelRequest bool `json:"supportsCancelRequest,omitempty"` SupportsBreakpointLocationsRequest bool `json:"supportsBreakpointLocationsRequest,omitempty"` @@ -1612,7 +1665,7 @@ type ErrorMessage struct { Format string `json:"format"` Variables map[string]string `json:"variables,omitempty"` SendTelemetry bool `json:"sendTelemetry,omitempty"` - ShowUser bool `json:"showUser,omitempty"` + ShowUser bool `json:"showUser"` Url string `json:"url,omitempty"` UrlLabel string `json:"urlLabel,omitempty"` } @@ -1901,3 +1954,130 @@ type DisassembledInstruction struct { // InvalidatedAreas: Logical areas that can be invalidated by the 'invalidated' event. 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{} }, +} diff --git a/vendor/modules.txt b/vendor/modules.txt index d00c40275270c30378049325382c5f1a83de5640..28047986cf2bed50f43d9cf295d1fba4030209d8 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -13,7 +13,7 @@ github.com/creack/pty # github.com/derekparker/trie v0.0.0-20200317170641-1fdf38b7b0e9 ## explicit github.com/derekparker/trie -# github.com/google/go-dap v0.5.1-0.20210713061233-c91b005e3987 +# github.com/google/go-dap v0.6.0 ## explicit github.com/google/go-dap # github.com/hashicorp/golang-lru v0.5.4