From e10691ab3f979e69a4b4151a496ef075863837ed Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Wed, 13 Jan 2021 19:28:09 +0000 Subject: [PATCH] Update DAP protocol to 1.43.0 --- include/dap/protocol.h | 137 ++++++++++++++++++++++++++++++-------- src/protocol_events.cpp | 8 ++- src/protocol_requests.cpp | 4 +- src/protocol_response.cpp | 3 +- src/protocol_types.cpp | 14 +++- 5 files changed, 132 insertions(+), 34 deletions(-) diff --git a/include/dap/protocol.h b/include/dap/protocol.h index c45d421..0d13547 100644 --- a/include/dap/protocol.h +++ b/include/dap/protocol.h @@ -15,7 +15,7 @@ // Generated with protocol_gen.go -- do not edit this file. // go run scripts/protocol_gen/protocol_gen.go // -// DAP version 1.41.0 +// DAP version 1.43.0 #ifndef dap_protocol_h #define dap_protocol_h @@ -102,7 +102,7 @@ struct Source { // If sourceReference > 0 the contents of the source must be retrieved through // the SourceRequest (even if a path is specified). A sourceReference is only // valid for a session, so it must not be used to persist a source. The value - // should be less than or equal to 2147483647 (2^31 - 1). + // should be less than or equal to 2147483647 (2^31-1). optional sourceReference; // An optional list of sources that are related to this source. These may be // the source that generated this source. @@ -269,16 +269,20 @@ struct ColumnDescriptor { DAP_DECLARE_STRUCT_TYPEINFO(ColumnDescriptor); -// An ExceptionBreakpointsFilter is shown in the UI as an option for configuring -// how exceptions are dealt with. +// An ExceptionBreakpointsFilter is shown in the UI as an filter option for +// configuring how exceptions are dealt with. struct ExceptionBreakpointsFilter { - // Initial value of the filter. If not specified a value 'false' is assumed. + // Initial value of the filter option. If not specified a value 'false' is + // assumed. optional def; - // The internal ID of the filter. This value is passed to the - // setExceptionBreakpoints request. + // The internal ID of the filter option. This value is passed to the + // 'setExceptionBreakpoints' request. string filter; - // The name of the filter. This will be shown in the UI. + // The name of the filter option. This will be shown in the UI. string label; + // Controls whether a condition can be specified for this filter option. If + // false or missing, a condition can not be set. + optional supportsCondition; }; DAP_DECLARE_STRUCT_TYPEINFO(ExceptionBreakpointsFilter); @@ -290,7 +294,8 @@ struct Capabilities { // The set of characters that should trigger completion in a REPL. If not // specified, the UI should assume the '.' character. optional> completionTriggerCharacters; - // Available filters or options for the setExceptionBreakpoints request. + // Available exception filter options for the 'setExceptionBreakpoints' + // request. optional> exceptionBreakpointFilters; // The debug adapter supports the 'terminateDebuggee' attribute on the // 'disconnect' request. @@ -321,6 +326,9 @@ struct Capabilities { // The debug adapter supports a (side effect free) evaluate request for data // hovers. optional supportsEvaluateForHovers; + // The debug adapter supports 'filterOptions' as an argument on the + // 'setExceptionBreakpoints' request. + optional supportsExceptionFilterOptions; // The debug adapter supports the 'exceptionInfo' request. optional supportsExceptionInfoRequest; // The debug adapter supports 'exceptionOptions' on the @@ -703,7 +711,7 @@ struct EvaluateResponse : public Response { // The number of indexed child variables. // The client can use this optional information to present the variables in a // paged UI and fetch them in chunks. The value should be less than or equal - // to 2147483647 (2^31 - 1). + // to 2147483647 (2^31-1). optional indexedVariables; // Optional memory reference to a location appropriate for this result. // For pointer type eval results, this is generally a reference to the memory @@ -714,7 +722,7 @@ struct EvaluateResponse : public Response { // The number of named child variables. // The client can use this optional information to present the variables in a // paged UI and fetch them in chunks. The value should be less than or equal - // to 2147483647 (2^31 - 1). + // to 2147483647 (2^31-1). optional namedVariables; // Properties of a evaluate result that can be used to determine how to render // the result in the UI. @@ -729,7 +737,7 @@ struct EvaluateResponse : public Response { // If variablesReference is > 0, the evaluate result is structured and its // children can be retrieved by passing variablesReference to the // VariablesRequest. The value should be less than or equal to 2147483647 - // (2^31 - 1). + // (2^31-1). integer variablesReference; }; @@ -902,7 +910,8 @@ struct InitializeResponse : public Response { // The set of characters that should trigger completion in a REPL. If not // specified, the UI should assume the '.' character. optional> completionTriggerCharacters; - // Available filters or options for the setExceptionBreakpoints request. + // Available exception filter options for the 'setExceptionBreakpoints' + // request. optional> exceptionBreakpointFilters; // The debug adapter supports the 'terminateDebuggee' attribute on the // 'disconnect' request. @@ -933,6 +942,9 @@ struct InitializeResponse : public Response { // The debug adapter supports a (side effect free) evaluate request for data // hovers. optional supportsEvaluateForHovers; + // The debug adapter supports 'filterOptions' as an argument on the + // 'setExceptionBreakpoints' request. + optional supportsExceptionFilterOptions; // The debug adapter supports the 'exceptionInfo' request. optional supportsExceptionInfoRequest; // The debug adapter supports 'exceptionOptions' on the @@ -1015,6 +1027,8 @@ struct InitializeRequest : public Request { // May be one of the following enumeration values: // 'path', 'uri' optional pathFormat; + // Client supports the invalidated event. + optional supportsInvalidatedEvent; // Client supports memory references. optional supportsMemoryReferences; // Client supports progress reporting. @@ -1049,6 +1063,35 @@ struct InitializedEvent : public Event {}; DAP_DECLARE_STRUCT_TYPEINFO(InitializedEvent); +// Logical areas that can be invalidated by the 'invalidated' event. +struct InvalidatedAreas {}; + +DAP_DECLARE_STRUCT_TYPEINFO(InvalidatedAreas); + +// This event signals that some state in the debug adapter has changed and +// requires that the client needs to re-render the data snapshot previously +// requested. Debug adapters do not have to emit this event for runtime changes +// like stopped or thread events because in that case the client refetches the +// new state anyway. But the event can be used for example to refresh the UI +// after rendering formatting has changed in the debug adapter. This event +// should only be sent if the debug adapter has received a value true for the +// 'supportsInvalidatedEvent' capability of the 'initialize' request. +struct InvalidatedEvent : public Event { + // Optional set of logical areas that got invalidated. This property has a + // hint characteristic: a client can only be expected to make a 'best effort' + // in honouring the areas but there are no guarantees. If this property is + // missing, empty, or if values are not understand the client should assume a + // single value 'all'. + optional> areas; + // If specified, the client only needs to refetch data related to this stack + // frame (and the 'threadId' is ignored). + optional stackFrameId; + // If specified, the client only needs to refetch data related to this thread. + optional threadId; +}; + +DAP_DECLARE_STRUCT_TYPEINFO(InvalidatedEvent); + // Response to 'launch' request. This is just an acknowledgement, so no body // field is required. struct LaunchResponse : public Response {}; @@ -1241,7 +1284,7 @@ struct OutputEvent : public Event { // If an attribute 'variablesReference' exists and its value is > 0, the // output contains objects which can be retrieved by passing // 'variablesReference' to the 'variables' request. The value should be less - // than or equal to 2147483647 (2^31 - 1). + // than or equal to 2147483647 (2^31-1). optional variablesReference; }; @@ -1327,7 +1370,7 @@ struct ProgressStartEvent : public Event { // request until the request has been either completed or cancelled. If the // request ID is omitted, the progress report is assumed to be related to some // general activity of the debug adapter. - optional requestId; + optional requestId; // Mandatory (short) title of the progress reporting. Shown in the UI to // describe the long running operation. string title; @@ -1439,11 +1482,11 @@ DAP_DECLARE_STRUCT_TYPEINFO(ReverseContinueRequest); // Response to 'runInTerminal' request. struct RunInTerminalResponse : public Response { - // The process ID. The value should be less than or equal to 2147483647 (2^31 - // - 1). + // The process ID. The value should be less than or equal to 2147483647 + // (2^31-1). optional processId; // The process ID of the terminal shell. The value should be less than or - // equal to 2147483647 (2^31 - 1). + // equal to 2147483647 (2^31-1). optional shellProcessId; }; @@ -1458,7 +1501,8 @@ struct RunInTerminalRequest : public Request { using Response = RunInTerminalResponse; // List of arguments. The first argument is the command to run. array args; - // Working directory of the command. + // Working directory for the command. For non-empty, valid paths this + // typically results in execution of a change directory command. string cwd; // Environment key-value pairs that are added to or removed from the default // environment. @@ -1663,6 +1707,20 @@ struct ExceptionOptions { DAP_DECLARE_STRUCT_TYPEINFO(ExceptionOptions); +// An ExceptionFilterOptions is used to specify an exception filter together +// with a condition for the setExceptionsFilter request. +struct ExceptionFilterOptions { + // An optional expression for conditional exceptions. + // The exception will break into the debugger if the result of the condition + // is true. + optional condition; + // ID of an exception filter returned by the 'exceptionBreakpointFilters' + // capability. + string filterId; +}; + +DAP_DECLARE_STRUCT_TYPEINFO(ExceptionFilterOptions); + // The request configures the debuggers response to thrown exceptions. // If an exception is configured to break, a 'stopped' event is fired (with // reason 'exception'). Clients should only call this request if the capability @@ -1673,8 +1731,15 @@ struct SetExceptionBreakpointsRequest : public Request { // The attribute is only honored by a debug adapter if the capability // 'supportsExceptionOptions' is true. optional> exceptionOptions; - // IDs of checked exception options. The set of IDs is returned via the - // 'exceptionBreakpointFilters' capability. + // Set of exception filters and their options. The set of all possible + // exception filters is defined by the 'exceptionBreakpointFilters' + // capability. This attribute is only honored by a debug adapter if the + // capability 'supportsExceptionFilterOptions' is true. The 'filter' and + // 'filterOptions' sets are additive. + optional> filterOptions; + // Set of exception filters specified by their ID. The set of all possible + // exception filters is defined by the 'exceptionBreakpointFilters' + // capability. The 'filter' and 'filterOptions' sets are additive. array filters; }; @@ -1685,12 +1750,12 @@ struct SetExpressionResponse : public Response { // The number of indexed child variables. // The client can use this optional information to present the variables in a // paged UI and fetch them in chunks. The value should be less than or equal - // to 2147483647 (2^31 - 1). + // to 2147483647 (2^31-1). optional indexedVariables; // The number of named child variables. // The client can use this optional information to present the variables in a // paged UI and fetch them in chunks. The value should be less than or equal - // to 2147483647 (2^31 - 1). + // to 2147483647 (2^31-1). optional namedVariables; // Properties of a value that can be used to determine how to render the // result in the UI. @@ -1704,7 +1769,7 @@ struct SetExpressionResponse : public Response { string value; // If variablesReference is > 0, the value is structured and its children can // be retrieved by passing variablesReference to the VariablesRequest. The - // value should be less than or equal to 2147483647 (2^31 - 1). + // value should be less than or equal to 2147483647 (2^31-1). optional variablesReference; }; @@ -1820,12 +1885,12 @@ struct SetVariableResponse : public Response { // The number of indexed child variables. // The client can use this optional information to present the variables in a // paged UI and fetch them in chunks. The value should be less than or equal - // to 2147483647 (2^31 - 1). + // to 2147483647 (2^31-1). optional indexedVariables; // The number of named child variables. // The client can use this optional information to present the variables in a // paged UI and fetch them in chunks. The value should be less than or equal - // to 2147483647 (2^31 - 1). + // to 2147483647 (2^31-1). optional namedVariables; // The type of the new value. Typically shown in the UI when hovering over the // value. @@ -1834,7 +1899,7 @@ struct SetVariableResponse : public Response { string value; // If variablesReference is > 0, the new value is structured and its children // can be retrieved by passing variablesReference to the VariablesRequest. The - // value should be less than or equal to 2147483647 (2^31 - 1). + // value should be less than or equal to 2147483647 (2^31-1). optional variablesReference; }; @@ -1924,7 +1989,12 @@ struct StackTraceResponse : public Response { // stackframes available. This means that there is no location information // available. array stackFrames; - // The total number of frames available. + // The total number of frames available in the stack. If omitted or if + // totalFrames is larger than the available frames, a client is expected to + // request frames until a request returns less frames than requested (which + // indicates the end of the stack). Returning monotonically increasing + // totalFrames values for subsequent requests can be used to enforce paging in + // the client. optional totalFrames; }; @@ -1951,7 +2021,16 @@ struct StackFrameFormat : public ValueFormat { DAP_DECLARE_STRUCT_TYPEINFO(StackFrameFormat); -// The request returns a stacktrace from the current execution state. +// The request returns a stacktrace from the current execution state of a given +// thread. A client can request all stack frames by omitting the startFrame and +// levels arguments. For performance conscious clients stack frames can be +// retrieved in a piecemeal way with the startFrame and levels arguments. The +// response of the stackTrace request may contain a totalFrames property that +// hints at the total number of frames in the stack. If a client needs this +// total number upfront, it can issue a request for a single (first) frame and +// depending on the value of totalFrames decide how to proceed. In any case a +// client should be prepared to receive less frames than requested, which is an +// indication that the end of the stack has been reached. struct StackTraceRequest : public Request { using Response = StackTraceResponse; // Specifies details on how to format the stack frames. diff --git a/src/protocol_events.cpp b/src/protocol_events.cpp index 5be9e9f..3743481 100644 --- a/src/protocol_events.cpp +++ b/src/protocol_events.cpp @@ -15,7 +15,7 @@ // Generated with protocol_gen.go -- do not edit this file. // go run scripts/protocol_gen/protocol_gen.go // -// DAP version 1.41.0 +// DAP version 1.43.0 #include "dap/protocol.h" @@ -42,6 +42,12 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ExitedEvent, DAP_IMPLEMENT_STRUCT_TYPEINFO(InitializedEvent, "initialized"); +DAP_IMPLEMENT_STRUCT_TYPEINFO(InvalidatedEvent, + "invalidated", + DAP_FIELD(areas, "areas"), + DAP_FIELD(stackFrameId, "stackFrameId"), + DAP_FIELD(threadId, "threadId")); + DAP_IMPLEMENT_STRUCT_TYPEINFO(LoadedSourceEvent, "loadedSource", DAP_FIELD(reason, "reason"), diff --git a/src/protocol_requests.cpp b/src/protocol_requests.cpp index bdfb7c3..c76b5ff 100644 --- a/src/protocol_requests.cpp +++ b/src/protocol_requests.cpp @@ -15,7 +15,7 @@ // Generated with protocol_gen.go -- do not edit this file. // go run scripts/protocol_gen/protocol_gen.go // -// DAP version 1.41.0 +// DAP version 1.43.0 #include "dap/protocol.h" @@ -103,6 +103,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO( DAP_FIELD(linesStartAt1, "linesStartAt1"), DAP_FIELD(locale, "locale"), DAP_FIELD(pathFormat, "pathFormat"), + DAP_FIELD(supportsInvalidatedEvent, "supportsInvalidatedEvent"), DAP_FIELD(supportsMemoryReferences, "supportsMemoryReferences"), DAP_FIELD(supportsProgressReporting, "supportsProgressReporting"), DAP_FIELD(supportsRunInTerminalRequest, "supportsRunInTerminalRequest"), @@ -172,6 +173,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SetDataBreakpointsRequest, DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExceptionBreakpointsRequest, "setExceptionBreakpoints", DAP_FIELD(exceptionOptions, "exceptionOptions"), + DAP_FIELD(filterOptions, "filterOptions"), DAP_FIELD(filters, "filters")); DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExpressionRequest, diff --git a/src/protocol_response.cpp b/src/protocol_response.cpp index 99a278f..f96c3cf 100644 --- a/src/protocol_response.cpp +++ b/src/protocol_response.cpp @@ -15,7 +15,7 @@ // Generated with protocol_gen.go -- do not edit this file. // go run scripts/protocol_gen/protocol_gen.go // -// DAP version 1.41.0 +// DAP version 1.43.0 #include "dap/protocol.h" @@ -100,6 +100,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO( "supportsDelayedStackTraceLoading"), DAP_FIELD(supportsDisassembleRequest, "supportsDisassembleRequest"), DAP_FIELD(supportsEvaluateForHovers, "supportsEvaluateForHovers"), + DAP_FIELD(supportsExceptionFilterOptions, "supportsExceptionFilterOptions"), DAP_FIELD(supportsExceptionInfoRequest, "supportsExceptionInfoRequest"), DAP_FIELD(supportsExceptionOptions, "supportsExceptionOptions"), DAP_FIELD(supportsFunctionBreakpoints, "supportsFunctionBreakpoints"), diff --git a/src/protocol_types.cpp b/src/protocol_types.cpp index 61047cd..a9e5355 100644 --- a/src/protocol_types.cpp +++ b/src/protocol_types.cpp @@ -15,7 +15,7 @@ // Generated with protocol_gen.go -- do not edit this file. // go run scripts/protocol_gen/protocol_gen.go // -// DAP version 1.41.0 +// DAP version 1.43.0 #include "dap/protocol.h" @@ -72,7 +72,9 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionBreakpointsFilter, "", DAP_FIELD(def, "default"), DAP_FIELD(filter, "filter"), - DAP_FIELD(label, "label")); + DAP_FIELD(label, "label"), + DAP_FIELD(supportsCondition, + "supportsCondition")); DAP_IMPLEMENT_STRUCT_TYPEINFO( Capabilities, @@ -95,6 +97,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO( "supportsDelayedStackTraceLoading"), DAP_FIELD(supportsDisassembleRequest, "supportsDisassembleRequest"), DAP_FIELD(supportsEvaluateForHovers, "supportsEvaluateForHovers"), + DAP_FIELD(supportsExceptionFilterOptions, "supportsExceptionFilterOptions"), DAP_FIELD(supportsExceptionInfoRequest, "supportsExceptionInfoRequest"), DAP_FIELD(supportsExceptionOptions, "supportsExceptionOptions"), DAP_FIELD(supportsFunctionBreakpoints, "supportsFunctionBreakpoints"), @@ -186,6 +189,8 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(GotoTarget, DAP_FIELD(label, "label"), DAP_FIELD(line, "line")); +DAP_IMPLEMENT_STRUCT_TYPEINFO(InvalidatedAreas, ""); + DAP_IMPLEMENT_STRUCT_TYPEINFO(Module, "", DAP_FIELD(addressRange, "addressRange"), @@ -241,6 +246,11 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionOptions, DAP_FIELD(breakMode, "breakMode"), DAP_FIELD(path, "path")); +DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionFilterOptions, + "", + DAP_FIELD(condition, "condition"), + DAP_FIELD(filterId, "filterId")); + DAP_IMPLEMENT_STRUCT_TYPEINFO(FunctionBreakpoint, "", DAP_FIELD(condition, "condition"),