From 1c2b58a3a153f45e974073104bced5ccaf9229f0 Mon Sep 17 00:00:00 2001 From: nikitalita <69168929+nikitalita@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:51:54 -0700 Subject: [PATCH] Update to 1.65.0 --- CMakeLists.txt | 2 +- fuzz/dictionary.txt | 6 ++ fuzz/fuzz.h | 2 +- include/dap/protocol.h | 161 +++++++++++++++++++++++++++++--------- src/protocol_events.cpp | 2 +- src/protocol_requests.cpp | 3 +- src/protocol_response.cpp | 5 +- src/protocol_types.cpp | 19 ++++- 8 files changed, 157 insertions(+), 43 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7328c58..9e34e17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ cmake_minimum_required(VERSION 3.13) -project(cppdap VERSION 1.59.0 LANGUAGES CXX C) +project(cppdap VERSION 1.65.0 LANGUAGES CXX C) set (CMAKE_CXX_STANDARD 11) diff --git a/fuzz/dictionary.txt b/fuzz/dictionary.txt index 73a343c..0fcdbcd 100644 --- a/fuzz/dictionary.txt +++ b/fuzz/dictionary.txt @@ -15,6 +15,7 @@ "allThreadsStopped" "allowPartial" "always" +"appliesTo" "areas" "args" "argsCanBeInterpretedByShell" @@ -29,6 +30,7 @@ "breakMode" "breakpoint" "breakpointLocations" +"breakpointModes" "breakpoints" "bytesWritten" "canPersist" @@ -98,6 +100,7 @@ "expensive" "expression" "external" +"failed" "field" "file" "filter" @@ -138,6 +141,7 @@ "integrated" "interface" "internal" +"invalid" "invalidated" "isLocalProcess" "isOptimized" @@ -163,6 +167,7 @@ "message" "method" "mimeType" +"mode" "module" "moduleCount" "moduleId" @@ -190,6 +195,7 @@ "path" "pathFormat" "pause" +"pending" "percentage" "pointerSize" "presentationHint" diff --git a/fuzz/fuzz.h b/fuzz/fuzz.h index a35800c..6f1effd 100644 --- a/fuzz/fuzz.h +++ b/fuzz/fuzz.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.59.0 +// DAP version 1.65.0 #ifndef dap_fuzzer_h #define dap_fuzzer_h diff --git a/include/dap/protocol.h b/include/dap/protocol.h index e4c479e..96a18c9 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.59.0 +// DAP version 1.65.0 #ifndef dap_protocol_h #define dap_protocol_h @@ -141,6 +141,18 @@ struct Breakpoint { // The offset from the instruction reference. // This can be negative. optional offset; + // A machine-readable explanation of why a breakpoint may not be verified. If + // a breakpoint is verified or a specific reason is not known, the adapter + // should omit this property. Possible values include: + // + // - `pending`: Indicates a breakpoint might be verified in the future, but + // the adapter cannot verify it in the current state. + // - `failed`: Indicates a breakpoint was not able to be verified, and the + // adapter does not believe it can be verified without intervention. + // + // Must be one of the following enumeration values: + // 'pending', 'failed' + optional reason; // The source where the breakpoint is located. optional source; // If true, the breakpoint could be set (but not necessarily at the desired @@ -214,7 +226,7 @@ struct BreakpointLocationsRequest : public Request { // line is specified, the request returns all possible locations in that line. integer line; // The source location of the breakpoints; either `source.path` or - // `source.reference` must be specified. + // `source.sourceReference` must be specified. Source source; }; @@ -229,18 +241,19 @@ DAP_DECLARE_STRUCT_TYPEINFO(CancelResponse); // The `cancel` request is used by the client in two situations: // - to indicate that it is no longer interested in the result produced by a // specific request issued earlier -// - to cancel a progress sequence. Clients should only call this request if the -// corresponding capability `supportsCancelRequest` is true. This request has a -// hint characteristic: a debug adapter can only be expected to make a 'best -// effort' in honoring this request but there are no guarantees. The `cancel` -// request may return an error if it could not cancel an operation but a client -// should refrain from presenting this error to end users. The request that got -// cancelled still needs to send a response back. This can either be a normal -// result (`success` attribute true) or an error response (`success` attribute -// false and the `message` set to `cancelled`). Returning partial results from a -// cancelled request is possible but please note that a client has no generic -// way for detecting that a response is partial or not. The progress that got -// cancelled still needs to send a `progressEnd` event back. +// - to cancel a progress sequence. +// Clients should only call this request if the corresponding capability +// `supportsCancelRequest` is true. This request has a hint characteristic: a +// debug adapter can only be expected to make a 'best effort' in honoring this +// request but there are no guarantees. The `cancel` request may return an error +// if it could not cancel an operation but a client should refrain from +// presenting this error to end users. The request that got cancelled still +// needs to send a response back. This can either be a normal result (`success` +// attribute true) or an error response (`success` attribute false and the +// `message` set to `cancelled`). Returning partial results from a cancelled +// request is possible but please note that a client has no generic way for +// detecting that a response is partial or not. The progress that got cancelled +// still needs to send a `progressEnd` event back. // A client should not assume that progress just got cancelled after sending // the `cancel` request. struct CancelRequest : public Request { @@ -280,6 +293,28 @@ struct ColumnDescriptor { DAP_DECLARE_STRUCT_TYPEINFO(ColumnDescriptor); +// Describes one or more type of breakpoint a `BreakpointMode` applies to. This +// is a non-exhaustive enumeration and may expand as future breakpoint types are +// added. +using BreakpointModeApplicability = string; + +// A `BreakpointMode` is provided as a option when setting breakpoints on +// sources or instructions. +struct BreakpointMode { + // Describes one or more type of breakpoint this mode applies to. + array appliesTo; + // A help text providing additional information about the breakpoint mode. + // This string is typically shown as a hover and can be translated. + optional description; + // The name of the breakpoint mode. This is shown in the UI. + string label; + // The internal ID of the mode. This value is passed to the `setBreakpoints` + // request. + string mode; +}; + +DAP_DECLARE_STRUCT_TYPEINFO(BreakpointMode); + // An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for // configuring how exceptions are dealt with. struct ExceptionBreakpointsFilter { @@ -308,6 +343,13 @@ DAP_DECLARE_STRUCT_TYPEINFO(ExceptionBreakpointsFilter); struct Capabilities { // The set of additional module information exposed by the debug adapter. optional> additionalModuleColumns; + // Modes of breakpoints supported by the debug adapter, such as 'hardware' or + // 'software'. If present, the client may allow the user to select a mode and + // include it in its `setBreakpoints` request. + // + // Clients may present the first applicable mode in this array as the + // 'default' mode in gestures that set breakpoints. + optional> breakpointModes; // The set of characters that should trigger completion in a REPL. If not // specified, the UI should assume the `.` character. optional> completionTriggerCharacters; @@ -579,7 +621,11 @@ struct DataBreakpointInfoResponse : public Response { optional canPersist; // An identifier for the data on which a data breakpoint can be registered // with the `setDataBreakpoints` request or null if no data breakpoint is - // available. + // available. If a `variablesReference` or `frameId` is passed, the `dataId` + // is valid in the current suspended state, otherwise it's valid indefinitely. + // See 'Lifetime of Object References' in the Overview section for details. + // Breakpoints set using the `dataId` in the `setDataBreakpoints` request may + // outlive the lifetime of the associated `dataId`. variant dataId; // UI string that describes on what data the breakpoint is set on or why a // data breakpoint is not available. @@ -597,6 +643,9 @@ struct DataBreakpointInfoRequest : public Request { // If not specified, the expression is evaluated in the global scope. When // `variablesReference` is specified, this property has no effect. optional frameId; + // The mode of the desired breakpoint. If defined, this must be one of the + // `breakpointModes` the debug adapter advertised in its `Capabilities`. + optional mode; // The name of the variable's child to obtain data breakpoint information for. // If `variablesReference` isn't specified, this can be an expression. string name; @@ -634,6 +683,15 @@ struct DisassembledInstruction { // but can be omitted afterwards if this instruction maps to the same source // file as the previous instruction. optional location; + // A hint for how to present the instruction in the UI. + // + // A value of `invalid` may be used to indicate this instruction is 'filler' + // and cannot be reached by the program. For example, unreadable memory + // addresses may be presented is 'invalid.' + // + // Must be one of the following enumeration values: + // 'normal', 'invalid' + optional presentationHint; // Name of the symbol that corresponds with the location of this instruction, // if any. optional symbol; @@ -785,9 +843,8 @@ struct EvaluateResponse : public Response { optional indexedVariables; // A memory reference to a location appropriate for this result. // For pointer type eval results, this is generally a reference to the memory - // address contained in the pointer. This attribute should be returned by a - // debug adapter if corresponding capability `supportsMemoryReferences` is - // true. + // address contained in the pointer. This attribute may be returned by a debug + // adapter if corresponding capability `supportsMemoryReferences` is true. optional memoryReference; // The number of named child variables. // The client can use this information to present the variables in a paged UI @@ -979,6 +1036,13 @@ DAP_DECLARE_STRUCT_TYPEINFO(GotoTargetsRequest); struct InitializeResponse : public Response { // The set of additional module information exposed by the debug adapter. optional> additionalModuleColumns; + // Modes of breakpoints supported by the debug adapter, such as 'hardware' or + // 'software'. If present, the client may allow the user to select a mode and + // include it in its `setBreakpoints` request. + // + // Clients may present the first applicable mode in this array as the + // 'default' mode in gestures that set breakpoints. + optional> breakpointModes; // The set of characters that should trigger completion in a REPL. If not // specified, the UI should assume the `.` character. optional> completionTriggerCharacters; @@ -1774,6 +1838,9 @@ struct SourceBreakpoint { // `hitCondition` or `condition` is specified, then the message should only be // logged if those conditions are met. optional logMessage; + // The mode of this breakpoint. If defined, this must be one of the + // `breakpointModes` the debug adapter advertised in its `Capabilities`. + optional mode; }; DAP_DECLARE_STRUCT_TYPEINFO(SourceBreakpoint); @@ -1846,13 +1913,13 @@ DAP_DECLARE_STRUCT_TYPEINFO(SetDataBreakpointsRequest); // the returned array must start with `filters` information first, followed by // `filterOptions` information. The `verified` property of a `Breakpoint` object // signals whether the exception breakpoint or filter could be successfully -// created and whether the condition or hit count expressions are valid. In case -// of an error the `message` property explains the problem. The `id` property -// can be used to introduce a unique ID for the exception breakpoint or filter -// so that it can be updated subsequently by sending breakpoint events. For -// backward compatibility both the `breakpoints` array and the enclosing `body` -// are optional. If these elements are missing a client is not able to show -// problems for individual exception breakpoints or filters. +// created and whether the condition is valid. In case of an error the `message` +// property explains the problem. The `id` property can be used to introduce a +// unique ID for the exception breakpoint or filter so that it can be updated +// subsequently by sending breakpoint events. For backward compatibility both +// the `breakpoints` array and the enclosing `body` are optional. If these +// elements are missing a client is not able to show problems for individual +// exception breakpoints or filters. struct SetExceptionBreakpointsResponse : public Response { // Information about the exception breakpoints or filters. // The breakpoints returned are in the same order as the elements of the @@ -1901,15 +1968,20 @@ struct ExceptionFilterOptions { // ID of an exception filter returned by the `exceptionBreakpointFilters` // capability. string filterId; + // The mode of this exception breakpoint. If defined, this must be one of the + // `breakpointModes` the debug adapter advertised in its `Capabilities`. + optional mode; }; DAP_DECLARE_STRUCT_TYPEINFO(ExceptionFilterOptions); -// The request configures the debugger's 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 -// corresponding capability `exceptionBreakpointFilters` returns one or more -// filters. +// The request configures the debugger's response to thrown exceptions. Each of +// the `filters`, `filterOptions`, and `exceptionOptions` in the request are +// independent configurations to a debug adapter indicating a kind of exception +// to catch. An exception thrown in a program should result in a `stopped` event +// from the debug adapter (with reason `exception`) if any of the configured +// filters match. Clients should only call this request if the corresponding +// capability `exceptionBreakpointFilters` returns one or more filters. struct SetExceptionBreakpointsRequest : public Request { using Response = SetExceptionBreakpointsResponse; // Configuration options for selected exceptions. @@ -1937,6 +2009,11 @@ struct SetExpressionResponse : public Response { // and fetch them in chunks. The value should be less than or equal to // 2147483647 (2^31-1). optional indexedVariables; + // A memory reference to a location appropriate for this result. + // For pointer type eval results, this is generally a reference to the memory + // address contained in the pointer. This attribute may be returned by a debug + // adapter if corresponding capability `supportsMemoryReferences` is true. + optional memoryReference; // The number of named child variables. // The client can use this information to present the variables in a paged UI // and fetch them in chunks. The value should be less than or equal to @@ -2047,7 +2124,10 @@ struct InstructionBreakpoint { // `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or // `Breakpoint`. string instructionReference; - // The offset from the instruction reference. + // The mode of this breakpoint. If defined, this must be one of the + // `breakpointModes` the debug adapter advertised in its `Capabilities`. + optional mode; + // The offset from the instruction reference in bytes. // This can be negative. optional offset; }; @@ -2075,6 +2155,11 @@ struct SetVariableResponse : public Response { // and fetch them in chunks. The value should be less than or equal to // 2147483647 (2^31-1). optional indexedVariables; + // A memory reference to a location appropriate for this result. + // For pointer type eval results, this is generally a reference to the memory + // address contained in the pointer. This attribute may be returned by a debug + // adapter if corresponding capability `supportsMemoryReferences` is true. + optional memoryReference; // The number of named child variables. // The client can use this information to present the variables in a paged UI // and fetch them in chunks. The value should be less than or equal to @@ -2568,9 +2653,12 @@ struct Variable { // The client can use this information to present the children in a paged UI // and fetch them in chunks. optional indexedVariables; - // The memory reference for the variable if the variable represents executable - // code, such as a function pointer. This attribute is only required if the - // corresponding capability `supportsMemoryReferences` is true. + // A memory reference associated with this variable. + // For pointer type variables, this is generally a reference to the memory + // address contained in the pointer. For executable data, this reference may + // later be used in a `disassemble` request. This attribute may be returned by + // a debug adapter if corresponding capability `supportsMemoryReferences` is + // true. optional memoryReference; // The variable's name. string name; @@ -2616,7 +2704,8 @@ DAP_DECLARE_STRUCT_TYPEINFO(VariablesResponse); struct VariablesRequest : public Request { using Response = VariablesResponse; // The number of variables to return. If count is missing or 0, all variables - // are returned. + // are returned. The attribute is only honored by a debug adapter if the + // corresponding capability `supportsVariablePaging` is true. optional count; // Filter to limit the child variables to either named or indexed. If omitted, // both types are fetched. @@ -2629,6 +2718,8 @@ struct VariablesRequest : public Request { // capability `supportsValueFormattingOptions` is true. optional format; // The index of the first variable to return; if omitted children start at 0. + // The attribute is only honored by a debug adapter if the corresponding + // capability `supportsVariablePaging` is true. optional start; // The variable for which to retrieve its children. The `variablesReference` // must have been obtained in the current suspended state. See 'Lifetime of diff --git a/src/protocol_events.cpp b/src/protocol_events.cpp index 9deb85f..0cd6b9b 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.59.0 +// DAP version 1.65.0 #include "dap/protocol.h" diff --git a/src/protocol_requests.cpp b/src/protocol_requests.cpp index a3b33ec..dd5d3e3 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.59.0 +// DAP version 1.65.0 #include "dap/protocol.h" @@ -55,6 +55,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ContinueRequest, DAP_IMPLEMENT_STRUCT_TYPEINFO(DataBreakpointInfoRequest, "dataBreakpointInfo", DAP_FIELD(frameId, "frameId"), + DAP_FIELD(mode, "mode"), DAP_FIELD(name, "name"), DAP_FIELD(variablesReference, "variablesReference")); diff --git a/src/protocol_response.cpp b/src/protocol_response.cpp index bab8ebb..1810c8a 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.59.0 +// DAP version 1.65.0 #include "dap/protocol.h" @@ -83,6 +83,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO( InitializeResponse, "", DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"), + DAP_FIELD(breakpointModes, "breakpointModes"), DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"), DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"), DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"), @@ -177,6 +178,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExceptionBreakpointsResponse, DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExpressionResponse, "", DAP_FIELD(indexedVariables, "indexedVariables"), + DAP_FIELD(memoryReference, "memoryReference"), DAP_FIELD(namedVariables, "namedVariables"), DAP_FIELD(presentationHint, "presentationHint"), DAP_FIELD(type, "type"), @@ -195,6 +197,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SetInstructionBreakpointsResponse, DAP_IMPLEMENT_STRUCT_TYPEINFO(SetVariableResponse, "", DAP_FIELD(indexedVariables, "indexedVariables"), + DAP_FIELD(memoryReference, "memoryReference"), DAP_FIELD(namedVariables, "namedVariables"), DAP_FIELD(type, "type"), DAP_FIELD(value, "value"), diff --git a/src/protocol_types.cpp b/src/protocol_types.cpp index d9a9e36..2ae9100 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.59.0 +// DAP version 1.65.0 #include "dap/protocol.h" @@ -48,6 +48,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(Breakpoint, DAP_FIELD(line, "line"), DAP_FIELD(message, "message"), DAP_FIELD(offset, "offset"), + DAP_FIELD(reason, "reason"), DAP_FIELD(source, "source"), DAP_FIELD(verified, "verified")); @@ -66,6 +67,13 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ColumnDescriptor, DAP_FIELD(type, "type"), DAP_FIELD(width, "width")); +DAP_IMPLEMENT_STRUCT_TYPEINFO(BreakpointMode, + "", + DAP_FIELD(appliesTo, "appliesTo"), + DAP_FIELD(description, "description"), + DAP_FIELD(label, "label"), + DAP_FIELD(mode, "mode")); + DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionBreakpointsFilter, "", DAP_FIELD(conditionDescription, @@ -81,6 +89,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO( Capabilities, "", DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"), + DAP_FIELD(breakpointModes, "breakpointModes"), DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"), DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"), DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"), @@ -148,6 +157,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(DisassembledInstruction, DAP_FIELD(instructionBytes, "instructionBytes"), DAP_FIELD(line, "line"), DAP_FIELD(location, "location"), + DAP_FIELD(presentationHint, "presentationHint"), DAP_FIELD(symbol, "symbol")); DAP_IMPLEMENT_STRUCT_TYPEINFO(Message, @@ -223,7 +233,8 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SourceBreakpoint, DAP_FIELD(condition, "condition"), DAP_FIELD(hitCondition, "hitCondition"), DAP_FIELD(line, "line"), - DAP_FIELD(logMessage, "logMessage")); + DAP_FIELD(logMessage, "logMessage"), + DAP_FIELD(mode, "mode")); DAP_IMPLEMENT_STRUCT_TYPEINFO(DataBreakpoint, "", @@ -245,7 +256,8 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionOptions, DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionFilterOptions, "", DAP_FIELD(condition, "condition"), - DAP_FIELD(filterId, "filterId")); + DAP_FIELD(filterId, "filterId"), + DAP_FIELD(mode, "mode")); DAP_IMPLEMENT_STRUCT_TYPEINFO(FunctionBreakpoint, "", @@ -259,6 +271,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(InstructionBreakpoint, DAP_FIELD(hitCondition, "hitCondition"), DAP_FIELD(instructionReference, "instructionReference"), + DAP_FIELD(mode, "mode"), DAP_FIELD(offset, "offset")); DAP_IMPLEMENT_STRUCT_TYPEINFO(StackFrame,