Path: blob/master/Utilities/cmcppdap/include/dap/protocol.h
3158 views
// Copyright 2019 Google LLC1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// https://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314// Generated with protocol_gen.go -- do not edit this file.15// go run scripts/protocol_gen/protocol_gen.go16//17// DAP version 1.65.01819#ifndef dap_protocol_h20#define dap_protocol_h2122#include "optional.h"23#include "typeinfo.h"24#include "typeof.h"25#include "variant.h"2627#include <string>28#include <type_traits>29#include <vector>3031namespace dap {3233struct Request {};34struct Response {};35struct Event {};3637// Response to `attach` request. This is just an acknowledgement, so no body38// field is required.39struct AttachResponse : public Response {};4041DAP_DECLARE_STRUCT_TYPEINFO(AttachResponse);4243// The `attach` request is sent from the client to the debug adapter to attach44// to a debuggee that is already running. Since attaching is debugger/runtime45// specific, the arguments for this request are not part of this specification.46struct AttachRequest : public Request {47using Response = AttachResponse;48// Arbitrary data from the previous, restarted session.49// The data is sent as the `restart` attribute of the `terminated` event.50// The client should leave the data intact.51optional<variant<array<any>, boolean, integer, null, number, object, string>>52restart;53};5455DAP_DECLARE_STRUCT_TYPEINFO(AttachRequest);5657// Names of checksum algorithms that may be supported by a debug adapter.58//59// Must be one of the following enumeration values:60// 'MD5', 'SHA1', 'SHA256', 'timestamp'61using ChecksumAlgorithm = string;6263// The checksum of an item calculated by the specified algorithm.64struct Checksum {65// The algorithm used to calculate this checksum.66ChecksumAlgorithm algorithm = "MD5";67// Value of the checksum, encoded as a hexadecimal value.68string checksum;69};7071DAP_DECLARE_STRUCT_TYPEINFO(Checksum);7273// A `Source` is a descriptor for source code.74// It is returned from the debug adapter as part of a `StackFrame` and it is75// used by clients when specifying breakpoints.76struct Source {77// Additional data that a debug adapter might want to loop through the client.78// The client should leave the data intact and persist it across sessions. The79// client should not interpret the data.80optional<variant<array<any>, boolean, integer, null, number, object, string>>81adapterData;82// The checksums associated with this file.83optional<array<Checksum>> checksums;84// The short name of the source. Every source returned from the debug adapter85// has a name. When sending a source to the debug adapter this name is86// optional.87optional<string> name;88// The origin of this source. For example, 'internal module', 'inlined content89// from source map', etc.90optional<string> origin;91// The path of the source to be shown in the UI.92// It is only used to locate and load the content of the source if no93// `sourceReference` is specified (or its value is 0).94optional<string> path;95// A hint for how to present the source in the UI.96// A value of `deemphasize` can be used to indicate that the source is not97// available or that it is skipped on stepping.98//99// Must be one of the following enumeration values:100// 'normal', 'emphasize', 'deemphasize'101optional<string> presentationHint;102// If the value > 0 the contents of the source must be retrieved through the103// `source` request (even if a path is specified). Since a `sourceReference`104// is only valid for a session, it can not be used to persist a source. The105// value should be less than or equal to 2147483647 (2^31-1).106optional<integer> sourceReference;107// A list of sources that are related to this source. These may be the source108// that generated this source.109optional<array<Source>> sources;110};111112DAP_DECLARE_STRUCT_TYPEINFO(Source);113114// Information about a breakpoint created in `setBreakpoints`,115// `setFunctionBreakpoints`, `setInstructionBreakpoints`, or116// `setDataBreakpoints` requests.117struct Breakpoint {118// Start position of the source range covered by the breakpoint. It is119// measured in UTF-16 code units and the client capability `columnsStartAt1`120// determines whether it is 0- or 1-based.121optional<integer> column;122// End position of the source range covered by the breakpoint. It is measured123// in UTF-16 code units and the client capability `columnsStartAt1` determines124// whether it is 0- or 1-based. If no end line is given, then the end column125// is assumed to be in the start line.126optional<integer> endColumn;127// The end line of the actual range covered by the breakpoint.128optional<integer> endLine;129// The identifier for the breakpoint. It is needed if breakpoint events are130// used to update or remove breakpoints.131optional<integer> id;132// A memory reference to where the breakpoint is set.133optional<string> instructionReference;134// The start line of the actual range covered by the breakpoint.135optional<integer> line;136// A message about the state of the breakpoint.137// This is shown to the user and can be used to explain why a breakpoint could138// not be verified.139optional<string> message;140// The offset from the instruction reference.141// This can be negative.142optional<integer> offset;143// A machine-readable explanation of why a breakpoint may not be verified. If144// a breakpoint is verified or a specific reason is not known, the adapter145// should omit this property. Possible values include:146//147// - `pending`: Indicates a breakpoint might be verified in the future, but148// the adapter cannot verify it in the current state.149// - `failed`: Indicates a breakpoint was not able to be verified, and the150// adapter does not believe it can be verified without intervention.151//152// Must be one of the following enumeration values:153// 'pending', 'failed'154optional<string> reason;155// The source where the breakpoint is located.156optional<Source> source;157// If true, the breakpoint could be set (but not necessarily at the desired158// location).159boolean verified;160};161162DAP_DECLARE_STRUCT_TYPEINFO(Breakpoint);163164// The event indicates that some information about a breakpoint has changed.165struct BreakpointEvent : public Event {166// The `id` attribute is used to find the target breakpoint, the other167// attributes are used as the new values.168Breakpoint breakpoint;169// The reason for the event.170//171// May be one of the following enumeration values:172// 'changed', 'new', 'removed'173string reason;174};175176DAP_DECLARE_STRUCT_TYPEINFO(BreakpointEvent);177178// Properties of a breakpoint location returned from the `breakpointLocations`179// request.180struct BreakpointLocation {181// The start position of a breakpoint location. Position is measured in UTF-16182// code units and the client capability `columnsStartAt1` determines whether183// it is 0- or 1-based.184optional<integer> column;185// The end position of a breakpoint location (if the location covers a range).186// Position is measured in UTF-16 code units and the client capability187// `columnsStartAt1` determines whether it is 0- or 1-based.188optional<integer> endColumn;189// The end line of breakpoint location if the location covers a range.190optional<integer> endLine;191// Start line of breakpoint location.192integer line;193};194195DAP_DECLARE_STRUCT_TYPEINFO(BreakpointLocation);196197// Response to `breakpointLocations` request.198// Contains possible locations for source breakpoints.199struct BreakpointLocationsResponse : public Response {200// Sorted set of possible breakpoint locations.201array<BreakpointLocation> breakpoints;202};203204DAP_DECLARE_STRUCT_TYPEINFO(BreakpointLocationsResponse);205206// The `breakpointLocations` request returns all possible locations for source207// breakpoints in a given range. Clients should only call this request if the208// corresponding capability `supportsBreakpointLocationsRequest` is true.209struct BreakpointLocationsRequest : public Request {210using Response = BreakpointLocationsResponse;211// Start position within `line` to search possible breakpoint locations in. It212// is measured in UTF-16 code units and the client capability213// `columnsStartAt1` determines whether it is 0- or 1-based. If no column is214// given, the first position in the start line is assumed.215optional<integer> column;216// End position within `endLine` to search possible breakpoint locations in.217// It is measured in UTF-16 code units and the client capability218// `columnsStartAt1` determines whether it is 0- or 1-based. If no end column219// is given, the last position in the end line is assumed.220optional<integer> endColumn;221// End line of range to search possible breakpoint locations in. If no end222// line is given, then the end line is assumed to be the start line.223optional<integer> endLine;224// Start line of range to search possible breakpoint locations in. If only the225// line is specified, the request returns all possible locations in that line.226integer line;227// The source location of the breakpoints; either `source.path` or228// `source.sourceReference` must be specified.229Source source;230};231232DAP_DECLARE_STRUCT_TYPEINFO(BreakpointLocationsRequest);233234// Response to `cancel` request. This is just an acknowledgement, so no body235// field is required.236struct CancelResponse : public Response {};237238DAP_DECLARE_STRUCT_TYPEINFO(CancelResponse);239240// The `cancel` request is used by the client in two situations:241// - to indicate that it is no longer interested in the result produced by a242// specific request issued earlier243// - to cancel a progress sequence.244// Clients should only call this request if the corresponding capability245// `supportsCancelRequest` is true. This request has a hint characteristic: a246// debug adapter can only be expected to make a 'best effort' in honoring this247// request but there are no guarantees. The `cancel` request may return an error248// if it could not cancel an operation but a client should refrain from249// presenting this error to end users. The request that got cancelled still250// needs to send a response back. This can either be a normal result (`success`251// attribute true) or an error response (`success` attribute false and the252// `message` set to `cancelled`). Returning partial results from a cancelled253// request is possible but please note that a client has no generic way for254// detecting that a response is partial or not. The progress that got cancelled255// still needs to send a `progressEnd` event back.256// A client should not assume that progress just got cancelled after sending257// the `cancel` request.258struct CancelRequest : public Request {259using Response = CancelResponse;260// The ID (attribute `progressId`) of the progress to cancel. If missing no261// progress is cancelled. Both a `requestId` and a `progressId` can be262// specified in one request.263optional<string> progressId;264// The ID (attribute `seq`) of the request to cancel. If missing no request is265// cancelled. Both a `requestId` and a `progressId` can be specified in one266// request.267optional<integer> requestId;268};269270DAP_DECLARE_STRUCT_TYPEINFO(CancelRequest);271272// A `ColumnDescriptor` specifies what module attribute to show in a column of273// the modules view, how to format it, and what the column's label should be. It274// is only used if the underlying UI actually supports this level of275// customization.276struct ColumnDescriptor {277// Name of the attribute rendered in this column.278string attributeName;279// Format to use for the rendered values in this column. TBD how the format280// strings looks like.281optional<string> format;282// Header UI label of column.283string label;284// Datatype of values in this column. Defaults to `string` if not specified.285//286// Must be one of the following enumeration values:287// 'string', 'number', 'boolean', 'unixTimestampUTC'288optional<string> type;289// Width of this column in characters (hint only).290optional<integer> width;291};292293DAP_DECLARE_STRUCT_TYPEINFO(ColumnDescriptor);294295// Describes one or more type of breakpoint a `BreakpointMode` applies to. This296// is a non-exhaustive enumeration and may expand as future breakpoint types are297// added.298using BreakpointModeApplicability = string;299300// A `BreakpointMode` is provided as a option when setting breakpoints on301// sources or instructions.302struct BreakpointMode {303// Describes one or more type of breakpoint this mode applies to.304array<BreakpointModeApplicability> appliesTo;305// A help text providing additional information about the breakpoint mode.306// This string is typically shown as a hover and can be translated.307optional<string> description;308// The name of the breakpoint mode. This is shown in the UI.309string label;310// The internal ID of the mode. This value is passed to the `setBreakpoints`311// request.312string mode;313};314315DAP_DECLARE_STRUCT_TYPEINFO(BreakpointMode);316317// An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for318// configuring how exceptions are dealt with.319struct ExceptionBreakpointsFilter {320// A help text providing information about the condition. This string is shown321// as the placeholder text for a text box and can be translated.322optional<string> conditionDescription;323// Initial value of the filter option. If not specified a value false is324// assumed.325optional<boolean> def;326// A help text providing additional information about the exception filter.327// This string is typically shown as a hover and can be translated.328optional<string> description;329// The internal ID of the filter option. This value is passed to the330// `setExceptionBreakpoints` request.331string filter;332// The name of the filter option. This is shown in the UI.333string label;334// Controls whether a condition can be specified for this filter option. If335// false or missing, a condition can not be set.336optional<boolean> supportsCondition;337};338339DAP_DECLARE_STRUCT_TYPEINFO(ExceptionBreakpointsFilter);340341// Information about the capabilities of a debug adapter.342struct Capabilities {343// The set of additional module information exposed by the debug adapter.344optional<array<ColumnDescriptor>> additionalModuleColumns;345// Modes of breakpoints supported by the debug adapter, such as 'hardware' or346// 'software'. If present, the client may allow the user to select a mode and347// include it in its `setBreakpoints` request.348//349// Clients may present the first applicable mode in this array as the350// 'default' mode in gestures that set breakpoints.351optional<array<BreakpointMode>> breakpointModes;352// The set of characters that should trigger completion in a REPL. If not353// specified, the UI should assume the `.` character.354optional<array<string>> completionTriggerCharacters;355// Available exception filter options for the `setExceptionBreakpoints`356// request.357optional<array<ExceptionBreakpointsFilter>> exceptionBreakpointFilters;358// The debug adapter supports the `suspendDebuggee` attribute on the359// `disconnect` request.360optional<boolean> supportSuspendDebuggee;361// The debug adapter supports the `terminateDebuggee` attribute on the362// `disconnect` request.363optional<boolean> supportTerminateDebuggee;364// Checksum algorithms supported by the debug adapter.365optional<array<ChecksumAlgorithm>> supportedChecksumAlgorithms;366// The debug adapter supports the `breakpointLocations` request.367optional<boolean> supportsBreakpointLocationsRequest;368// The debug adapter supports the `cancel` request.369optional<boolean> supportsCancelRequest;370// The debug adapter supports the `clipboard` context value in the `evaluate`371// request.372optional<boolean> supportsClipboardContext;373// The debug adapter supports the `completions` request.374optional<boolean> supportsCompletionsRequest;375// The debug adapter supports conditional breakpoints.376optional<boolean> supportsConditionalBreakpoints;377// The debug adapter supports the `configurationDone` request.378optional<boolean> supportsConfigurationDoneRequest;379// The debug adapter supports data breakpoints.380optional<boolean> supportsDataBreakpoints;381// The debug adapter supports the delayed loading of parts of the stack, which382// requires that both the `startFrame` and `levels` arguments and the383// `totalFrames` result of the `stackTrace` request are supported.384optional<boolean> supportsDelayedStackTraceLoading;385// The debug adapter supports the `disassemble` request.386optional<boolean> supportsDisassembleRequest;387// The debug adapter supports a (side effect free) `evaluate` request for data388// hovers.389optional<boolean> supportsEvaluateForHovers;390// The debug adapter supports `filterOptions` as an argument on the391// `setExceptionBreakpoints` request.392optional<boolean> supportsExceptionFilterOptions;393// The debug adapter supports the `exceptionInfo` request.394optional<boolean> supportsExceptionInfoRequest;395// The debug adapter supports `exceptionOptions` on the396// `setExceptionBreakpoints` request.397optional<boolean> supportsExceptionOptions;398// The debug adapter supports function breakpoints.399optional<boolean> supportsFunctionBreakpoints;400// The debug adapter supports the `gotoTargets` request.401optional<boolean> supportsGotoTargetsRequest;402// The debug adapter supports breakpoints that break execution after a403// specified number of hits.404optional<boolean> supportsHitConditionalBreakpoints;405// The debug adapter supports adding breakpoints based on instruction406// references.407optional<boolean> supportsInstructionBreakpoints;408// The debug adapter supports the `loadedSources` request.409optional<boolean> supportsLoadedSourcesRequest;410// The debug adapter supports log points by interpreting the `logMessage`411// attribute of the `SourceBreakpoint`.412optional<boolean> supportsLogPoints;413// The debug adapter supports the `modules` request.414optional<boolean> supportsModulesRequest;415// The debug adapter supports the `readMemory` request.416optional<boolean> supportsReadMemoryRequest;417// The debug adapter supports restarting a frame.418optional<boolean> supportsRestartFrame;419// The debug adapter supports the `restart` request. In this case a client420// should not implement `restart` by terminating and relaunching the adapter421// but by calling the `restart` request.422optional<boolean> supportsRestartRequest;423// The debug adapter supports the `setExpression` request.424optional<boolean> supportsSetExpression;425// The debug adapter supports setting a variable to a value.426optional<boolean> supportsSetVariable;427// The debug adapter supports the `singleThread` property on the execution428// requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`,429// `stepBack`).430optional<boolean> supportsSingleThreadExecutionRequests;431// The debug adapter supports stepping back via the `stepBack` and432// `reverseContinue` requests.433optional<boolean> supportsStepBack;434// The debug adapter supports the `stepInTargets` request.435optional<boolean> supportsStepInTargetsRequest;436// The debug adapter supports stepping granularities (argument `granularity`)437// for the stepping requests.438optional<boolean> supportsSteppingGranularity;439// The debug adapter supports the `terminate` request.440optional<boolean> supportsTerminateRequest;441// The debug adapter supports the `terminateThreads` request.442optional<boolean> supportsTerminateThreadsRequest;443// The debug adapter supports a `format` attribute on the `stackTrace`,444// `variables`, and `evaluate` requests.445optional<boolean> supportsValueFormattingOptions;446// The debug adapter supports the `writeMemory` request.447optional<boolean> supportsWriteMemoryRequest;448};449450DAP_DECLARE_STRUCT_TYPEINFO(Capabilities);451452// The event indicates that one or more capabilities have changed.453// Since the capabilities are dependent on the client and its UI, it might not454// be possible to change that at random times (or too late). Consequently this455// event has a hint characteristic: a client can only be expected to make a456// 'best effort' in honoring individual capabilities but there are no457// guarantees. Only changed capabilities need to be included, all other458// capabilities keep their values.459struct CapabilitiesEvent : public Event {460// The set of updated capabilities.461Capabilities capabilities;462};463464DAP_DECLARE_STRUCT_TYPEINFO(CapabilitiesEvent);465466// Some predefined types for the CompletionItem. Please note that not all467// clients have specific icons for all of them.468//469// Must be one of the following enumeration values:470// 'method', 'function', 'constructor', 'field', 'variable', 'class',471// 'interface', 'module', 'property', 'unit', 'value', 'enum', 'keyword',472// 'snippet', 'text', 'color', 'file', 'reference', 'customcolor'473using CompletionItemType = string;474475// `CompletionItems` are the suggestions returned from the `completions`476// request.477struct CompletionItem {478// A human-readable string with additional information about this item, like479// type or symbol information.480optional<string> detail;481// The label of this completion item. By default this is also the text that is482// inserted when selecting this completion.483string label;484// Length determines how many characters are overwritten by the completion485// text and it is measured in UTF-16 code units. If missing the value 0 is486// assumed which results in the completion text being inserted.487optional<integer> length;488// Determines the length of the new selection after the text has been inserted489// (or replaced) and it is measured in UTF-16 code units. The selection can490// not extend beyond the bounds of the completion text. If omitted the length491// is assumed to be 0.492optional<integer> selectionLength;493// Determines the start of the new selection after the text has been inserted494// (or replaced). `selectionStart` is measured in UTF-16 code units and must495// be in the range 0 and length of the completion text. If omitted the496// selection starts at the end of the completion text.497optional<integer> selectionStart;498// A string that should be used when comparing this item with other items. If499// not returned or an empty string, the `label` is used instead.500optional<string> sortText;501// Start position (within the `text` attribute of the `completions` request)502// where the completion text is added. The position is measured in UTF-16 code503// units and the client capability `columnsStartAt1` determines whether it is504// 0- or 1-based. If the start position is omitted the text is added at the505// location specified by the `column` attribute of the `completions` request.506optional<integer> start;507// If text is returned and not an empty string, then it is inserted instead of508// the label.509optional<string> text;510// The item's type. Typically the client uses this information to render the511// item in the UI with an icon.512optional<CompletionItemType> type;513};514515DAP_DECLARE_STRUCT_TYPEINFO(CompletionItem);516517// Response to `completions` request.518struct CompletionsResponse : public Response {519// The possible completions for .520array<CompletionItem> targets;521};522523DAP_DECLARE_STRUCT_TYPEINFO(CompletionsResponse);524525// Returns a list of possible completions for a given caret position and text.526// Clients should only call this request if the corresponding capability527// `supportsCompletionsRequest` is true.528struct CompletionsRequest : public Request {529using Response = CompletionsResponse;530// The position within `text` for which to determine the completion proposals.531// It is measured in UTF-16 code units and the client capability532// `columnsStartAt1` determines whether it is 0- or 1-based.533integer column;534// Returns completions in the scope of this stack frame. If not specified, the535// completions are returned for the global scope.536optional<integer> frameId;537// A line for which to determine the completion proposals. If missing the538// first line of the text is assumed.539optional<integer> line;540// One or more source lines. Typically this is the text users have typed into541// the debug console before they asked for completion.542string text;543};544545DAP_DECLARE_STRUCT_TYPEINFO(CompletionsRequest);546547// Response to `configurationDone` request. This is just an acknowledgement, so548// no body field is required.549struct ConfigurationDoneResponse : public Response {};550551DAP_DECLARE_STRUCT_TYPEINFO(ConfigurationDoneResponse);552553// This request indicates that the client has finished initialization of the554// debug adapter. So it is the last request in the sequence of configuration555// requests (which was started by the `initialized` event). Clients should only556// call this request if the corresponding capability557// `supportsConfigurationDoneRequest` is true.558struct ConfigurationDoneRequest : public Request {559using Response = ConfigurationDoneResponse;560};561562DAP_DECLARE_STRUCT_TYPEINFO(ConfigurationDoneRequest);563564// Response to `continue` request.565struct ContinueResponse : public Response {566// The value true (or a missing property) signals to the client that all567// threads have been resumed. The value false indicates that not all threads568// were resumed.569optional<boolean> allThreadsContinued;570};571572DAP_DECLARE_STRUCT_TYPEINFO(ContinueResponse);573574// The request resumes execution of all threads. If the debug adapter supports575// single thread execution (see capability576// `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument577// to true resumes only the specified thread. If not all threads were resumed,578// the `allThreadsContinued` attribute of the response should be set to false.579struct ContinueRequest : public Request {580using Response = ContinueResponse;581// If this flag is true, execution is resumed only for the thread with given582// `threadId`.583optional<boolean> singleThread;584// Specifies the active thread. If the debug adapter supports single thread585// execution (see `supportsSingleThreadExecutionRequests`) and the argument586// `singleThread` is true, only the thread with this ID is resumed.587integer threadId;588};589590DAP_DECLARE_STRUCT_TYPEINFO(ContinueRequest);591592// The event indicates that the execution of the debuggee has continued.593// Please note: a debug adapter is not expected to send this event in response594// to a request that implies that execution continues, e.g. `launch` or595// `continue`. It is only necessary to send a `continued` event if there was no596// previous request that implied this.597struct ContinuedEvent : public Event {598// If `allThreadsContinued` is true, a debug adapter can announce that all599// threads have continued.600optional<boolean> allThreadsContinued;601// The thread which was continued.602integer threadId;603};604605DAP_DECLARE_STRUCT_TYPEINFO(ContinuedEvent);606607// This enumeration defines all possible access types for data breakpoints.608//609// Must be one of the following enumeration values:610// 'read', 'write', 'readWrite'611using DataBreakpointAccessType = string;612613// Response to `dataBreakpointInfo` request.614struct DataBreakpointInfoResponse : public Response {615// Attribute lists the available access types for a potential data breakpoint.616// A UI client could surface this information.617optional<array<DataBreakpointAccessType>> accessTypes;618// Attribute indicates that a potential data breakpoint could be persisted619// across sessions.620optional<boolean> canPersist;621// An identifier for the data on which a data breakpoint can be registered622// with the `setDataBreakpoints` request or null if no data breakpoint is623// available. If a `variablesReference` or `frameId` is passed, the `dataId`624// is valid in the current suspended state, otherwise it's valid indefinitely.625// See 'Lifetime of Object References' in the Overview section for details.626// Breakpoints set using the `dataId` in the `setDataBreakpoints` request may627// outlive the lifetime of the associated `dataId`.628variant<string, null> dataId;629// UI string that describes on what data the breakpoint is set on or why a630// data breakpoint is not available.631string description;632};633634DAP_DECLARE_STRUCT_TYPEINFO(DataBreakpointInfoResponse);635636// Obtains information on a possible data breakpoint that could be set on an637// expression or variable. Clients should only call this request if the638// corresponding capability `supportsDataBreakpoints` is true.639struct DataBreakpointInfoRequest : public Request {640using Response = DataBreakpointInfoResponse;641// When `name` is an expression, evaluate it in the scope of this stack frame.642// If not specified, the expression is evaluated in the global scope. When643// `variablesReference` is specified, this property has no effect.644optional<integer> frameId;645// The mode of the desired breakpoint. If defined, this must be one of the646// `breakpointModes` the debug adapter advertised in its `Capabilities`.647optional<string> mode;648// The name of the variable's child to obtain data breakpoint information for.649// If `variablesReference` isn't specified, this can be an expression.650string name;651// Reference to the variable container if the data breakpoint is requested for652// a child of the container. The `variablesReference` must have been obtained653// in the current suspended state. See 'Lifetime of Object References' in the654// Overview section for details.655optional<integer> variablesReference;656};657658DAP_DECLARE_STRUCT_TYPEINFO(DataBreakpointInfoRequest);659660// Represents a single disassembled instruction.661struct DisassembledInstruction {662// The address of the instruction. Treated as a hex value if prefixed with663// `0x`, or as a decimal value otherwise.664string address;665// The column within the line that corresponds to this instruction, if any.666optional<integer> column;667// The end column of the range that corresponds to this instruction, if any.668optional<integer> endColumn;669// The end line of the range that corresponds to this instruction, if any.670optional<integer> endLine;671// Text representing the instruction and its operands, in an672// implementation-defined format.673string instruction;674// Raw bytes representing the instruction and its operands, in an675// implementation-defined format.676optional<string> instructionBytes;677// The line within the source location that corresponds to this instruction,678// if any.679optional<integer> line;680// Source location that corresponds to this instruction, if any.681// Should always be set (if available) on the first instruction returned,682// but can be omitted afterwards if this instruction maps to the same source683// file as the previous instruction.684optional<Source> location;685// A hint for how to present the instruction in the UI.686//687// A value of `invalid` may be used to indicate this instruction is 'filler'688// and cannot be reached by the program. For example, unreadable memory689// addresses may be presented is 'invalid.'690//691// Must be one of the following enumeration values:692// 'normal', 'invalid'693optional<string> presentationHint;694// Name of the symbol that corresponds with the location of this instruction,695// if any.696optional<string> symbol;697};698699DAP_DECLARE_STRUCT_TYPEINFO(DisassembledInstruction);700701// Response to `disassemble` request.702struct DisassembleResponse : public Response {703// The list of disassembled instructions.704array<DisassembledInstruction> instructions;705};706707DAP_DECLARE_STRUCT_TYPEINFO(DisassembleResponse);708709// Disassembles code stored at the provided location.710// Clients should only call this request if the corresponding capability711// `supportsDisassembleRequest` is true.712struct DisassembleRequest : public Request {713using Response = DisassembleResponse;714// Number of instructions to disassemble starting at the specified location715// and offset. An adapter must return exactly this number of instructions -716// any unavailable instructions should be replaced with an717// implementation-defined 'invalid instruction' value.718integer instructionCount;719// Offset (in instructions) to be applied after the byte offset (if any)720// before disassembling. Can be negative.721optional<integer> instructionOffset;722// Memory reference to the base location containing the instructions to723// disassemble.724string memoryReference;725// Offset (in bytes) to be applied to the reference location before726// disassembling. Can be negative.727optional<integer> offset;728// If true, the adapter should attempt to resolve memory addresses and other729// values to symbolic names.730optional<boolean> resolveSymbols;731};732733DAP_DECLARE_STRUCT_TYPEINFO(DisassembleRequest);734735// Response to `disconnect` request. This is just an acknowledgement, so no body736// field is required.737struct DisconnectResponse : public Response {};738739DAP_DECLARE_STRUCT_TYPEINFO(DisconnectResponse);740741// The `disconnect` request asks the debug adapter to disconnect from the742// debuggee (thus ending the debug session) and then to shut down itself (the743// debug adapter). In addition, the debug adapter must terminate the debuggee if744// it was started with the `launch` request. If an `attach` request was used to745// connect to the debuggee, then the debug adapter must not terminate the746// debuggee. This implicit behavior of when to terminate the debuggee can be747// overridden with the `terminateDebuggee` argument (which is only supported by748// a debug adapter if the corresponding capability `supportTerminateDebuggee` is749// true).750struct DisconnectRequest : public Request {751using Response = DisconnectResponse;752// A value of true indicates that this `disconnect` request is part of a753// restart sequence.754optional<boolean> restart;755// Indicates whether the debuggee should stay suspended when the debugger is756// disconnected. If unspecified, the debuggee should resume execution. The757// attribute is only honored by a debug adapter if the corresponding758// capability `supportSuspendDebuggee` is true.759optional<boolean> suspendDebuggee;760// Indicates whether the debuggee should be terminated when the debugger is761// disconnected. If unspecified, the debug adapter is free to do whatever it762// thinks is best. The attribute is only honored by a debug adapter if the763// corresponding capability `supportTerminateDebuggee` is true.764optional<boolean> terminateDebuggee;765};766767DAP_DECLARE_STRUCT_TYPEINFO(DisconnectRequest);768769// A structured message object. Used to return errors from requests.770struct Message {771// A format string for the message. Embedded variables have the form `{name}`.772// If variable name starts with an underscore character, the variable does not773// contain user data (PII) and can be safely used for telemetry purposes.774string format;775// Unique (within a debug adapter implementation) identifier for the message.776// The purpose of these error IDs is to help extension authors that have the777// requirement that every user visible error message needs a corresponding778// error number, so that users or customer support can find information about779// the specific error more easily.780integer id;781// If true send to telemetry.782optional<boolean> sendTelemetry;783// If true show user.784optional<boolean> showUser;785// A url where additional information about this message can be found.786optional<string> url;787// A label that is presented to the user as the UI for opening the url.788optional<string> urlLabel;789// An object used as a dictionary for looking up the variables in the format790// string.791optional<object> variables;792};793794DAP_DECLARE_STRUCT_TYPEINFO(Message);795796// On error (whenever `success` is false), the body can provide more details.797struct ErrorResponse : public Response {798// A structured error message.799optional<Message> error;800};801802DAP_DECLARE_STRUCT_TYPEINFO(ErrorResponse);803804// Properties of a variable that can be used to determine how to render the805// variable in the UI.806struct VariablePresentationHint {807// Set of attributes represented as an array of strings. Before introducing808// additional values, try to use the listed values.809optional<array<string>> attributes;810// The kind of variable. Before introducing additional values, try to use the811// listed values.812//813// May be one of the following enumeration values:814// 'property', 'method', 'class', 'data', 'event', 'baseClass', 'innerClass',815// 'interface', 'mostDerivedClass', 'virtual', 'dataBreakpoint'816optional<string> kind;817// If true, clients can present the variable with a UI that supports a818// specific gesture to trigger its evaluation. This mechanism can be used for819// properties that require executing code when retrieving their value and820// where the code execution can be expensive and/or produce side-effects. A821// typical example are properties based on a getter function. Please note that822// in addition to the `lazy` flag, the variable's `variablesReference` is823// expected to refer to a variable that will provide the value through another824// `variable` request.825optional<boolean> lazy;826// Visibility of variable. Before introducing additional values, try to use827// the listed values.828//829// May be one of the following enumeration values:830// 'public', 'private', 'protected', 'internal', 'final'831optional<string> visibility;832};833834DAP_DECLARE_STRUCT_TYPEINFO(VariablePresentationHint);835836// Response to `evaluate` request.837struct EvaluateResponse : public Response {838// The number of indexed child variables.839// The client can use this information to present the variables in a paged UI840// and fetch them in chunks. The value should be less than or equal to841// 2147483647 (2^31-1).842optional<integer> indexedVariables;843// A memory reference to a location appropriate for this result.844// For pointer type eval results, this is generally a reference to the memory845// address contained in the pointer. This attribute may be returned by a debug846// adapter if corresponding capability `supportsMemoryReferences` is true.847optional<string> memoryReference;848// The number of named child variables.849// The client can use this information to present the variables in a paged UI850// and fetch them in chunks. The value should be less than or equal to851// 2147483647 (2^31-1).852optional<integer> namedVariables;853// Properties of an evaluate result that can be used to determine how to854// render the result in the UI.855optional<VariablePresentationHint> presentationHint;856// The result of the evaluate request.857string result;858// The type of the evaluate result.859// This attribute should only be returned by a debug adapter if the860// corresponding capability `supportsVariableType` is true.861optional<string> type;862// If `variablesReference` is > 0, the evaluate result is structured and its863// children can be retrieved by passing `variablesReference` to the864// `variables` request as long as execution remains suspended. See 'Lifetime865// of Object References' in the Overview section for details.866integer variablesReference;867};868869DAP_DECLARE_STRUCT_TYPEINFO(EvaluateResponse);870871// Provides formatting information for a value.872struct ValueFormat {873// Display the value in hex.874optional<boolean> hex;875};876877DAP_DECLARE_STRUCT_TYPEINFO(ValueFormat);878879// Evaluates the given expression in the context of the topmost stack frame.880// The expression has access to any variables and arguments that are in scope.881struct EvaluateRequest : public Request {882using Response = EvaluateResponse;883// The context in which the evaluate request is used.884//885// May be one of the following enumeration values:886// 'watch', 'repl', 'hover', 'clipboard', 'variables'887optional<string> context;888// The expression to evaluate.889string expression;890// Specifies details on how to format the result.891// The attribute is only honored by a debug adapter if the corresponding892// capability `supportsValueFormattingOptions` is true.893optional<ValueFormat> format;894// Evaluate the expression in the scope of this stack frame. If not specified,895// the expression is evaluated in the global scope.896optional<integer> frameId;897};898899DAP_DECLARE_STRUCT_TYPEINFO(EvaluateRequest);900901// This enumeration defines all possible conditions when a thrown exception902// should result in a break. never: never breaks, always: always breaks,903// unhandled: breaks when exception unhandled,904// userUnhandled: breaks if the exception is not handled by user code.905//906// Must be one of the following enumeration values:907// 'never', 'always', 'unhandled', 'userUnhandled'908using ExceptionBreakMode = string;909910// Detailed information about an exception that has occurred.911struct ExceptionDetails {912// An expression that can be evaluated in the current scope to obtain the913// exception object.914optional<string> evaluateName;915// Fully-qualified type name of the exception object.916optional<string> fullTypeName;917// Details of the exception contained by this exception, if any.918optional<array<ExceptionDetails>> innerException;919// Message contained in the exception.920optional<string> message;921// Stack trace at the time the exception was thrown.922optional<string> stackTrace;923// Short type name of the exception object.924optional<string> typeName;925};926927DAP_DECLARE_STRUCT_TYPEINFO(ExceptionDetails);928929// Response to `exceptionInfo` request.930struct ExceptionInfoResponse : public Response {931// Mode that caused the exception notification to be raised.932ExceptionBreakMode breakMode = "never";933// Descriptive text for the exception.934optional<string> description;935// Detailed information about the exception.936optional<ExceptionDetails> details;937// ID of the exception that was thrown.938string exceptionId;939};940941DAP_DECLARE_STRUCT_TYPEINFO(ExceptionInfoResponse);942943// Retrieves the details of the exception that caused this event to be raised.944// Clients should only call this request if the corresponding capability945// `supportsExceptionInfoRequest` is true.946struct ExceptionInfoRequest : public Request {947using Response = ExceptionInfoResponse;948// Thread for which exception information should be retrieved.949integer threadId;950};951952DAP_DECLARE_STRUCT_TYPEINFO(ExceptionInfoRequest);953954// The event indicates that the debuggee has exited and returns its exit code.955struct ExitedEvent : public Event {956// The exit code returned from the debuggee.957integer exitCode;958};959960DAP_DECLARE_STRUCT_TYPEINFO(ExitedEvent);961962// Response to `goto` request. This is just an acknowledgement, so no body field963// is required.964struct GotoResponse : public Response {};965966DAP_DECLARE_STRUCT_TYPEINFO(GotoResponse);967968// The request sets the location where the debuggee will continue to run.969// This makes it possible to skip the execution of code or to execute code970// again. The code between the current location and the goto target is not971// executed but skipped. The debug adapter first sends the response and then a972// `stopped` event with reason `goto`. Clients should only call this request if973// the corresponding capability `supportsGotoTargetsRequest` is true (because974// only then goto targets exist that can be passed as arguments).975struct GotoRequest : public Request {976using Response = GotoResponse;977// The location where the debuggee will continue to run.978integer targetId;979// Set the goto target for this thread.980integer threadId;981};982983DAP_DECLARE_STRUCT_TYPEINFO(GotoRequest);984985// A `GotoTarget` describes a code location that can be used as a target in the986// `goto` request. The possible goto targets can be determined via the987// `gotoTargets` request.988struct GotoTarget {989// The column of the goto target.990optional<integer> column;991// The end column of the range covered by the goto target.992optional<integer> endColumn;993// The end line of the range covered by the goto target.994optional<integer> endLine;995// Unique identifier for a goto target. This is used in the `goto` request.996integer id;997// A memory reference for the instruction pointer value represented by this998// target.999optional<string> instructionPointerReference;1000// The name of the goto target (shown in the UI).1001string label;1002// The line of the goto target.1003integer line;1004};10051006DAP_DECLARE_STRUCT_TYPEINFO(GotoTarget);10071008// Response to `gotoTargets` request.1009struct GotoTargetsResponse : public Response {1010// The possible goto targets of the specified location.1011array<GotoTarget> targets;1012};10131014DAP_DECLARE_STRUCT_TYPEINFO(GotoTargetsResponse);10151016// This request retrieves the possible goto targets for the specified source1017// location. These targets can be used in the `goto` request. Clients should1018// only call this request if the corresponding capability1019// `supportsGotoTargetsRequest` is true.1020struct GotoTargetsRequest : public Request {1021using Response = GotoTargetsResponse;1022// The position within `line` for which the goto targets are determined. It is1023// measured in UTF-16 code units and the client capability `columnsStartAt1`1024// determines whether it is 0- or 1-based.1025optional<integer> column;1026// The line location for which the goto targets are determined.1027integer line;1028// The source location for which the goto targets are determined.1029Source source;1030};10311032DAP_DECLARE_STRUCT_TYPEINFO(GotoTargetsRequest);10331034// Response to `initialize` request.1035struct InitializeResponse : public Response {1036// The set of additional module information exposed by the debug adapter.1037optional<array<ColumnDescriptor>> additionalModuleColumns;1038// Modes of breakpoints supported by the debug adapter, such as 'hardware' or1039// 'software'. If present, the client may allow the user to select a mode and1040// include it in its `setBreakpoints` request.1041//1042// Clients may present the first applicable mode in this array as the1043// 'default' mode in gestures that set breakpoints.1044optional<array<BreakpointMode>> breakpointModes;1045// The set of characters that should trigger completion in a REPL. If not1046// specified, the UI should assume the `.` character.1047optional<array<string>> completionTriggerCharacters;1048// Available exception filter options for the `setExceptionBreakpoints`1049// request.1050optional<array<ExceptionBreakpointsFilter>> exceptionBreakpointFilters;1051// The debug adapter supports the `suspendDebuggee` attribute on the1052// `disconnect` request.1053optional<boolean> supportSuspendDebuggee;1054// The debug adapter supports the `terminateDebuggee` attribute on the1055// `disconnect` request.1056optional<boolean> supportTerminateDebuggee;1057// Checksum algorithms supported by the debug adapter.1058optional<array<ChecksumAlgorithm>> supportedChecksumAlgorithms;1059// The debug adapter supports the `breakpointLocations` request.1060optional<boolean> supportsBreakpointLocationsRequest;1061// The debug adapter supports the `cancel` request.1062optional<boolean> supportsCancelRequest;1063// The debug adapter supports the `clipboard` context value in the `evaluate`1064// request.1065optional<boolean> supportsClipboardContext;1066// The debug adapter supports the `completions` request.1067optional<boolean> supportsCompletionsRequest;1068// The debug adapter supports conditional breakpoints.1069optional<boolean> supportsConditionalBreakpoints;1070// The debug adapter supports the `configurationDone` request.1071optional<boolean> supportsConfigurationDoneRequest;1072// The debug adapter supports data breakpoints.1073optional<boolean> supportsDataBreakpoints;1074// The debug adapter supports the delayed loading of parts of the stack, which1075// requires that both the `startFrame` and `levels` arguments and the1076// `totalFrames` result of the `stackTrace` request are supported.1077optional<boolean> supportsDelayedStackTraceLoading;1078// The debug adapter supports the `disassemble` request.1079optional<boolean> supportsDisassembleRequest;1080// The debug adapter supports a (side effect free) `evaluate` request for data1081// hovers.1082optional<boolean> supportsEvaluateForHovers;1083// The debug adapter supports `filterOptions` as an argument on the1084// `setExceptionBreakpoints` request.1085optional<boolean> supportsExceptionFilterOptions;1086// The debug adapter supports the `exceptionInfo` request.1087optional<boolean> supportsExceptionInfoRequest;1088// The debug adapter supports `exceptionOptions` on the1089// `setExceptionBreakpoints` request.1090optional<boolean> supportsExceptionOptions;1091// The debug adapter supports function breakpoints.1092optional<boolean> supportsFunctionBreakpoints;1093// The debug adapter supports the `gotoTargets` request.1094optional<boolean> supportsGotoTargetsRequest;1095// The debug adapter supports breakpoints that break execution after a1096// specified number of hits.1097optional<boolean> supportsHitConditionalBreakpoints;1098// The debug adapter supports adding breakpoints based on instruction1099// references.1100optional<boolean> supportsInstructionBreakpoints;1101// The debug adapter supports the `loadedSources` request.1102optional<boolean> supportsLoadedSourcesRequest;1103// The debug adapter supports log points by interpreting the `logMessage`1104// attribute of the `SourceBreakpoint`.1105optional<boolean> supportsLogPoints;1106// The debug adapter supports the `modules` request.1107optional<boolean> supportsModulesRequest;1108// The debug adapter supports the `readMemory` request.1109optional<boolean> supportsReadMemoryRequest;1110// The debug adapter supports restarting a frame.1111optional<boolean> supportsRestartFrame;1112// The debug adapter supports the `restart` request. In this case a client1113// should not implement `restart` by terminating and relaunching the adapter1114// but by calling the `restart` request.1115optional<boolean> supportsRestartRequest;1116// The debug adapter supports the `setExpression` request.1117optional<boolean> supportsSetExpression;1118// The debug adapter supports setting a variable to a value.1119optional<boolean> supportsSetVariable;1120// The debug adapter supports the `singleThread` property on the execution1121// requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`,1122// `stepBack`).1123optional<boolean> supportsSingleThreadExecutionRequests;1124// The debug adapter supports stepping back via the `stepBack` and1125// `reverseContinue` requests.1126optional<boolean> supportsStepBack;1127// The debug adapter supports the `stepInTargets` request.1128optional<boolean> supportsStepInTargetsRequest;1129// The debug adapter supports stepping granularities (argument `granularity`)1130// for the stepping requests.1131optional<boolean> supportsSteppingGranularity;1132// The debug adapter supports the `terminate` request.1133optional<boolean> supportsTerminateRequest;1134// The debug adapter supports the `terminateThreads` request.1135optional<boolean> supportsTerminateThreadsRequest;1136// The debug adapter supports a `format` attribute on the `stackTrace`,1137// `variables`, and `evaluate` requests.1138optional<boolean> supportsValueFormattingOptions;1139// The debug adapter supports the `writeMemory` request.1140optional<boolean> supportsWriteMemoryRequest;1141};11421143DAP_DECLARE_STRUCT_TYPEINFO(InitializeResponse);11441145// The `initialize` request is sent as the first request from the client to the1146// debug adapter in order to configure it with client capabilities and to1147// retrieve capabilities from the debug adapter. Until the debug adapter has1148// responded with an `initialize` response, the client must not send any1149// additional requests or events to the debug adapter. In addition the debug1150// adapter is not allowed to send any requests or events to the client until it1151// has responded with an `initialize` response. The `initialize` request may1152// only be sent once.1153struct InitializeRequest : public Request {1154using Response = InitializeResponse;1155// The ID of the debug adapter.1156string adapterID;1157// The ID of the client using this adapter.1158optional<string> clientID;1159// The human-readable name of the client using this adapter.1160optional<string> clientName;1161// If true all column numbers are 1-based (default).1162optional<boolean> columnsStartAt1;1163// If true all line numbers are 1-based (default).1164optional<boolean> linesStartAt1;1165// The ISO-639 locale of the client using this adapter, e.g. en-US or de-CH.1166optional<string> locale;1167// Determines in what format paths are specified. The default is `path`, which1168// is the native format.1169//1170// May be one of the following enumeration values:1171// 'path', 'uri'1172optional<string> pathFormat;1173// Client supports the `argsCanBeInterpretedByShell` attribute on the1174// `runInTerminal` request.1175optional<boolean> supportsArgsCanBeInterpretedByShell;1176// Client supports the `invalidated` event.1177optional<boolean> supportsInvalidatedEvent;1178// Client supports the `memory` event.1179optional<boolean> supportsMemoryEvent;1180// Client supports memory references.1181optional<boolean> supportsMemoryReferences;1182// Client supports progress reporting.1183optional<boolean> supportsProgressReporting;1184// Client supports the `runInTerminal` request.1185optional<boolean> supportsRunInTerminalRequest;1186// Client supports the `startDebugging` request.1187optional<boolean> supportsStartDebuggingRequest;1188// Client supports the paging of variables.1189optional<boolean> supportsVariablePaging;1190// Client supports the `type` attribute for variables.1191optional<boolean> supportsVariableType;1192};11931194DAP_DECLARE_STRUCT_TYPEINFO(InitializeRequest);11951196// This event indicates that the debug adapter is ready to accept configuration1197// requests (e.g. `setBreakpoints`, `setExceptionBreakpoints`). A debug adapter1198// is expected to send this event when it is ready to accept configuration1199// requests (but not before the `initialize` request has finished). The sequence1200// of events/requests is as follows:1201// - adapters sends `initialized` event (after the `initialize` request has1202// returned)1203// - client sends zero or more `setBreakpoints` requests1204// - client sends one `setFunctionBreakpoints` request (if corresponding1205// capability `supportsFunctionBreakpoints` is true)1206// - client sends a `setExceptionBreakpoints` request if one or more1207// `exceptionBreakpointFilters` have been defined (or if1208// `supportsConfigurationDoneRequest` is not true)1209// - client sends other future configuration requests1210// - client sends one `configurationDone` request to indicate the end of the1211// configuration.1212struct InitializedEvent : public Event {};12131214DAP_DECLARE_STRUCT_TYPEINFO(InitializedEvent);12151216// Logical areas that can be invalidated by the `invalidated` event.1217using InvalidatedAreas = string;12181219// This event signals that some state in the debug adapter has changed and1220// requires that the client needs to re-render the data snapshot previously1221// requested. Debug adapters do not have to emit this event for runtime changes1222// like stopped or thread events because in that case the client refetches the1223// new state anyway. But the event can be used for example to refresh the UI1224// after rendering formatting has changed in the debug adapter. This event1225// should only be sent if the corresponding capability1226// `supportsInvalidatedEvent` is true.1227struct InvalidatedEvent : public Event {1228// Set of logical areas that got invalidated. This property has a hint1229// characteristic: a client can only be expected to make a 'best effort' in1230// honoring the areas but there are no guarantees. If this property is1231// missing, empty, or if values are not understood, the client should assume a1232// single value `all`.1233optional<array<InvalidatedAreas>> areas;1234// If specified, the client only needs to refetch data related to this stack1235// frame (and the `threadId` is ignored).1236optional<integer> stackFrameId;1237// If specified, the client only needs to refetch data related to this thread.1238optional<integer> threadId;1239};12401241DAP_DECLARE_STRUCT_TYPEINFO(InvalidatedEvent);12421243// Response to `launch` request. This is just an acknowledgement, so no body1244// field is required.1245struct LaunchResponse : public Response {};12461247DAP_DECLARE_STRUCT_TYPEINFO(LaunchResponse);12481249// This launch request is sent from the client to the debug adapter to start the1250// debuggee with or without debugging (if `noDebug` is true). Since launching is1251// debugger/runtime specific, the arguments for this request are not part of1252// this specification.1253struct LaunchRequest : public Request {1254using Response = LaunchResponse;1255// Arbitrary data from the previous, restarted session.1256// The data is sent as the `restart` attribute of the `terminated` event.1257// The client should leave the data intact.1258optional<variant<array<any>, boolean, integer, null, number, object, string>>1259restart;1260// If true, the launch request should launch the program without enabling1261// debugging.1262optional<boolean> noDebug;1263};12641265DAP_DECLARE_STRUCT_TYPEINFO(LaunchRequest);12661267// The event indicates that some source has been added, changed, or removed from1268// the set of all loaded sources.1269struct LoadedSourceEvent : public Event {1270// The reason for the event.1271//1272// Must be one of the following enumeration values:1273// 'new', 'changed', 'removed'1274string reason = "new";1275// The new, changed, or removed source.1276Source source;1277};12781279DAP_DECLARE_STRUCT_TYPEINFO(LoadedSourceEvent);12801281// Response to `loadedSources` request.1282struct LoadedSourcesResponse : public Response {1283// Set of loaded sources.1284array<Source> sources;1285};12861287DAP_DECLARE_STRUCT_TYPEINFO(LoadedSourcesResponse);12881289// Retrieves the set of all sources currently loaded by the debugged process.1290// Clients should only call this request if the corresponding capability1291// `supportsLoadedSourcesRequest` is true.1292struct LoadedSourcesRequest : public Request {1293using Response = LoadedSourcesResponse;1294};12951296DAP_DECLARE_STRUCT_TYPEINFO(LoadedSourcesRequest);12971298// This event indicates that some memory range has been updated. It should only1299// be sent if the corresponding capability `supportsMemoryEvent` is true.1300// Clients typically react to the event by re-issuing a `readMemory` request if1301// they show the memory identified by the `memoryReference` and if the updated1302// memory range overlaps the displayed range. Clients should not make1303// assumptions how individual memory references relate to each other, so they1304// should not assume that they are part of a single continuous address range and1305// might overlap. Debug adapters can use this event to indicate that the1306// contents of a memory range has changed due to some other request like1307// `setVariable` or `setExpression`. Debug adapters are not expected to emit1308// this event for each and every memory change of a running program, because1309// that information is typically not available from debuggers and it would flood1310// clients with too many events.1311struct MemoryEvent : public Event {1312// Number of bytes updated.1313integer count;1314// Memory reference of a memory range that has been updated.1315string memoryReference;1316// Starting offset in bytes where memory has been updated. Can be negative.1317integer offset;1318};13191320DAP_DECLARE_STRUCT_TYPEINFO(MemoryEvent);13211322// A Module object represents a row in the modules view.1323// The `id` attribute identifies a module in the modules view and is used in a1324// `module` event for identifying a module for adding, updating or deleting. The1325// `name` attribute is used to minimally render the module in the UI.1326//1327// Additional attributes can be added to the module. They show up in the module1328// view if they have a corresponding `ColumnDescriptor`.1329//1330// To avoid an unnecessary proliferation of additional attributes with similar1331// semantics but different names, we recommend to re-use attributes from the1332// 'recommended' list below first, and only introduce new attributes if nothing1333// appropriate could be found.1334struct Module {1335// Address range covered by this module.1336optional<string> addressRange;1337// Module created or modified, encoded as a RFC 3339 timestamp.1338optional<string> dateTimeStamp;1339// Unique identifier for the module.1340variant<integer, string> id;1341// True if the module is optimized.1342optional<boolean> isOptimized;1343// True if the module is considered 'user code' by a debugger that supports1344// 'Just My Code'.1345optional<boolean> isUserCode;1346// A name of the module.1347string name;1348// Logical full path to the module. The exact definition is implementation1349// defined, but usually this would be a full path to the on-disk file for the1350// module.1351optional<string> path;1352// Logical full path to the symbol file. The exact definition is1353// implementation defined.1354optional<string> symbolFilePath;1355// User-understandable description of if symbols were found for the module1356// (ex: 'Symbols Loaded', 'Symbols not found', etc.)1357optional<string> symbolStatus;1358// Version of Module.1359optional<string> version;1360};13611362DAP_DECLARE_STRUCT_TYPEINFO(Module);13631364// The event indicates that some information about a module has changed.1365struct ModuleEvent : public Event {1366// The new, changed, or removed module. In case of `removed` only the module1367// id is used.1368Module module;1369// The reason for the event.1370//1371// Must be one of the following enumeration values:1372// 'new', 'changed', 'removed'1373string reason = "new";1374};13751376DAP_DECLARE_STRUCT_TYPEINFO(ModuleEvent);13771378// Response to `modules` request.1379struct ModulesResponse : public Response {1380// All modules or range of modules.1381array<Module> modules;1382// The total number of modules available.1383optional<integer> totalModules;1384};13851386DAP_DECLARE_STRUCT_TYPEINFO(ModulesResponse);13871388// Modules can be retrieved from the debug adapter with this request which can1389// either return all modules or a range of modules to support paging. Clients1390// should only call this request if the corresponding capability1391// `supportsModulesRequest` is true.1392struct ModulesRequest : public Request {1393using Response = ModulesResponse;1394// The number of modules to return. If `moduleCount` is not specified or 0,1395// all modules are returned.1396optional<integer> moduleCount;1397// The index of the first module to return; if omitted modules start at 0.1398optional<integer> startModule;1399};14001401DAP_DECLARE_STRUCT_TYPEINFO(ModulesRequest);14021403// Response to `next` request. This is just an acknowledgement, so no body field1404// is required.1405struct NextResponse : public Response {};14061407DAP_DECLARE_STRUCT_TYPEINFO(NextResponse);14081409// The granularity of one 'step' in the stepping requests `next`, `stepIn`,1410// `stepOut`, and `stepBack`.1411//1412// Must be one of the following enumeration values:1413// 'statement', 'line', 'instruction'1414using SteppingGranularity = string;14151416// The request executes one step (in the given granularity) for the specified1417// thread and allows all other threads to run freely by resuming them. If the1418// debug adapter supports single thread execution (see capability1419// `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument1420// to true prevents other suspended threads from resuming. The debug adapter1421// first sends the response and then a `stopped` event (with reason `step`)1422// after the step has completed.1423struct NextRequest : public Request {1424using Response = NextResponse;1425// Stepping granularity. If no granularity is specified, a granularity of1426// `statement` is assumed.1427optional<SteppingGranularity> granularity;1428// If this flag is true, all other suspended threads are not resumed.1429optional<boolean> singleThread;1430// Specifies the thread for which to resume execution for one step (of the1431// given granularity).1432integer threadId;1433};14341435DAP_DECLARE_STRUCT_TYPEINFO(NextRequest);14361437// The event indicates that the target has produced some output.1438struct OutputEvent : public Event {1439// The output category. If not specified or if the category is not understood1440// by the client, `console` is assumed.1441//1442// May be one of the following enumeration values:1443// 'console', 'important', 'stdout', 'stderr', 'telemetry'1444optional<string> category;1445// The position in `line` where the output was produced. It is measured in1446// UTF-16 code units and the client capability `columnsStartAt1` determines1447// whether it is 0- or 1-based.1448optional<integer> column;1449// Additional data to report. For the `telemetry` category the data is sent to1450// telemetry, for the other categories the data is shown in JSON format.1451optional<variant<array<any>, boolean, integer, null, number, object, string>>1452data;1453// Support for keeping an output log organized by grouping related messages.1454//1455// Must be one of the following enumeration values:1456// 'start', 'startCollapsed', 'end'1457optional<string> group;1458// The source location's line where the output was produced.1459optional<integer> line;1460// The output to report.1461string output;1462// The source location where the output was produced.1463optional<Source> source;1464// If an attribute `variablesReference` exists and its value is > 0, the1465// output contains objects which can be retrieved by passing1466// `variablesReference` to the `variables` request as long as execution1467// remains suspended. See 'Lifetime of Object References' in the Overview1468// section for details.1469optional<integer> variablesReference;1470};14711472DAP_DECLARE_STRUCT_TYPEINFO(OutputEvent);14731474// Response to `pause` request. This is just an acknowledgement, so no body1475// field is required.1476struct PauseResponse : public Response {};14771478DAP_DECLARE_STRUCT_TYPEINFO(PauseResponse);14791480// The request suspends the debuggee.1481// The debug adapter first sends the response and then a `stopped` event (with1482// reason `pause`) after the thread has been paused successfully.1483struct PauseRequest : public Request {1484using Response = PauseResponse;1485// Pause execution for this thread.1486integer threadId;1487};14881489DAP_DECLARE_STRUCT_TYPEINFO(PauseRequest);14901491// The event indicates that the debugger has begun debugging a new process.1492// Either one that it has launched, or one that it has attached to.1493struct ProcessEvent : public Event {1494// If true, the process is running on the same computer as the debug adapter.1495optional<boolean> isLocalProcess;1496// The logical name of the process. This is usually the full path to process's1497// executable file. Example: /home/example/myproj/program.js.1498string name;1499// The size of a pointer or address for this process, in bits. This value may1500// be used by clients when formatting addresses for display.1501optional<integer> pointerSize;1502// Describes how the debug engine started debugging this process.1503//1504// Must be one of the following enumeration values:1505// 'launch', 'attach', 'attachForSuspendedLaunch'1506optional<string> startMethod;1507// The system process id of the debugged process. This property is missing for1508// non-system processes.1509optional<integer> systemProcessId;1510};15111512DAP_DECLARE_STRUCT_TYPEINFO(ProcessEvent);15131514// The event signals the end of the progress reporting with a final message.1515// This event should only be sent if the corresponding capability1516// `supportsProgressReporting` is true.1517struct ProgressEndEvent : public Event {1518// More detailed progress message. If omitted, the previous message (if any)1519// is used.1520optional<string> message;1521// The ID that was introduced in the initial `ProgressStartEvent`.1522string progressId;1523};15241525DAP_DECLARE_STRUCT_TYPEINFO(ProgressEndEvent);15261527// The event signals that a long running operation is about to start and1528// provides additional information for the client to set up a corresponding1529// progress and cancellation UI. The client is free to delay the showing of the1530// UI in order to reduce flicker. This event should only be sent if the1531// corresponding capability `supportsProgressReporting` is true.1532struct ProgressStartEvent : public Event {1533// If true, the request that reports progress may be cancelled with a `cancel`1534// request. So this property basically controls whether the client should use1535// UX that supports cancellation. Clients that don't support cancellation are1536// allowed to ignore the setting.1537optional<boolean> cancellable;1538// More detailed progress message.1539optional<string> message;1540// Progress percentage to display (value range: 0 to 100). If omitted no1541// percentage is shown.1542optional<number> percentage;1543// An ID that can be used in subsequent `progressUpdate` and `progressEnd`1544// events to make them refer to the same progress reporting. IDs must be1545// unique within a debug session.1546string progressId;1547// The request ID that this progress report is related to. If specified a1548// debug adapter is expected to emit progress events for the long running1549// request until the request has been either completed or cancelled. If the1550// request ID is omitted, the progress report is assumed to be related to some1551// general activity of the debug adapter.1552optional<integer> requestId;1553// Short title of the progress reporting. Shown in the UI to describe the long1554// running operation.1555string title;1556};15571558DAP_DECLARE_STRUCT_TYPEINFO(ProgressStartEvent);15591560// The event signals that the progress reporting needs to be updated with a new1561// message and/or percentage. The client does not have to update the UI1562// immediately, but the clients needs to keep track of the message and/or1563// percentage values. This event should only be sent if the corresponding1564// capability `supportsProgressReporting` is true.1565struct ProgressUpdateEvent : public Event {1566// More detailed progress message. If omitted, the previous message (if any)1567// is used.1568optional<string> message;1569// Progress percentage to display (value range: 0 to 100). If omitted no1570// percentage is shown.1571optional<number> percentage;1572// The ID that was introduced in the initial `progressStart` event.1573string progressId;1574};15751576DAP_DECLARE_STRUCT_TYPEINFO(ProgressUpdateEvent);15771578// Response to `readMemory` request.1579struct ReadMemoryResponse : public Response {1580// The address of the first byte of data returned.1581// Treated as a hex value if prefixed with `0x`, or as a decimal value1582// otherwise.1583string address;1584// The bytes read from memory, encoded using base64. If the decoded length of1585// `data` is less than the requested `count` in the original `readMemory`1586// request, and `unreadableBytes` is zero or omitted, then the client should1587// assume it's reached the end of readable memory.1588optional<string> data;1589// The number of unreadable bytes encountered after the last successfully read1590// byte. This can be used to determine the number of bytes that should be1591// skipped before a subsequent `readMemory` request succeeds.1592optional<integer> unreadableBytes;1593};15941595DAP_DECLARE_STRUCT_TYPEINFO(ReadMemoryResponse);15961597// Reads bytes from memory at the provided location.1598// Clients should only call this request if the corresponding capability1599// `supportsReadMemoryRequest` is true.1600struct ReadMemoryRequest : public Request {1601using Response = ReadMemoryResponse;1602// Number of bytes to read at the specified location and offset.1603integer count;1604// Memory reference to the base location from which data should be read.1605string memoryReference;1606// Offset (in bytes) to be applied to the reference location before reading1607// data. Can be negative.1608optional<integer> offset;1609};16101611DAP_DECLARE_STRUCT_TYPEINFO(ReadMemoryRequest);16121613// Response to `restartFrame` request. This is just an acknowledgement, so no1614// body field is required.1615struct RestartFrameResponse : public Response {};16161617DAP_DECLARE_STRUCT_TYPEINFO(RestartFrameResponse);16181619// The request restarts execution of the specified stack frame.1620// The debug adapter first sends the response and then a `stopped` event (with1621// reason `restart`) after the restart has completed. Clients should only call1622// this request if the corresponding capability `supportsRestartFrame` is true.1623struct RestartFrameRequest : public Request {1624using Response = RestartFrameResponse;1625// Restart the stack frame identified by `frameId`. The `frameId` must have1626// been obtained in the current suspended state. See 'Lifetime of Object1627// References' in the Overview section for details.1628integer frameId;1629};16301631DAP_DECLARE_STRUCT_TYPEINFO(RestartFrameRequest);16321633// Response to `restart` request. This is just an acknowledgement, so no body1634// field is required.1635struct RestartResponse : public Response {};16361637DAP_DECLARE_STRUCT_TYPEINFO(RestartResponse);16381639// Restarts a debug session. Clients should only call this request if the1640// corresponding capability `supportsRestartRequest` is true. If the capability1641// is missing or has the value false, a typical client emulates `restart` by1642// terminating the debug adapter first and then launching it anew.1643struct RestartRequest : public Request {1644using Response = RestartResponse;1645// The latest version of the `launch` or `attach` configuration.1646optional<object> arguments;1647};16481649DAP_DECLARE_STRUCT_TYPEINFO(RestartRequest);16501651// Response to `reverseContinue` request. This is just an acknowledgement, so no1652// body field is required.1653struct ReverseContinueResponse : public Response {};16541655DAP_DECLARE_STRUCT_TYPEINFO(ReverseContinueResponse);16561657// The request resumes backward execution of all threads. If the debug adapter1658// supports single thread execution (see capability1659// `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument1660// to true resumes only the specified thread. If not all threads were resumed,1661// the `allThreadsContinued` attribute of the response should be set to false.1662// Clients should only call this request if the corresponding capability1663// `supportsStepBack` is true.1664struct ReverseContinueRequest : public Request {1665using Response = ReverseContinueResponse;1666// If this flag is true, backward execution is resumed only for the thread1667// with given `threadId`.1668optional<boolean> singleThread;1669// Specifies the active thread. If the debug adapter supports single thread1670// execution (see `supportsSingleThreadExecutionRequests`) and the1671// `singleThread` argument is true, only the thread with this ID is resumed.1672integer threadId;1673};16741675DAP_DECLARE_STRUCT_TYPEINFO(ReverseContinueRequest);16761677// Response to `runInTerminal` request.1678struct RunInTerminalResponse : public Response {1679// The process ID. The value should be less than or equal to 21474836471680// (2^31-1).1681optional<integer> processId;1682// The process ID of the terminal shell. The value should be less than or1683// equal to 2147483647 (2^31-1).1684optional<integer> shellProcessId;1685};16861687DAP_DECLARE_STRUCT_TYPEINFO(RunInTerminalResponse);16881689// This request is sent from the debug adapter to the client to run a command in1690// a terminal. This is typically used to launch the debuggee in a terminal1691// provided by the client. This request should only be called if the1692// corresponding client capability `supportsRunInTerminalRequest` is true.1693// Client implementations of `runInTerminal` are free to run the command however1694// they choose including issuing the command to a command line interpreter (aka1695// 'shell'). Argument strings passed to the `runInTerminal` request must arrive1696// verbatim in the command to be run. As a consequence, clients which use a1697// shell are responsible for escaping any special shell characters in the1698// argument strings to prevent them from being interpreted (and modified) by the1699// shell. Some users may wish to take advantage of shell processing in the1700// argument strings. For clients which implement `runInTerminal` using an1701// intermediary shell, the `argsCanBeInterpretedByShell` property can be set to1702// true. In this case the client is requested not to escape any special shell1703// characters in the argument strings.1704struct RunInTerminalRequest : public Request {1705using Response = RunInTerminalResponse;1706// List of arguments. The first argument is the command to run.1707array<string> args;1708// This property should only be set if the corresponding capability1709// `supportsArgsCanBeInterpretedByShell` is true. If the client uses an1710// intermediary shell to launch the application, then the client must not1711// attempt to escape characters with special meanings for the shell. The user1712// is fully responsible for escaping as needed and that arguments using1713// special characters may not be portable across shells.1714optional<boolean> argsCanBeInterpretedByShell;1715// Working directory for the command. For non-empty, valid paths this1716// typically results in execution of a change directory command.1717string cwd;1718// Environment key-value pairs that are added to or removed from the default1719// environment.1720optional<object> env;1721// What kind of terminal to launch. Defaults to `integrated` if not specified.1722//1723// Must be one of the following enumeration values:1724// 'integrated', 'external'1725optional<string> kind;1726// Title of the terminal.1727optional<string> title;1728};17291730DAP_DECLARE_STRUCT_TYPEINFO(RunInTerminalRequest);17311732// A `Scope` is a named container for variables. Optionally a scope can map to a1733// source or a range within a source.1734struct Scope {1735// Start position of the range covered by the scope. It is measured in UTF-161736// code units and the client capability `columnsStartAt1` determines whether1737// it is 0- or 1-based.1738optional<integer> column;1739// End position of the range covered by the scope. It is measured in UTF-161740// code units and the client capability `columnsStartAt1` determines whether1741// it is 0- or 1-based.1742optional<integer> endColumn;1743// The end line of the range covered by this scope.1744optional<integer> endLine;1745// If true, the number of variables in this scope is large or expensive to1746// retrieve.1747boolean expensive;1748// The number of indexed variables in this scope.1749// The client can use this information to present the variables in a paged UI1750// and fetch them in chunks.1751optional<integer> indexedVariables;1752// The start line of the range covered by this scope.1753optional<integer> line;1754// Name of the scope such as 'Arguments', 'Locals', or 'Registers'. This1755// string is shown in the UI as is and can be translated.1756string name;1757// The number of named variables in this scope.1758// The client can use this information to present the variables in a paged UI1759// and fetch them in chunks.1760optional<integer> namedVariables;1761// A hint for how to present this scope in the UI. If this attribute is1762// missing, the scope is shown with a generic UI.1763//1764// May be one of the following enumeration values:1765// 'arguments', 'locals', 'registers'1766optional<string> presentationHint;1767// The source for this scope.1768optional<Source> source;1769// The variables of this scope can be retrieved by passing the value of1770// `variablesReference` to the `variables` request as long as execution1771// remains suspended. See 'Lifetime of Object References' in the Overview1772// section for details.1773integer variablesReference;1774};17751776DAP_DECLARE_STRUCT_TYPEINFO(Scope);17771778// Response to `scopes` request.1779struct ScopesResponse : public Response {1780// The scopes of the stack frame. If the array has length zero, there are no1781// scopes available.1782array<Scope> scopes;1783};17841785DAP_DECLARE_STRUCT_TYPEINFO(ScopesResponse);17861787// The request returns the variable scopes for a given stack frame ID.1788struct ScopesRequest : public Request {1789using Response = ScopesResponse;1790// Retrieve the scopes for the stack frame identified by `frameId`. The1791// `frameId` must have been obtained in the current suspended state. See1792// 'Lifetime of Object References' in the Overview section for details.1793integer frameId;1794};17951796DAP_DECLARE_STRUCT_TYPEINFO(ScopesRequest);17971798// Response to `setBreakpoints` request.1799// Returned is information about each breakpoint created by this request.1800// This includes the actual code location and whether the breakpoint could be1801// verified. The breakpoints returned are in the same order as the elements of1802// the `breakpoints` (or the deprecated `lines`) array in the arguments.1803struct SetBreakpointsResponse : public Response {1804// Information about the breakpoints.1805// The array elements are in the same order as the elements of the1806// `breakpoints` (or the deprecated `lines`) array in the arguments.1807array<Breakpoint> breakpoints;1808};18091810DAP_DECLARE_STRUCT_TYPEINFO(SetBreakpointsResponse);18111812// Properties of a breakpoint or logpoint passed to the `setBreakpoints`1813// request.1814struct SourceBreakpoint {1815// Start position within source line of the breakpoint or logpoint. It is1816// measured in UTF-16 code units and the client capability `columnsStartAt1`1817// determines whether it is 0- or 1-based.1818optional<integer> column;1819// The expression for conditional breakpoints.1820// It is only honored by a debug adapter if the corresponding capability1821// `supportsConditionalBreakpoints` is true.1822optional<string> condition;1823// The expression that controls how many hits of the breakpoint are ignored.1824// The debug adapter is expected to interpret the expression as needed.1825// The attribute is only honored by a debug adapter if the corresponding1826// capability `supportsHitConditionalBreakpoints` is true. If both this1827// property and `condition` are specified, `hitCondition` should be evaluated1828// only if the `condition` is met, and the debug adapter should stop only if1829// both conditions are met.1830optional<string> hitCondition;1831// The source line of the breakpoint or logpoint.1832integer line;1833// If this attribute exists and is non-empty, the debug adapter must not1834// 'break' (stop) but log the message instead. Expressions within `{}` are1835// interpolated. The attribute is only honored by a debug adapter if the1836// corresponding capability `supportsLogPoints` is true. If either1837// `hitCondition` or `condition` is specified, then the message should only be1838// logged if those conditions are met.1839optional<string> logMessage;1840// The mode of this breakpoint. If defined, this must be one of the1841// `breakpointModes` the debug adapter advertised in its `Capabilities`.1842optional<string> mode;1843};18441845DAP_DECLARE_STRUCT_TYPEINFO(SourceBreakpoint);18461847// Sets multiple breakpoints for a single source and clears all previous1848// breakpoints in that source. To clear all breakpoint for a source, specify an1849// empty array. When a breakpoint is hit, a `stopped` event (with reason1850// `breakpoint`) is generated.1851struct SetBreakpointsRequest : public Request {1852using Response = SetBreakpointsResponse;1853// The code locations of the breakpoints.1854optional<array<SourceBreakpoint>> breakpoints;1855// Deprecated: The code locations of the breakpoints.1856optional<array<integer>> lines;1857// The source location of the breakpoints; either `source.path` or1858// `source.sourceReference` must be specified.1859Source source;1860// A value of true indicates that the underlying source has been modified1861// which results in new breakpoint locations.1862optional<boolean> sourceModified;1863};18641865DAP_DECLARE_STRUCT_TYPEINFO(SetBreakpointsRequest);18661867// Response to `setDataBreakpoints` request.1868// Returned is information about each breakpoint created by this request.1869struct SetDataBreakpointsResponse : public Response {1870// Information about the data breakpoints. The array elements correspond to1871// the elements of the input argument `breakpoints` array.1872array<Breakpoint> breakpoints;1873};18741875DAP_DECLARE_STRUCT_TYPEINFO(SetDataBreakpointsResponse);18761877// Properties of a data breakpoint passed to the `setDataBreakpoints` request.1878struct DataBreakpoint {1879// The access type of the data.1880optional<DataBreakpointAccessType> accessType;1881// An expression for conditional breakpoints.1882optional<string> condition;1883// An id representing the data. This id is returned from the1884// `dataBreakpointInfo` request.1885string dataId;1886// An expression that controls how many hits of the breakpoint are ignored.1887// The debug adapter is expected to interpret the expression as needed.1888optional<string> hitCondition;1889};18901891DAP_DECLARE_STRUCT_TYPEINFO(DataBreakpoint);18921893// Replaces all existing data breakpoints with new data breakpoints.1894// To clear all data breakpoints, specify an empty array.1895// When a data breakpoint is hit, a `stopped` event (with reason `data1896// breakpoint`) is generated. Clients should only call this request if the1897// corresponding capability `supportsDataBreakpoints` is true.1898struct SetDataBreakpointsRequest : public Request {1899using Response = SetDataBreakpointsResponse;1900// The contents of this array replaces all existing data breakpoints. An empty1901// array clears all data breakpoints.1902array<DataBreakpoint> breakpoints;1903};19041905DAP_DECLARE_STRUCT_TYPEINFO(SetDataBreakpointsRequest);19061907// Response to `setExceptionBreakpoints` request.1908// The response contains an array of `Breakpoint` objects with information about1909// each exception breakpoint or filter. The `Breakpoint` objects are in the same1910// order as the elements of the `filters`, `filterOptions`, `exceptionOptions`1911// arrays given as arguments. If both `filters` and `filterOptions` are given,1912// the returned array must start with `filters` information first, followed by1913// `filterOptions` information. The `verified` property of a `Breakpoint` object1914// signals whether the exception breakpoint or filter could be successfully1915// created and whether the condition is valid. In case of an error the `message`1916// property explains the problem. The `id` property can be used to introduce a1917// unique ID for the exception breakpoint or filter so that it can be updated1918// subsequently by sending breakpoint events. For backward compatibility both1919// the `breakpoints` array and the enclosing `body` are optional. If these1920// elements are missing a client is not able to show problems for individual1921// exception breakpoints or filters.1922struct SetExceptionBreakpointsResponse : public Response {1923// Information about the exception breakpoints or filters.1924// The breakpoints returned are in the same order as the elements of the1925// `filters`, `filterOptions`, `exceptionOptions` arrays in the arguments. If1926// both `filters` and `filterOptions` are given, the returned array must start1927// with `filters` information first, followed by `filterOptions` information.1928optional<array<Breakpoint>> breakpoints;1929};19301931DAP_DECLARE_STRUCT_TYPEINFO(SetExceptionBreakpointsResponse);19321933// An `ExceptionPathSegment` represents a segment in a path that is used to1934// match leafs or nodes in a tree of exceptions. If a segment consists of more1935// than one name, it matches the names provided if `negate` is false or missing,1936// or it matches anything except the names provided if `negate` is true.1937struct ExceptionPathSegment {1938// Depending on the value of `negate` the names that should match or not1939// match.1940array<string> names;1941// If false or missing this segment matches the names provided, otherwise it1942// matches anything except the names provided.1943optional<boolean> negate;1944};19451946DAP_DECLARE_STRUCT_TYPEINFO(ExceptionPathSegment);19471948// An `ExceptionOptions` assigns configuration options to a set of exceptions.1949struct ExceptionOptions {1950// Condition when a thrown exception should result in a break.1951ExceptionBreakMode breakMode = "never";1952// A path that selects a single or multiple exceptions in a tree. If `path` is1953// missing, the whole tree is selected. By convention the first segment of the1954// path is a category that is used to group exceptions in the UI.1955optional<array<ExceptionPathSegment>> path;1956};19571958DAP_DECLARE_STRUCT_TYPEINFO(ExceptionOptions);19591960// An `ExceptionFilterOptions` is used to specify an exception filter together1961// with a condition for the `setExceptionBreakpoints` request.1962struct ExceptionFilterOptions {1963// An expression for conditional exceptions.1964// The exception breaks into the debugger if the result of the condition is1965// true.1966optional<string> condition;1967// ID of an exception filter returned by the `exceptionBreakpointFilters`1968// capability.1969string filterId;1970// The mode of this exception breakpoint. If defined, this must be one of the1971// `breakpointModes` the debug adapter advertised in its `Capabilities`.1972optional<string> mode;1973};19741975DAP_DECLARE_STRUCT_TYPEINFO(ExceptionFilterOptions);19761977// The request configures the debugger's response to thrown exceptions. Each of1978// the `filters`, `filterOptions`, and `exceptionOptions` in the request are1979// independent configurations to a debug adapter indicating a kind of exception1980// to catch. An exception thrown in a program should result in a `stopped` event1981// from the debug adapter (with reason `exception`) if any of the configured1982// filters match. Clients should only call this request if the corresponding1983// capability `exceptionBreakpointFilters` returns one or more filters.1984struct SetExceptionBreakpointsRequest : public Request {1985using Response = SetExceptionBreakpointsResponse;1986// Configuration options for selected exceptions.1987// The attribute is only honored by a debug adapter if the corresponding1988// capability `supportsExceptionOptions` is true.1989optional<array<ExceptionOptions>> exceptionOptions;1990// Set of exception filters and their options. The set of all possible1991// exception filters is defined by the `exceptionBreakpointFilters`1992// capability. This attribute is only honored by a debug adapter if the1993// corresponding capability `supportsExceptionFilterOptions` is true. The1994// `filter` and `filterOptions` sets are additive.1995optional<array<ExceptionFilterOptions>> filterOptions;1996// Set of exception filters specified by their ID. The set of all possible1997// exception filters is defined by the `exceptionBreakpointFilters`1998// capability. The `filter` and `filterOptions` sets are additive.1999array<string> filters;2000};20012002DAP_DECLARE_STRUCT_TYPEINFO(SetExceptionBreakpointsRequest);20032004// Response to `setExpression` request.2005struct SetExpressionResponse : public Response {2006// The number of indexed child variables.2007// The client can use this information to present the variables in a paged UI2008// and fetch them in chunks. The value should be less than or equal to2009// 2147483647 (2^31-1).2010optional<integer> indexedVariables;2011// A memory reference to a location appropriate for this result.2012// For pointer type eval results, this is generally a reference to the memory2013// address contained in the pointer. This attribute may be returned by a debug2014// adapter if corresponding capability `supportsMemoryReferences` is true.2015optional<string> memoryReference;2016// The number of named child variables.2017// The client can use this information to present the variables in a paged UI2018// and fetch them in chunks. The value should be less than or equal to2019// 2147483647 (2^31-1).2020optional<integer> namedVariables;2021// Properties of a value that can be used to determine how to render the2022// result in the UI.2023optional<VariablePresentationHint> presentationHint;2024// The type of the value.2025// This attribute should only be returned by a debug adapter if the2026// corresponding capability `supportsVariableType` is true.2027optional<string> type;2028// The new value of the expression.2029string value;2030// If `variablesReference` is > 0, the evaluate result is structured and its2031// children can be retrieved by passing `variablesReference` to the2032// `variables` request as long as execution remains suspended. See 'Lifetime2033// of Object References' in the Overview section for details.2034optional<integer> variablesReference;2035};20362037DAP_DECLARE_STRUCT_TYPEINFO(SetExpressionResponse);20382039// Evaluates the given `value` expression and assigns it to the `expression`2040// which must be a modifiable l-value. The expressions have access to any2041// variables and arguments that are in scope of the specified frame. Clients2042// should only call this request if the corresponding capability2043// `supportsSetExpression` is true. If a debug adapter implements both2044// `setExpression` and `setVariable`, a client uses `setExpression` if the2045// variable has an `evaluateName` property.2046struct SetExpressionRequest : public Request {2047using Response = SetExpressionResponse;2048// The l-value expression to assign to.2049string expression;2050// Specifies how the resulting value should be formatted.2051optional<ValueFormat> format;2052// Evaluate the expressions in the scope of this stack frame. If not2053// specified, the expressions are evaluated in the global scope.2054optional<integer> frameId;2055// The value expression to assign to the l-value expression.2056string value;2057};20582059DAP_DECLARE_STRUCT_TYPEINFO(SetExpressionRequest);20602061// Response to `setFunctionBreakpoints` request.2062// Returned is information about each breakpoint created by this request.2063struct SetFunctionBreakpointsResponse : public Response {2064// Information about the breakpoints. The array elements correspond to the2065// elements of the `breakpoints` array.2066array<Breakpoint> breakpoints;2067};20682069DAP_DECLARE_STRUCT_TYPEINFO(SetFunctionBreakpointsResponse);20702071// Properties of a breakpoint passed to the `setFunctionBreakpoints` request.2072struct FunctionBreakpoint {2073// An expression for conditional breakpoints.2074// It is only honored by a debug adapter if the corresponding capability2075// `supportsConditionalBreakpoints` is true.2076optional<string> condition;2077// An expression that controls how many hits of the breakpoint are ignored.2078// The debug adapter is expected to interpret the expression as needed.2079// The attribute is only honored by a debug adapter if the corresponding2080// capability `supportsHitConditionalBreakpoints` is true.2081optional<string> hitCondition;2082// The name of the function.2083string name;2084};20852086DAP_DECLARE_STRUCT_TYPEINFO(FunctionBreakpoint);20872088// Replaces all existing function breakpoints with new function breakpoints.2089// To clear all function breakpoints, specify an empty array.2090// When a function breakpoint is hit, a `stopped` event (with reason `function2091// breakpoint`) is generated. Clients should only call this request if the2092// corresponding capability `supportsFunctionBreakpoints` is true.2093struct SetFunctionBreakpointsRequest : public Request {2094using Response = SetFunctionBreakpointsResponse;2095// The function names of the breakpoints.2096array<FunctionBreakpoint> breakpoints;2097};20982099DAP_DECLARE_STRUCT_TYPEINFO(SetFunctionBreakpointsRequest);21002101// Response to `setInstructionBreakpoints` request2102struct SetInstructionBreakpointsResponse : public Response {2103// Information about the breakpoints. The array elements correspond to the2104// elements of the `breakpoints` array.2105array<Breakpoint> breakpoints;2106};21072108DAP_DECLARE_STRUCT_TYPEINFO(SetInstructionBreakpointsResponse);21092110// Properties of a breakpoint passed to the `setInstructionBreakpoints` request2111struct InstructionBreakpoint {2112// An expression for conditional breakpoints.2113// It is only honored by a debug adapter if the corresponding capability2114// `supportsConditionalBreakpoints` is true.2115optional<string> condition;2116// An expression that controls how many hits of the breakpoint are ignored.2117// The debug adapter is expected to interpret the expression as needed.2118// The attribute is only honored by a debug adapter if the corresponding2119// capability `supportsHitConditionalBreakpoints` is true.2120optional<string> hitCondition;2121// The instruction reference of the breakpoint.2122// This should be a memory or instruction pointer reference from an2123// `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or2124// `Breakpoint`.2125string instructionReference;2126// The mode of this breakpoint. If defined, this must be one of the2127// `breakpointModes` the debug adapter advertised in its `Capabilities`.2128optional<string> mode;2129// The offset from the instruction reference in bytes.2130// This can be negative.2131optional<integer> offset;2132};21332134DAP_DECLARE_STRUCT_TYPEINFO(InstructionBreakpoint);21352136// Replaces all existing instruction breakpoints. Typically, instruction2137// breakpoints would be set from a disassembly window. To clear all instruction2138// breakpoints, specify an empty array. When an instruction breakpoint is hit, a2139// `stopped` event (with reason `instruction breakpoint`) is generated. Clients2140// should only call this request if the corresponding capability2141// `supportsInstructionBreakpoints` is true.2142struct SetInstructionBreakpointsRequest : public Request {2143using Response = SetInstructionBreakpointsResponse;2144// The instruction references of the breakpoints2145array<InstructionBreakpoint> breakpoints;2146};21472148DAP_DECLARE_STRUCT_TYPEINFO(SetInstructionBreakpointsRequest);21492150// Response to `setVariable` request.2151struct SetVariableResponse : public Response {2152// The number of indexed child variables.2153// The client can use this information to present the variables in a paged UI2154// and fetch them in chunks. The value should be less than or equal to2155// 2147483647 (2^31-1).2156optional<integer> indexedVariables;2157// A memory reference to a location appropriate for this result.2158// For pointer type eval results, this is generally a reference to the memory2159// address contained in the pointer. This attribute may be returned by a debug2160// adapter if corresponding capability `supportsMemoryReferences` is true.2161optional<string> memoryReference;2162// The number of named child variables.2163// The client can use this information to present the variables in a paged UI2164// and fetch them in chunks. The value should be less than or equal to2165// 2147483647 (2^31-1).2166optional<integer> namedVariables;2167// The type of the new value. Typically shown in the UI when hovering over the2168// value.2169optional<string> type;2170// The new value of the variable.2171string value;2172// If `variablesReference` is > 0, the new value is structured and its2173// children can be retrieved by passing `variablesReference` to the2174// `variables` request as long as execution remains suspended. See 'Lifetime2175// of Object References' in the Overview section for details.2176optional<integer> variablesReference;2177};21782179DAP_DECLARE_STRUCT_TYPEINFO(SetVariableResponse);21802181// Set the variable with the given name in the variable container to a new2182// value. Clients should only call this request if the corresponding capability2183// `supportsSetVariable` is true. If a debug adapter implements both2184// `setVariable` and `setExpression`, a client will only use `setExpression` if2185// the variable has an `evaluateName` property.2186struct SetVariableRequest : public Request {2187using Response = SetVariableResponse;2188// Specifies details on how to format the response value.2189optional<ValueFormat> format;2190// The name of the variable in the container.2191string name;2192// The value of the variable.2193string value;2194// The reference of the variable container. The `variablesReference` must have2195// been obtained in the current suspended state. See 'Lifetime of Object2196// References' in the Overview section for details.2197integer variablesReference;2198};21992200DAP_DECLARE_STRUCT_TYPEINFO(SetVariableRequest);22012202// Response to `source` request.2203struct SourceResponse : public Response {2204// Content of the source reference.2205string content;2206// Content type (MIME type) of the source.2207optional<string> mimeType;2208};22092210DAP_DECLARE_STRUCT_TYPEINFO(SourceResponse);22112212// The request retrieves the source code for a given source reference.2213struct SourceRequest : public Request {2214using Response = SourceResponse;2215// Specifies the source content to load. Either `source.path` or2216// `source.sourceReference` must be specified.2217optional<Source> source;2218// The reference to the source. This is the same as `source.sourceReference`.2219// This is provided for backward compatibility since old clients do not2220// understand the `source` attribute.2221integer sourceReference;2222};22232224DAP_DECLARE_STRUCT_TYPEINFO(SourceRequest);22252226// A Stackframe contains the source location.2227struct StackFrame {2228// Indicates whether this frame can be restarted with the `restart` request.2229// Clients should only use this if the debug adapter supports the `restart`2230// request and the corresponding capability `supportsRestartRequest` is true.2231// If a debug adapter has this capability, then `canRestart` defaults to2232// `true` if the property is absent.2233optional<boolean> canRestart;2234// Start position of the range covered by the stack frame. It is measured in2235// UTF-16 code units and the client capability `columnsStartAt1` determines2236// whether it is 0- or 1-based. If attribute `source` is missing or doesn't2237// exist, `column` is 0 and should be ignored by the client.2238integer column;2239// End position of the range covered by the stack frame. It is measured in2240// UTF-16 code units and the client capability `columnsStartAt1` determines2241// whether it is 0- or 1-based.2242optional<integer> endColumn;2243// The end line of the range covered by the stack frame.2244optional<integer> endLine;2245// An identifier for the stack frame. It must be unique across all threads.2246// This id can be used to retrieve the scopes of the frame with the `scopes`2247// request or to restart the execution of a stack frame.2248integer id;2249// A memory reference for the current instruction pointer in this frame.2250optional<string> instructionPointerReference;2251// The line within the source of the frame. If the source attribute is missing2252// or doesn't exist, `line` is 0 and should be ignored by the client.2253integer line;2254// The module associated with this frame, if any.2255optional<variant<integer, string>> moduleId;2256// The name of the stack frame, typically a method name.2257string name;2258// A hint for how to present this frame in the UI.2259// A value of `label` can be used to indicate that the frame is an artificial2260// frame that is used as a visual label or separator. A value of `subtle` can2261// be used to change the appearance of a frame in a 'subtle' way.2262//2263// Must be one of the following enumeration values:2264// 'normal', 'label', 'subtle'2265optional<string> presentationHint;2266// The source of the frame.2267optional<Source> source;2268};22692270DAP_DECLARE_STRUCT_TYPEINFO(StackFrame);22712272// Response to `stackTrace` request.2273struct StackTraceResponse : public Response {2274// The frames of the stack frame. If the array has length zero, there are no2275// stack frames available. This means that there is no location information2276// available.2277array<StackFrame> stackFrames;2278// The total number of frames available in the stack. If omitted or if2279// `totalFrames` is larger than the available frames, a client is expected to2280// request frames until a request returns less frames than requested (which2281// indicates the end of the stack). Returning monotonically increasing2282// `totalFrames` values for subsequent requests can be used to enforce paging2283// in the client.2284optional<integer> totalFrames;2285};22862287DAP_DECLARE_STRUCT_TYPEINFO(StackTraceResponse);22882289// Provides formatting information for a stack frame.2290struct StackFrameFormat : public ValueFormat {2291// Includes all stack frames, including those the debug adapter might2292// otherwise hide.2293optional<boolean> includeAll;2294// Displays the line number of the stack frame.2295optional<boolean> line;2296// Displays the module of the stack frame.2297optional<boolean> module;2298// Displays the names of parameters for the stack frame.2299optional<boolean> parameterNames;2300// Displays the types of parameters for the stack frame.2301optional<boolean> parameterTypes;2302// Displays the values of parameters for the stack frame.2303optional<boolean> parameterValues;2304// Displays parameters for the stack frame.2305optional<boolean> parameters;2306};23072308DAP_DECLARE_STRUCT_TYPEINFO(StackFrameFormat);23092310// The request returns a stacktrace from the current execution state of a given2311// thread. A client can request all stack frames by omitting the startFrame and2312// levels arguments. For performance-conscious clients and if the corresponding2313// capability `supportsDelayedStackTraceLoading` is true, stack frames can be2314// retrieved in a piecemeal way with the `startFrame` and `levels` arguments.2315// The response of the `stackTrace` request may contain a `totalFrames` property2316// that hints at the total number of frames in the stack. If a client needs this2317// total number upfront, it can issue a request for a single (first) frame and2318// depending on the value of `totalFrames` decide how to proceed. In any case a2319// client should be prepared to receive fewer frames than requested, which is an2320// indication that the end of the stack has been reached.2321struct StackTraceRequest : public Request {2322using Response = StackTraceResponse;2323// Specifies details on how to format the stack frames.2324// The attribute is only honored by a debug adapter if the corresponding2325// capability `supportsValueFormattingOptions` is true.2326optional<StackFrameFormat> format;2327// The maximum number of frames to return. If levels is not specified or 0,2328// all frames are returned.2329optional<integer> levels;2330// The index of the first frame to return; if omitted frames start at 0.2331optional<integer> startFrame;2332// Retrieve the stacktrace for this thread.2333integer threadId;2334};23352336DAP_DECLARE_STRUCT_TYPEINFO(StackTraceRequest);23372338// Response to `startDebugging` request. This is just an acknowledgement, so no2339// body field is required.2340struct StartDebuggingResponse : public Response {};23412342DAP_DECLARE_STRUCT_TYPEINFO(StartDebuggingResponse);23432344// This request is sent from the debug adapter to the client to start a new2345// debug session of the same type as the caller. This request should only be2346// sent if the corresponding client capability `supportsStartDebuggingRequest`2347// is true. A client implementation of `startDebugging` should start a new debug2348// session (of the same type as the caller) in the same way that the caller's2349// session was started. If the client supports hierarchical debug sessions, the2350// newly created session can be treated as a child of the caller session.2351struct StartDebuggingRequest : public Request {2352using Response = StartDebuggingResponse;2353// Arguments passed to the new debug session. The arguments must only contain2354// properties understood by the `launch` or `attach` requests of the debug2355// adapter and they must not contain any client-specific properties (e.g.2356// `type`) or client-specific features (e.g. substitutable 'variables').2357object configuration;2358// Indicates whether the new debug session should be started with a `launch`2359// or `attach` request.2360//2361// Must be one of the following enumeration values:2362// 'launch', 'attach'2363string request = "launch";2364};23652366DAP_DECLARE_STRUCT_TYPEINFO(StartDebuggingRequest);23672368// Response to `stepBack` request. This is just an acknowledgement, so no body2369// field is required.2370struct StepBackResponse : public Response {};23712372DAP_DECLARE_STRUCT_TYPEINFO(StepBackResponse);23732374// The request executes one backward step (in the given granularity) for the2375// specified thread and allows all other threads to run backward freely by2376// resuming them. If the debug adapter supports single thread execution (see2377// capability `supportsSingleThreadExecutionRequests`), setting the2378// `singleThread` argument to true prevents other suspended threads from2379// resuming. The debug adapter first sends the response and then a `stopped`2380// event (with reason `step`) after the step has completed. Clients should only2381// call this request if the corresponding capability `supportsStepBack` is true.2382struct StepBackRequest : public Request {2383using Response = StepBackResponse;2384// Stepping granularity to step. If no granularity is specified, a granularity2385// of `statement` is assumed.2386optional<SteppingGranularity> granularity;2387// If this flag is true, all other suspended threads are not resumed.2388optional<boolean> singleThread;2389// Specifies the thread for which to resume execution for one step backwards2390// (of the given granularity).2391integer threadId;2392};23932394DAP_DECLARE_STRUCT_TYPEINFO(StepBackRequest);23952396// Response to `stepIn` request. This is just an acknowledgement, so no body2397// field is required.2398struct StepInResponse : public Response {};23992400DAP_DECLARE_STRUCT_TYPEINFO(StepInResponse);24012402// The request resumes the given thread to step into a function/method and2403// allows all other threads to run freely by resuming them. If the debug adapter2404// supports single thread execution (see capability2405// `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument2406// to true prevents other suspended threads from resuming. If the request cannot2407// step into a target, `stepIn` behaves like the `next` request. The debug2408// adapter first sends the response and then a `stopped` event (with reason2409// `step`) after the step has completed. If there are multiple function/method2410// calls (or other targets) on the source line, the argument `targetId` can be2411// used to control into which target the `stepIn` should occur. The list of2412// possible targets for a given source line can be retrieved via the2413// `stepInTargets` request.2414struct StepInRequest : public Request {2415using Response = StepInResponse;2416// Stepping granularity. If no granularity is specified, a granularity of2417// `statement` is assumed.2418optional<SteppingGranularity> granularity;2419// If this flag is true, all other suspended threads are not resumed.2420optional<boolean> singleThread;2421// Id of the target to step into.2422optional<integer> targetId;2423// Specifies the thread for which to resume execution for one step-into (of2424// the given granularity).2425integer threadId;2426};24272428DAP_DECLARE_STRUCT_TYPEINFO(StepInRequest);24292430// A `StepInTarget` can be used in the `stepIn` request and determines into2431// which single target the `stepIn` request should step.2432struct StepInTarget {2433// Start position of the range covered by the step in target. It is measured2434// in UTF-16 code units and the client capability `columnsStartAt1` determines2435// whether it is 0- or 1-based.2436optional<integer> column;2437// End position of the range covered by the step in target. It is measured in2438// UTF-16 code units and the client capability `columnsStartAt1` determines2439// whether it is 0- or 1-based.2440optional<integer> endColumn;2441// The end line of the range covered by the step-in target.2442optional<integer> endLine;2443// Unique identifier for a step-in target.2444integer id;2445// The name of the step-in target (shown in the UI).2446string label;2447// The line of the step-in target.2448optional<integer> line;2449};24502451DAP_DECLARE_STRUCT_TYPEINFO(StepInTarget);24522453// Response to `stepInTargets` request.2454struct StepInTargetsResponse : public Response {2455// The possible step-in targets of the specified source location.2456array<StepInTarget> targets;2457};24582459DAP_DECLARE_STRUCT_TYPEINFO(StepInTargetsResponse);24602461// This request retrieves the possible step-in targets for the specified stack2462// frame. These targets can be used in the `stepIn` request. Clients should only2463// call this request if the corresponding capability2464// `supportsStepInTargetsRequest` is true.2465struct StepInTargetsRequest : public Request {2466using Response = StepInTargetsResponse;2467// The stack frame for which to retrieve the possible step-in targets.2468integer frameId;2469};24702471DAP_DECLARE_STRUCT_TYPEINFO(StepInTargetsRequest);24722473// Response to `stepOut` request. This is just an acknowledgement, so no body2474// field is required.2475struct StepOutResponse : public Response {};24762477DAP_DECLARE_STRUCT_TYPEINFO(StepOutResponse);24782479// The request resumes the given thread to step out (return) from a2480// function/method and allows all other threads to run freely by resuming them.2481// If the debug adapter supports single thread execution (see capability2482// `supportsSingleThreadExecutionRequests`), setting the `singleThread` argument2483// to true prevents other suspended threads from resuming. The debug adapter2484// first sends the response and then a `stopped` event (with reason `step`)2485// after the step has completed.2486struct StepOutRequest : public Request {2487using Response = StepOutResponse;2488// Stepping granularity. If no granularity is specified, a granularity of2489// `statement` is assumed.2490optional<SteppingGranularity> granularity;2491// If this flag is true, all other suspended threads are not resumed.2492optional<boolean> singleThread;2493// Specifies the thread for which to resume execution for one step-out (of the2494// given granularity).2495integer threadId;2496};24972498DAP_DECLARE_STRUCT_TYPEINFO(StepOutRequest);24992500// The event indicates that the execution of the debuggee has stopped due to2501// some condition. This can be caused by a breakpoint previously set, a stepping2502// request has completed, by executing a debugger statement etc.2503struct StoppedEvent : public Event {2504// If `allThreadsStopped` is true, a debug adapter can announce that all2505// threads have stopped.2506// - The client should use this information to enable that all threads can be2507// expanded to access their stacktraces.2508// - If the attribute is missing or false, only the thread with the given2509// `threadId` can be expanded.2510optional<boolean> allThreadsStopped;2511// The full reason for the event, e.g. 'Paused on exception'. This string is2512// shown in the UI as is and can be translated.2513optional<string> description;2514// Ids of the breakpoints that triggered the event. In most cases there is2515// only a single breakpoint but here are some examples for multiple2516// breakpoints:2517// - Different types of breakpoints map to the same location.2518// - Multiple source breakpoints get collapsed to the same instruction by the2519// compiler/runtime.2520// - Multiple function breakpoints with different function names map to the2521// same location.2522optional<array<integer>> hitBreakpointIds;2523// A value of true hints to the client that this event should not change the2524// focus.2525optional<boolean> preserveFocusHint;2526// The reason for the event.2527// For backward compatibility this string is shown in the UI if the2528// `description` attribute is missing (but it must not be translated).2529//2530// May be one of the following enumeration values:2531// 'step', 'breakpoint', 'exception', 'pause', 'entry', 'goto', 'function2532// breakpoint', 'data breakpoint', 'instruction breakpoint'2533string reason;2534// Additional information. E.g. if reason is `exception`, text contains the2535// exception name. This string is shown in the UI.2536optional<string> text;2537// The thread which was stopped.2538optional<integer> threadId;2539};25402541DAP_DECLARE_STRUCT_TYPEINFO(StoppedEvent);25422543// Response to `terminate` request. This is just an acknowledgement, so no body2544// field is required.2545struct TerminateResponse : public Response {};25462547DAP_DECLARE_STRUCT_TYPEINFO(TerminateResponse);25482549// The `terminate` request is sent from the client to the debug adapter in order2550// to shut down the debuggee gracefully. Clients should only call this request2551// if the capability `supportsTerminateRequest` is true. Typically a debug2552// adapter implements `terminate` by sending a software signal which the2553// debuggee intercepts in order to clean things up properly before terminating2554// itself. Please note that this request does not directly affect the state of2555// the debug session: if the debuggee decides to veto the graceful shutdown for2556// any reason by not terminating itself, then the debug session just continues.2557// Clients can surface the `terminate` request as an explicit command or they2558// can integrate it into a two stage Stop command that first sends `terminate`2559// to request a graceful shutdown, and if that fails uses `disconnect` for a2560// forceful shutdown.2561struct TerminateRequest : public Request {2562using Response = TerminateResponse;2563// A value of true indicates that this `terminate` request is part of a2564// restart sequence.2565optional<boolean> restart;2566};25672568DAP_DECLARE_STRUCT_TYPEINFO(TerminateRequest);25692570// Response to `terminateThreads` request. This is just an acknowledgement, no2571// body field is required.2572struct TerminateThreadsResponse : public Response {};25732574DAP_DECLARE_STRUCT_TYPEINFO(TerminateThreadsResponse);25752576// The request terminates the threads with the given ids.2577// Clients should only call this request if the corresponding capability2578// `supportsTerminateThreadsRequest` is true.2579struct TerminateThreadsRequest : public Request {2580using Response = TerminateThreadsResponse;2581// Ids of threads to be terminated.2582optional<array<integer>> threadIds;2583};25842585DAP_DECLARE_STRUCT_TYPEINFO(TerminateThreadsRequest);25862587// The event indicates that debugging of the debuggee has terminated. This does2588// **not** mean that the debuggee itself has exited.2589struct TerminatedEvent : public Event {2590// A debug adapter may set `restart` to true (or to an arbitrary object) to2591// request that the client restarts the session. The value is not interpreted2592// by the client and passed unmodified as an attribute `__restart` to the2593// `launch` and `attach` requests.2594optional<variant<array<any>, boolean, integer, null, number, object, string>>2595restart;2596};25972598DAP_DECLARE_STRUCT_TYPEINFO(TerminatedEvent);25992600// The event indicates that a thread has started or exited.2601struct ThreadEvent : public Event {2602// The reason for the event.2603//2604// May be one of the following enumeration values:2605// 'started', 'exited'2606string reason;2607// The identifier of the thread.2608integer threadId;2609};26102611DAP_DECLARE_STRUCT_TYPEINFO(ThreadEvent);26122613// A Thread2614struct Thread {2615// Unique identifier for the thread.2616integer id;2617// The name of the thread.2618string name;2619};26202621DAP_DECLARE_STRUCT_TYPEINFO(Thread);26222623// Response to `threads` request.2624struct ThreadsResponse : public Response {2625// All threads.2626array<Thread> threads;2627};26282629DAP_DECLARE_STRUCT_TYPEINFO(ThreadsResponse);26302631// The request retrieves a list of all threads.2632struct ThreadsRequest : public Request {2633using Response = ThreadsResponse;2634};26352636DAP_DECLARE_STRUCT_TYPEINFO(ThreadsRequest);26372638// A Variable is a name/value pair.2639// The `type` attribute is shown if space permits or when hovering over the2640// variable's name. The `kind` attribute is used to render additional properties2641// of the variable, e.g. different icons can be used to indicate that a variable2642// is public or private. If the value is structured (has children), a handle is2643// provided to retrieve the children with the `variables` request. If the number2644// of named or indexed children is large, the numbers should be returned via the2645// `namedVariables` and `indexedVariables` attributes. The client can use this2646// information to present the children in a paged UI and fetch them in chunks.2647struct Variable {2648// The evaluatable name of this variable which can be passed to the `evaluate`2649// request to fetch the variable's value.2650optional<string> evaluateName;2651// The number of indexed child variables.2652// The client can use this information to present the children in a paged UI2653// and fetch them in chunks.2654optional<integer> indexedVariables;2655// A memory reference associated with this variable.2656// For pointer type variables, this is generally a reference to the memory2657// address contained in the pointer. For executable data, this reference may2658// later be used in a `disassemble` request. This attribute may be returned by2659// a debug adapter if corresponding capability `supportsMemoryReferences` is2660// true.2661optional<string> memoryReference;2662// The variable's name.2663string name;2664// The number of named child variables.2665// The client can use this information to present the children in a paged UI2666// and fetch them in chunks.2667optional<integer> namedVariables;2668// Properties of a variable that can be used to determine how to render the2669// variable in the UI.2670optional<VariablePresentationHint> presentationHint;2671// The type of the variable's value. Typically shown in the UI when hovering2672// over the value. This attribute should only be returned by a debug adapter2673// if the corresponding capability `supportsVariableType` is true.2674optional<string> type;2675// The variable's value.2676// This can be a multi-line text, e.g. for a function the body of a function.2677// For structured variables (which do not have a simple value), it is2678// recommended to provide a one-line representation of the structured object.2679// This helps to identify the structured object in the collapsed state when2680// its children are not yet visible. An empty string can be used if no value2681// should be shown in the UI.2682string value;2683// If `variablesReference` is > 0, the variable is structured and its children2684// can be retrieved by passing `variablesReference` to the `variables` request2685// as long as execution remains suspended. See 'Lifetime of Object References'2686// in the Overview section for details.2687integer variablesReference;2688};26892690DAP_DECLARE_STRUCT_TYPEINFO(Variable);26912692// Response to `variables` request.2693struct VariablesResponse : public Response {2694// All (or a range) of variables for the given variable reference.2695array<Variable> variables;2696};26972698DAP_DECLARE_STRUCT_TYPEINFO(VariablesResponse);26992700// Retrieves all child variables for the given variable reference.2701// A filter can be used to limit the fetched children to either named or indexed2702// children.2703struct VariablesRequest : public Request {2704using Response = VariablesResponse;2705// The number of variables to return. If count is missing or 0, all variables2706// are returned. The attribute is only honored by a debug adapter if the2707// corresponding capability `supportsVariablePaging` is true.2708optional<integer> count;2709// Filter to limit the child variables to either named or indexed. If omitted,2710// both types are fetched.2711//2712// Must be one of the following enumeration values:2713// 'indexed', 'named'2714optional<string> filter;2715// Specifies details on how to format the Variable values.2716// The attribute is only honored by a debug adapter if the corresponding2717// capability `supportsValueFormattingOptions` is true.2718optional<ValueFormat> format;2719// The index of the first variable to return; if omitted children start at 0.2720// The attribute is only honored by a debug adapter if the corresponding2721// capability `supportsVariablePaging` is true.2722optional<integer> start;2723// The variable for which to retrieve its children. The `variablesReference`2724// must have been obtained in the current suspended state. See 'Lifetime of2725// Object References' in the Overview section for details.2726integer variablesReference;2727};27282729DAP_DECLARE_STRUCT_TYPEINFO(VariablesRequest);27302731// Response to `writeMemory` request.2732struct WriteMemoryResponse : public Response {2733// Property that should be returned when `allowPartial` is true to indicate2734// the number of bytes starting from address that were successfully written.2735optional<integer> bytesWritten;2736// Property that should be returned when `allowPartial` is true to indicate2737// the offset of the first byte of data successfully written. Can be negative.2738optional<integer> offset;2739};27402741DAP_DECLARE_STRUCT_TYPEINFO(WriteMemoryResponse);27422743// Writes bytes to memory at the provided location.2744// Clients should only call this request if the corresponding capability2745// `supportsWriteMemoryRequest` is true.2746struct WriteMemoryRequest : public Request {2747using Response = WriteMemoryResponse;2748// Property to control partial writes. If true, the debug adapter should2749// attempt to write memory even if the entire memory region is not writable.2750// In such a case the debug adapter should stop after hitting the first byte2751// of memory that cannot be written and return the number of bytes written in2752// the response via the `offset` and `bytesWritten` properties. If false or2753// missing, a debug adapter should attempt to verify the region is writable2754// before writing, and fail the response if it is not.2755optional<boolean> allowPartial;2756// Bytes to write, encoded using base64.2757string data;2758// Memory reference to the base location to which data should be written.2759string memoryReference;2760// Offset (in bytes) to be applied to the reference location before writing2761// data. Can be negative.2762optional<integer> offset;2763};27642765DAP_DECLARE_STRUCT_TYPEINFO(WriteMemoryRequest);27662767} // namespace dap27682769#endif // dap_protocol_h277027712772