cppdap 2024-08-02 (c69444ed)
Code extracted from: https://github.com/google/cppdap.git at commit c69444ed76f7468b232ac4f989cb8f2bdc100185 (c69444ed76f7468b232ac4f989cb8f2bdc100185).
This commit is contained in:
parent
5d568df6b1
commit
bcfd096ed9
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
namespace dap {
|
namespace dap {
|
||||||
class ReaderWriter;
|
class ReaderWriter;
|
||||||
@ -44,13 +45,21 @@ class Server {
|
|||||||
// create() constructs and returns a new Server.
|
// create() constructs and returns a new Server.
|
||||||
static std::unique_ptr<Server> create();
|
static std::unique_ptr<Server> create();
|
||||||
|
|
||||||
// start() begins listening for connections on the given port.
|
// start() begins listening for connections on localhost and the given port.
|
||||||
// callback will be called for each connection.
|
// callback will be called for each connection.
|
||||||
// onError will be called for any connection errors.
|
// onError will be called for any connection errors.
|
||||||
virtual bool start(int port,
|
virtual bool start(int port,
|
||||||
const OnConnect& callback,
|
const OnConnect& callback,
|
||||||
const OnError& onError = ignoreErrors) = 0;
|
const OnError& onError = ignoreErrors) = 0;
|
||||||
|
|
||||||
|
// start() begins listening for connections on the given specific address and port.
|
||||||
|
// callback will be called for each connection.
|
||||||
|
// onError will be called for any connection errors.
|
||||||
|
virtual bool start(const char* address,
|
||||||
|
int port,
|
||||||
|
const OnConnect& callback,
|
||||||
|
const OnError& onError = ignoreErrors) = 0;
|
||||||
|
|
||||||
// stop() stops listening for connections.
|
// stop() stops listening for connections.
|
||||||
// stop() is implicitly called on destruction.
|
// stop() is implicitly called on destruction.
|
||||||
virtual void stop() = 0;
|
virtual void stop() = 0;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// Generated with protocol_gen.go -- do not edit this file.
|
// Generated with protocol_gen.go -- do not edit this file.
|
||||||
// go run scripts/protocol_gen/protocol_gen.go
|
// go run scripts/protocol_gen/protocol_gen.go
|
||||||
//
|
//
|
||||||
// DAP version 1.59.0
|
// DAP version 1.65.0
|
||||||
|
|
||||||
#ifndef dap_protocol_h
|
#ifndef dap_protocol_h
|
||||||
#define dap_protocol_h
|
#define dap_protocol_h
|
||||||
@ -141,6 +141,18 @@ struct Breakpoint {
|
|||||||
// The offset from the instruction reference.
|
// The offset from the instruction reference.
|
||||||
// This can be negative.
|
// This can be negative.
|
||||||
optional<integer> offset;
|
optional<integer> offset;
|
||||||
|
// A machine-readable explanation of why a breakpoint may not be verified. If
|
||||||
|
// a breakpoint is verified or a specific reason is not known, the adapter
|
||||||
|
// should omit this property. Possible values include:
|
||||||
|
//
|
||||||
|
// - `pending`: Indicates a breakpoint might be verified in the future, but
|
||||||
|
// the adapter cannot verify it in the current state.
|
||||||
|
// - `failed`: Indicates a breakpoint was not able to be verified, and the
|
||||||
|
// adapter does not believe it can be verified without intervention.
|
||||||
|
//
|
||||||
|
// Must be one of the following enumeration values:
|
||||||
|
// 'pending', 'failed'
|
||||||
|
optional<string> reason;
|
||||||
// The source where the breakpoint is located.
|
// The source where the breakpoint is located.
|
||||||
optional<Source> source;
|
optional<Source> source;
|
||||||
// If true, the breakpoint could be set (but not necessarily at the desired
|
// If true, the breakpoint could be set (but not necessarily at the desired
|
||||||
@ -214,7 +226,7 @@ struct BreakpointLocationsRequest : public Request {
|
|||||||
// line is specified, the request returns all possible locations in that line.
|
// line is specified, the request returns all possible locations in that line.
|
||||||
integer line;
|
integer line;
|
||||||
// The source location of the breakpoints; either `source.path` or
|
// The source location of the breakpoints; either `source.path` or
|
||||||
// `source.reference` must be specified.
|
// `source.sourceReference` must be specified.
|
||||||
Source source;
|
Source source;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -229,18 +241,19 @@ DAP_DECLARE_STRUCT_TYPEINFO(CancelResponse);
|
|||||||
// The `cancel` request is used by the client in two situations:
|
// The `cancel` request is used by the client in two situations:
|
||||||
// - to indicate that it is no longer interested in the result produced by a
|
// - to indicate that it is no longer interested in the result produced by a
|
||||||
// specific request issued earlier
|
// specific request issued earlier
|
||||||
// - to cancel a progress sequence. Clients should only call this request if the
|
// - to cancel a progress sequence.
|
||||||
// corresponding capability `supportsCancelRequest` is true. This request has a
|
// Clients should only call this request if the corresponding capability
|
||||||
// hint characteristic: a debug adapter can only be expected to make a 'best
|
// `supportsCancelRequest` is true. This request has a hint characteristic: a
|
||||||
// effort' in honoring this request but there are no guarantees. The `cancel`
|
// debug adapter can only be expected to make a 'best effort' in honoring this
|
||||||
// request may return an error if it could not cancel an operation but a client
|
// request but there are no guarantees. The `cancel` request may return an error
|
||||||
// should refrain from presenting this error to end users. The request that got
|
// if it could not cancel an operation but a client should refrain from
|
||||||
// cancelled still needs to send a response back. This can either be a normal
|
// presenting this error to end users. The request that got cancelled still
|
||||||
// result (`success` attribute true) or an error response (`success` attribute
|
// needs to send a response back. This can either be a normal result (`success`
|
||||||
// false and the `message` set to `cancelled`). Returning partial results from a
|
// attribute true) or an error response (`success` attribute false and the
|
||||||
// cancelled request is possible but please note that a client has no generic
|
// `message` set to `cancelled`). Returning partial results from a cancelled
|
||||||
// way for detecting that a response is partial or not. The progress that got
|
// request is possible but please note that a client has no generic way for
|
||||||
// cancelled still needs to send a `progressEnd` event back.
|
// detecting that a response is partial or not. The progress that got cancelled
|
||||||
|
// still needs to send a `progressEnd` event back.
|
||||||
// A client should not assume that progress just got cancelled after sending
|
// A client should not assume that progress just got cancelled after sending
|
||||||
// the `cancel` request.
|
// the `cancel` request.
|
||||||
struct CancelRequest : public Request {
|
struct CancelRequest : public Request {
|
||||||
@ -280,6 +293,28 @@ struct ColumnDescriptor {
|
|||||||
|
|
||||||
DAP_DECLARE_STRUCT_TYPEINFO(ColumnDescriptor);
|
DAP_DECLARE_STRUCT_TYPEINFO(ColumnDescriptor);
|
||||||
|
|
||||||
|
// Describes one or more type of breakpoint a `BreakpointMode` applies to. This
|
||||||
|
// is a non-exhaustive enumeration and may expand as future breakpoint types are
|
||||||
|
// added.
|
||||||
|
using BreakpointModeApplicability = string;
|
||||||
|
|
||||||
|
// A `BreakpointMode` is provided as a option when setting breakpoints on
|
||||||
|
// sources or instructions.
|
||||||
|
struct BreakpointMode {
|
||||||
|
// Describes one or more type of breakpoint this mode applies to.
|
||||||
|
array<BreakpointModeApplicability> appliesTo;
|
||||||
|
// A help text providing additional information about the breakpoint mode.
|
||||||
|
// This string is typically shown as a hover and can be translated.
|
||||||
|
optional<string> description;
|
||||||
|
// The name of the breakpoint mode. This is shown in the UI.
|
||||||
|
string label;
|
||||||
|
// The internal ID of the mode. This value is passed to the `setBreakpoints`
|
||||||
|
// request.
|
||||||
|
string mode;
|
||||||
|
};
|
||||||
|
|
||||||
|
DAP_DECLARE_STRUCT_TYPEINFO(BreakpointMode);
|
||||||
|
|
||||||
// An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for
|
// An `ExceptionBreakpointsFilter` is shown in the UI as an filter option for
|
||||||
// configuring how exceptions are dealt with.
|
// configuring how exceptions are dealt with.
|
||||||
struct ExceptionBreakpointsFilter {
|
struct ExceptionBreakpointsFilter {
|
||||||
@ -308,6 +343,13 @@ DAP_DECLARE_STRUCT_TYPEINFO(ExceptionBreakpointsFilter);
|
|||||||
struct Capabilities {
|
struct Capabilities {
|
||||||
// The set of additional module information exposed by the debug adapter.
|
// The set of additional module information exposed by the debug adapter.
|
||||||
optional<array<ColumnDescriptor>> additionalModuleColumns;
|
optional<array<ColumnDescriptor>> additionalModuleColumns;
|
||||||
|
// Modes of breakpoints supported by the debug adapter, such as 'hardware' or
|
||||||
|
// 'software'. If present, the client may allow the user to select a mode and
|
||||||
|
// include it in its `setBreakpoints` request.
|
||||||
|
//
|
||||||
|
// Clients may present the first applicable mode in this array as the
|
||||||
|
// 'default' mode in gestures that set breakpoints.
|
||||||
|
optional<array<BreakpointMode>> breakpointModes;
|
||||||
// The set of characters that should trigger completion in a REPL. If not
|
// The set of characters that should trigger completion in a REPL. If not
|
||||||
// specified, the UI should assume the `.` character.
|
// specified, the UI should assume the `.` character.
|
||||||
optional<array<string>> completionTriggerCharacters;
|
optional<array<string>> completionTriggerCharacters;
|
||||||
@ -579,7 +621,11 @@ struct DataBreakpointInfoResponse : public Response {
|
|||||||
optional<boolean> canPersist;
|
optional<boolean> canPersist;
|
||||||
// An identifier for the data on which a data breakpoint can be registered
|
// An identifier for the data on which a data breakpoint can be registered
|
||||||
// with the `setDataBreakpoints` request or null if no data breakpoint is
|
// with the `setDataBreakpoints` request or null if no data breakpoint is
|
||||||
// available.
|
// available. If a `variablesReference` or `frameId` is passed, the `dataId`
|
||||||
|
// is valid in the current suspended state, otherwise it's valid indefinitely.
|
||||||
|
// See 'Lifetime of Object References' in the Overview section for details.
|
||||||
|
// Breakpoints set using the `dataId` in the `setDataBreakpoints` request may
|
||||||
|
// outlive the lifetime of the associated `dataId`.
|
||||||
variant<string, null> dataId;
|
variant<string, null> dataId;
|
||||||
// UI string that describes on what data the breakpoint is set on or why a
|
// UI string that describes on what data the breakpoint is set on or why a
|
||||||
// data breakpoint is not available.
|
// data breakpoint is not available.
|
||||||
@ -597,6 +643,9 @@ struct DataBreakpointInfoRequest : public Request {
|
|||||||
// If not specified, the expression is evaluated in the global scope. When
|
// If not specified, the expression is evaluated in the global scope. When
|
||||||
// `variablesReference` is specified, this property has no effect.
|
// `variablesReference` is specified, this property has no effect.
|
||||||
optional<integer> frameId;
|
optional<integer> frameId;
|
||||||
|
// The mode of the desired breakpoint. If defined, this must be one of the
|
||||||
|
// `breakpointModes` the debug adapter advertised in its `Capabilities`.
|
||||||
|
optional<string> mode;
|
||||||
// The name of the variable's child to obtain data breakpoint information for.
|
// The name of the variable's child to obtain data breakpoint information for.
|
||||||
// If `variablesReference` isn't specified, this can be an expression.
|
// If `variablesReference` isn't specified, this can be an expression.
|
||||||
string name;
|
string name;
|
||||||
@ -634,6 +683,15 @@ struct DisassembledInstruction {
|
|||||||
// but can be omitted afterwards if this instruction maps to the same source
|
// but can be omitted afterwards if this instruction maps to the same source
|
||||||
// file as the previous instruction.
|
// file as the previous instruction.
|
||||||
optional<Source> location;
|
optional<Source> location;
|
||||||
|
// A hint for how to present the instruction in the UI.
|
||||||
|
//
|
||||||
|
// A value of `invalid` may be used to indicate this instruction is 'filler'
|
||||||
|
// and cannot be reached by the program. For example, unreadable memory
|
||||||
|
// addresses may be presented is 'invalid.'
|
||||||
|
//
|
||||||
|
// Must be one of the following enumeration values:
|
||||||
|
// 'normal', 'invalid'
|
||||||
|
optional<string> presentationHint;
|
||||||
// Name of the symbol that corresponds with the location of this instruction,
|
// Name of the symbol that corresponds with the location of this instruction,
|
||||||
// if any.
|
// if any.
|
||||||
optional<string> symbol;
|
optional<string> symbol;
|
||||||
@ -785,9 +843,8 @@ struct EvaluateResponse : public Response {
|
|||||||
optional<integer> indexedVariables;
|
optional<integer> indexedVariables;
|
||||||
// A memory reference to a location appropriate for this result.
|
// A memory reference to a location appropriate for this result.
|
||||||
// For pointer type eval results, this is generally a reference to the memory
|
// For pointer type eval results, this is generally a reference to the memory
|
||||||
// address contained in the pointer. This attribute should be returned by a
|
// address contained in the pointer. This attribute may be returned by a debug
|
||||||
// debug adapter if corresponding capability `supportsMemoryReferences` is
|
// adapter if corresponding capability `supportsMemoryReferences` is true.
|
||||||
// true.
|
|
||||||
optional<string> memoryReference;
|
optional<string> memoryReference;
|
||||||
// The number of named child variables.
|
// The number of named child variables.
|
||||||
// The client can use this information to present the variables in a paged UI
|
// The client can use this information to present the variables in a paged UI
|
||||||
@ -979,6 +1036,13 @@ DAP_DECLARE_STRUCT_TYPEINFO(GotoTargetsRequest);
|
|||||||
struct InitializeResponse : public Response {
|
struct InitializeResponse : public Response {
|
||||||
// The set of additional module information exposed by the debug adapter.
|
// The set of additional module information exposed by the debug adapter.
|
||||||
optional<array<ColumnDescriptor>> additionalModuleColumns;
|
optional<array<ColumnDescriptor>> additionalModuleColumns;
|
||||||
|
// Modes of breakpoints supported by the debug adapter, such as 'hardware' or
|
||||||
|
// 'software'. If present, the client may allow the user to select a mode and
|
||||||
|
// include it in its `setBreakpoints` request.
|
||||||
|
//
|
||||||
|
// Clients may present the first applicable mode in this array as the
|
||||||
|
// 'default' mode in gestures that set breakpoints.
|
||||||
|
optional<array<BreakpointMode>> breakpointModes;
|
||||||
// The set of characters that should trigger completion in a REPL. If not
|
// The set of characters that should trigger completion in a REPL. If not
|
||||||
// specified, the UI should assume the `.` character.
|
// specified, the UI should assume the `.` character.
|
||||||
optional<array<string>> completionTriggerCharacters;
|
optional<array<string>> completionTriggerCharacters;
|
||||||
@ -1774,6 +1838,9 @@ struct SourceBreakpoint {
|
|||||||
// `hitCondition` or `condition` is specified, then the message should only be
|
// `hitCondition` or `condition` is specified, then the message should only be
|
||||||
// logged if those conditions are met.
|
// logged if those conditions are met.
|
||||||
optional<string> logMessage;
|
optional<string> logMessage;
|
||||||
|
// The mode of this breakpoint. If defined, this must be one of the
|
||||||
|
// `breakpointModes` the debug adapter advertised in its `Capabilities`.
|
||||||
|
optional<string> mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
DAP_DECLARE_STRUCT_TYPEINFO(SourceBreakpoint);
|
DAP_DECLARE_STRUCT_TYPEINFO(SourceBreakpoint);
|
||||||
@ -1846,13 +1913,13 @@ DAP_DECLARE_STRUCT_TYPEINFO(SetDataBreakpointsRequest);
|
|||||||
// the returned array must start with `filters` information first, followed by
|
// the returned array must start with `filters` information first, followed by
|
||||||
// `filterOptions` information. The `verified` property of a `Breakpoint` object
|
// `filterOptions` information. The `verified` property of a `Breakpoint` object
|
||||||
// signals whether the exception breakpoint or filter could be successfully
|
// signals whether the exception breakpoint or filter could be successfully
|
||||||
// created and whether the condition or hit count expressions are valid. In case
|
// created and whether the condition is valid. In case of an error the `message`
|
||||||
// of an error the `message` property explains the problem. The `id` property
|
// property explains the problem. The `id` property can be used to introduce a
|
||||||
// can be used to introduce a unique ID for the exception breakpoint or filter
|
// unique ID for the exception breakpoint or filter so that it can be updated
|
||||||
// so that it can be updated subsequently by sending breakpoint events. For
|
// subsequently by sending breakpoint events. For backward compatibility both
|
||||||
// backward compatibility both the `breakpoints` array and the enclosing `body`
|
// the `breakpoints` array and the enclosing `body` are optional. If these
|
||||||
// are optional. If these elements are missing a client is not able to show
|
// elements are missing a client is not able to show problems for individual
|
||||||
// problems for individual exception breakpoints or filters.
|
// exception breakpoints or filters.
|
||||||
struct SetExceptionBreakpointsResponse : public Response {
|
struct SetExceptionBreakpointsResponse : public Response {
|
||||||
// Information about the exception breakpoints or filters.
|
// Information about the exception breakpoints or filters.
|
||||||
// The breakpoints returned are in the same order as the elements of the
|
// The breakpoints returned are in the same order as the elements of the
|
||||||
@ -1901,15 +1968,20 @@ struct ExceptionFilterOptions {
|
|||||||
// ID of an exception filter returned by the `exceptionBreakpointFilters`
|
// ID of an exception filter returned by the `exceptionBreakpointFilters`
|
||||||
// capability.
|
// capability.
|
||||||
string filterId;
|
string filterId;
|
||||||
|
// The mode of this exception breakpoint. If defined, this must be one of the
|
||||||
|
// `breakpointModes` the debug adapter advertised in its `Capabilities`.
|
||||||
|
optional<string> mode;
|
||||||
};
|
};
|
||||||
|
|
||||||
DAP_DECLARE_STRUCT_TYPEINFO(ExceptionFilterOptions);
|
DAP_DECLARE_STRUCT_TYPEINFO(ExceptionFilterOptions);
|
||||||
|
|
||||||
// The request configures the debugger's response to thrown exceptions.
|
// The request configures the debugger's response to thrown exceptions. Each of
|
||||||
// If an exception is configured to break, a `stopped` event is fired (with
|
// the `filters`, `filterOptions`, and `exceptionOptions` in the request are
|
||||||
// reason `exception`). Clients should only call this request if the
|
// independent configurations to a debug adapter indicating a kind of exception
|
||||||
// corresponding capability `exceptionBreakpointFilters` returns one or more
|
// to catch. An exception thrown in a program should result in a `stopped` event
|
||||||
// filters.
|
// from the debug adapter (with reason `exception`) if any of the configured
|
||||||
|
// filters match. Clients should only call this request if the corresponding
|
||||||
|
// capability `exceptionBreakpointFilters` returns one or more filters.
|
||||||
struct SetExceptionBreakpointsRequest : public Request {
|
struct SetExceptionBreakpointsRequest : public Request {
|
||||||
using Response = SetExceptionBreakpointsResponse;
|
using Response = SetExceptionBreakpointsResponse;
|
||||||
// Configuration options for selected exceptions.
|
// Configuration options for selected exceptions.
|
||||||
@ -1937,6 +2009,11 @@ struct SetExpressionResponse : public Response {
|
|||||||
// and fetch them in chunks. The value should be less than or equal to
|
// and fetch them in chunks. The value should be less than or equal to
|
||||||
// 2147483647 (2^31-1).
|
// 2147483647 (2^31-1).
|
||||||
optional<integer> indexedVariables;
|
optional<integer> indexedVariables;
|
||||||
|
// A memory reference to a location appropriate for this result.
|
||||||
|
// For pointer type eval results, this is generally a reference to the memory
|
||||||
|
// address contained in the pointer. This attribute may be returned by a debug
|
||||||
|
// adapter if corresponding capability `supportsMemoryReferences` is true.
|
||||||
|
optional<string> memoryReference;
|
||||||
// The number of named child variables.
|
// The number of named child variables.
|
||||||
// The client can use this information to present the variables in a paged UI
|
// The client can use this information to present the variables in a paged UI
|
||||||
// and fetch them in chunks. The value should be less than or equal to
|
// and fetch them in chunks. The value should be less than or equal to
|
||||||
@ -2047,7 +2124,10 @@ struct InstructionBreakpoint {
|
|||||||
// `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or
|
// `EvaluateResponse`, `Variable`, `StackFrame`, `GotoTarget`, or
|
||||||
// `Breakpoint`.
|
// `Breakpoint`.
|
||||||
string instructionReference;
|
string instructionReference;
|
||||||
// The offset from the instruction reference.
|
// The mode of this breakpoint. If defined, this must be one of the
|
||||||
|
// `breakpointModes` the debug adapter advertised in its `Capabilities`.
|
||||||
|
optional<string> mode;
|
||||||
|
// The offset from the instruction reference in bytes.
|
||||||
// This can be negative.
|
// This can be negative.
|
||||||
optional<integer> offset;
|
optional<integer> offset;
|
||||||
};
|
};
|
||||||
@ -2075,6 +2155,11 @@ struct SetVariableResponse : public Response {
|
|||||||
// and fetch them in chunks. The value should be less than or equal to
|
// and fetch them in chunks. The value should be less than or equal to
|
||||||
// 2147483647 (2^31-1).
|
// 2147483647 (2^31-1).
|
||||||
optional<integer> indexedVariables;
|
optional<integer> indexedVariables;
|
||||||
|
// A memory reference to a location appropriate for this result.
|
||||||
|
// For pointer type eval results, this is generally a reference to the memory
|
||||||
|
// address contained in the pointer. This attribute may be returned by a debug
|
||||||
|
// adapter if corresponding capability `supportsMemoryReferences` is true.
|
||||||
|
optional<string> memoryReference;
|
||||||
// The number of named child variables.
|
// The number of named child variables.
|
||||||
// The client can use this information to present the variables in a paged UI
|
// The client can use this information to present the variables in a paged UI
|
||||||
// and fetch them in chunks. The value should be less than or equal to
|
// and fetch them in chunks. The value should be less than or equal to
|
||||||
@ -2568,9 +2653,12 @@ struct Variable {
|
|||||||
// The client can use this information to present the children in a paged UI
|
// The client can use this information to present the children in a paged UI
|
||||||
// and fetch them in chunks.
|
// and fetch them in chunks.
|
||||||
optional<integer> indexedVariables;
|
optional<integer> indexedVariables;
|
||||||
// The memory reference for the variable if the variable represents executable
|
// A memory reference associated with this variable.
|
||||||
// code, such as a function pointer. This attribute is only required if the
|
// For pointer type variables, this is generally a reference to the memory
|
||||||
// corresponding capability `supportsMemoryReferences` is true.
|
// address contained in the pointer. For executable data, this reference may
|
||||||
|
// later be used in a `disassemble` request. This attribute may be returned by
|
||||||
|
// a debug adapter if corresponding capability `supportsMemoryReferences` is
|
||||||
|
// true.
|
||||||
optional<string> memoryReference;
|
optional<string> memoryReference;
|
||||||
// The variable's name.
|
// The variable's name.
|
||||||
string name;
|
string name;
|
||||||
@ -2616,7 +2704,8 @@ DAP_DECLARE_STRUCT_TYPEINFO(VariablesResponse);
|
|||||||
struct VariablesRequest : public Request {
|
struct VariablesRequest : public Request {
|
||||||
using Response = VariablesResponse;
|
using Response = VariablesResponse;
|
||||||
// The number of variables to return. If count is missing or 0, all variables
|
// The number of variables to return. If count is missing or 0, all variables
|
||||||
// are returned.
|
// are returned. The attribute is only honored by a debug adapter if the
|
||||||
|
// corresponding capability `supportsVariablePaging` is true.
|
||||||
optional<integer> count;
|
optional<integer> count;
|
||||||
// Filter to limit the child variables to either named or indexed. If omitted,
|
// Filter to limit the child variables to either named or indexed. If omitted,
|
||||||
// both types are fetched.
|
// both types are fetched.
|
||||||
@ -2629,6 +2718,8 @@ struct VariablesRequest : public Request {
|
|||||||
// capability `supportsValueFormattingOptions` is true.
|
// capability `supportsValueFormattingOptions` is true.
|
||||||
optional<ValueFormat> format;
|
optional<ValueFormat> format;
|
||||||
// The index of the first variable to return; if omitted children start at 0.
|
// The index of the first variable to return; if omitted children start at 0.
|
||||||
|
// The attribute is only honored by a debug adapter if the corresponding
|
||||||
|
// capability `supportsVariablePaging` is true.
|
||||||
optional<integer> start;
|
optional<integer> start;
|
||||||
// The variable for which to retrieve its children. The `variablesReference`
|
// The variable for which to retrieve its children. The `variablesReference`
|
||||||
// must have been obtained in the current suspended state. See 'Lifetime of
|
// must have been obtained in the current suspended state. See 'Lifetime of
|
||||||
|
@ -164,7 +164,7 @@ M member_type(M T::*);
|
|||||||
bool TypeOf<STRUCT>::deserializeFields(const Deserializer* fd, void* obj) { \
|
bool TypeOf<STRUCT>::deserializeFields(const Deserializer* fd, void* obj) { \
|
||||||
using StructTy = STRUCT; \
|
using StructTy = STRUCT; \
|
||||||
(void)sizeof(StructTy); /* avoid unused 'using' warning */ \
|
(void)sizeof(StructTy); /* avoid unused 'using' warning */ \
|
||||||
for (auto field : std::initializer_list<Field>{__VA_ARGS__}) { \
|
for (auto& field : std::initializer_list<Field>{__VA_ARGS__}) { \
|
||||||
if (!fd->field(field.name, [&](Deserializer* d) { \
|
if (!fd->field(field.name, [&](Deserializer* d) { \
|
||||||
auto ptr = reinterpret_cast<uint8_t*>(obj) + field.offset; \
|
auto ptr = reinterpret_cast<uint8_t*>(obj) + field.offset; \
|
||||||
return field.type->deserialize(d, ptr); \
|
return field.type->deserialize(d, ptr); \
|
||||||
@ -177,7 +177,7 @@ M member_type(M T::*);
|
|||||||
bool TypeOf<STRUCT>::serializeFields(FieldSerializer* fs, const void* obj) {\
|
bool TypeOf<STRUCT>::serializeFields(FieldSerializer* fs, const void* obj) {\
|
||||||
using StructTy = STRUCT; \
|
using StructTy = STRUCT; \
|
||||||
(void)sizeof(StructTy); /* avoid unused 'using' warning */ \
|
(void)sizeof(StructTy); /* avoid unused 'using' warning */ \
|
||||||
for (auto field : std::initializer_list<Field>{__VA_ARGS__}) { \
|
for (auto& field : std::initializer_list<Field>{__VA_ARGS__}) { \
|
||||||
if (!fs->field(field.name, [&](Serializer* s) { \
|
if (!fs->field(field.name, [&](Serializer* s) { \
|
||||||
auto ptr = reinterpret_cast<const uint8_t*>(obj) + field.offset; \
|
auto ptr = reinterpret_cast<const uint8_t*>(obj) + field.offset; \
|
||||||
return field.type->serialize(s, ptr); \
|
return field.type->serialize(s, ptr); \
|
||||||
|
@ -32,10 +32,17 @@ class Impl : public dap::net::Server {
|
|||||||
bool start(int port,
|
bool start(int port,
|
||||||
const OnConnect& onConnect,
|
const OnConnect& onConnect,
|
||||||
const OnError& onError) override {
|
const OnError& onError) override {
|
||||||
|
return start("localhost", port, onConnect, onError);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool start(const char* address,
|
||||||
|
int port,
|
||||||
|
const OnConnect& onConnect,
|
||||||
|
const OnError& onError) override {
|
||||||
std::unique_lock<std::mutex> lock(mutex);
|
std::unique_lock<std::mutex> lock(mutex);
|
||||||
stopWithLock();
|
stopWithLock();
|
||||||
socket = std::unique_ptr<dap::Socket>(
|
socket = std::unique_ptr<dap::Socket>(
|
||||||
new dap::Socket("localhost", std::to_string(port).c_str()));
|
new dap::Socket(address, std::to_string(port).c_str()));
|
||||||
|
|
||||||
if (!socket->isOpen()) {
|
if (!socket->isOpen()) {
|
||||||
onError("Failed to open socket");
|
onError("Failed to open socket");
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// Generated with protocol_gen.go -- do not edit this file.
|
// Generated with protocol_gen.go -- do not edit this file.
|
||||||
// go run scripts/protocol_gen/protocol_gen.go
|
// go run scripts/protocol_gen/protocol_gen.go
|
||||||
//
|
//
|
||||||
// DAP version 1.59.0
|
// DAP version 1.65.0
|
||||||
|
|
||||||
#include "dap/protocol.h"
|
#include "dap/protocol.h"
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// Generated with protocol_gen.go -- do not edit this file.
|
// Generated with protocol_gen.go -- do not edit this file.
|
||||||
// go run scripts/protocol_gen/protocol_gen.go
|
// go run scripts/protocol_gen/protocol_gen.go
|
||||||
//
|
//
|
||||||
// DAP version 1.59.0
|
// DAP version 1.65.0
|
||||||
|
|
||||||
#include "dap/protocol.h"
|
#include "dap/protocol.h"
|
||||||
|
|
||||||
@ -55,6 +55,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ContinueRequest,
|
|||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(DataBreakpointInfoRequest,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(DataBreakpointInfoRequest,
|
||||||
"dataBreakpointInfo",
|
"dataBreakpointInfo",
|
||||||
DAP_FIELD(frameId, "frameId"),
|
DAP_FIELD(frameId, "frameId"),
|
||||||
|
DAP_FIELD(mode, "mode"),
|
||||||
DAP_FIELD(name, "name"),
|
DAP_FIELD(name, "name"),
|
||||||
DAP_FIELD(variablesReference,
|
DAP_FIELD(variablesReference,
|
||||||
"variablesReference"));
|
"variablesReference"));
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// Generated with protocol_gen.go -- do not edit this file.
|
// Generated with protocol_gen.go -- do not edit this file.
|
||||||
// go run scripts/protocol_gen/protocol_gen.go
|
// go run scripts/protocol_gen/protocol_gen.go
|
||||||
//
|
//
|
||||||
// DAP version 1.59.0
|
// DAP version 1.65.0
|
||||||
|
|
||||||
#include "dap/protocol.h"
|
#include "dap/protocol.h"
|
||||||
|
|
||||||
@ -83,6 +83,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(
|
|||||||
InitializeResponse,
|
InitializeResponse,
|
||||||
"",
|
"",
|
||||||
DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"),
|
DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"),
|
||||||
|
DAP_FIELD(breakpointModes, "breakpointModes"),
|
||||||
DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"),
|
DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"),
|
||||||
DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"),
|
DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"),
|
||||||
DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"),
|
DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"),
|
||||||
@ -177,6 +178,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExceptionBreakpointsResponse,
|
|||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExpressionResponse,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(SetExpressionResponse,
|
||||||
"",
|
"",
|
||||||
DAP_FIELD(indexedVariables, "indexedVariables"),
|
DAP_FIELD(indexedVariables, "indexedVariables"),
|
||||||
|
DAP_FIELD(memoryReference, "memoryReference"),
|
||||||
DAP_FIELD(namedVariables, "namedVariables"),
|
DAP_FIELD(namedVariables, "namedVariables"),
|
||||||
DAP_FIELD(presentationHint, "presentationHint"),
|
DAP_FIELD(presentationHint, "presentationHint"),
|
||||||
DAP_FIELD(type, "type"),
|
DAP_FIELD(type, "type"),
|
||||||
@ -195,6 +197,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SetInstructionBreakpointsResponse,
|
|||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(SetVariableResponse,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(SetVariableResponse,
|
||||||
"",
|
"",
|
||||||
DAP_FIELD(indexedVariables, "indexedVariables"),
|
DAP_FIELD(indexedVariables, "indexedVariables"),
|
||||||
|
DAP_FIELD(memoryReference, "memoryReference"),
|
||||||
DAP_FIELD(namedVariables, "namedVariables"),
|
DAP_FIELD(namedVariables, "namedVariables"),
|
||||||
DAP_FIELD(type, "type"),
|
DAP_FIELD(type, "type"),
|
||||||
DAP_FIELD(value, "value"),
|
DAP_FIELD(value, "value"),
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
// Generated with protocol_gen.go -- do not edit this file.
|
// Generated with protocol_gen.go -- do not edit this file.
|
||||||
// go run scripts/protocol_gen/protocol_gen.go
|
// go run scripts/protocol_gen/protocol_gen.go
|
||||||
//
|
//
|
||||||
// DAP version 1.59.0
|
// DAP version 1.65.0
|
||||||
|
|
||||||
#include "dap/protocol.h"
|
#include "dap/protocol.h"
|
||||||
|
|
||||||
@ -48,6 +48,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(Breakpoint,
|
|||||||
DAP_FIELD(line, "line"),
|
DAP_FIELD(line, "line"),
|
||||||
DAP_FIELD(message, "message"),
|
DAP_FIELD(message, "message"),
|
||||||
DAP_FIELD(offset, "offset"),
|
DAP_FIELD(offset, "offset"),
|
||||||
|
DAP_FIELD(reason, "reason"),
|
||||||
DAP_FIELD(source, "source"),
|
DAP_FIELD(source, "source"),
|
||||||
DAP_FIELD(verified, "verified"));
|
DAP_FIELD(verified, "verified"));
|
||||||
|
|
||||||
@ -66,6 +67,13 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ColumnDescriptor,
|
|||||||
DAP_FIELD(type, "type"),
|
DAP_FIELD(type, "type"),
|
||||||
DAP_FIELD(width, "width"));
|
DAP_FIELD(width, "width"));
|
||||||
|
|
||||||
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(BreakpointMode,
|
||||||
|
"",
|
||||||
|
DAP_FIELD(appliesTo, "appliesTo"),
|
||||||
|
DAP_FIELD(description, "description"),
|
||||||
|
DAP_FIELD(label, "label"),
|
||||||
|
DAP_FIELD(mode, "mode"));
|
||||||
|
|
||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionBreakpointsFilter,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionBreakpointsFilter,
|
||||||
"",
|
"",
|
||||||
DAP_FIELD(conditionDescription,
|
DAP_FIELD(conditionDescription,
|
||||||
@ -81,6 +89,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(
|
|||||||
Capabilities,
|
Capabilities,
|
||||||
"",
|
"",
|
||||||
DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"),
|
DAP_FIELD(additionalModuleColumns, "additionalModuleColumns"),
|
||||||
|
DAP_FIELD(breakpointModes, "breakpointModes"),
|
||||||
DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"),
|
DAP_FIELD(completionTriggerCharacters, "completionTriggerCharacters"),
|
||||||
DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"),
|
DAP_FIELD(exceptionBreakpointFilters, "exceptionBreakpointFilters"),
|
||||||
DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"),
|
DAP_FIELD(supportSuspendDebuggee, "supportSuspendDebuggee"),
|
||||||
@ -148,6 +157,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(DisassembledInstruction,
|
|||||||
DAP_FIELD(instructionBytes, "instructionBytes"),
|
DAP_FIELD(instructionBytes, "instructionBytes"),
|
||||||
DAP_FIELD(line, "line"),
|
DAP_FIELD(line, "line"),
|
||||||
DAP_FIELD(location, "location"),
|
DAP_FIELD(location, "location"),
|
||||||
|
DAP_FIELD(presentationHint, "presentationHint"),
|
||||||
DAP_FIELD(symbol, "symbol"));
|
DAP_FIELD(symbol, "symbol"));
|
||||||
|
|
||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(Message,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(Message,
|
||||||
@ -223,7 +233,8 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(SourceBreakpoint,
|
|||||||
DAP_FIELD(condition, "condition"),
|
DAP_FIELD(condition, "condition"),
|
||||||
DAP_FIELD(hitCondition, "hitCondition"),
|
DAP_FIELD(hitCondition, "hitCondition"),
|
||||||
DAP_FIELD(line, "line"),
|
DAP_FIELD(line, "line"),
|
||||||
DAP_FIELD(logMessage, "logMessage"));
|
DAP_FIELD(logMessage, "logMessage"),
|
||||||
|
DAP_FIELD(mode, "mode"));
|
||||||
|
|
||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(DataBreakpoint,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(DataBreakpoint,
|
||||||
"",
|
"",
|
||||||
@ -245,7 +256,8 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionOptions,
|
|||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionFilterOptions,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(ExceptionFilterOptions,
|
||||||
"",
|
"",
|
||||||
DAP_FIELD(condition, "condition"),
|
DAP_FIELD(condition, "condition"),
|
||||||
DAP_FIELD(filterId, "filterId"));
|
DAP_FIELD(filterId, "filterId"),
|
||||||
|
DAP_FIELD(mode, "mode"));
|
||||||
|
|
||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(FunctionBreakpoint,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(FunctionBreakpoint,
|
||||||
"",
|
"",
|
||||||
@ -259,6 +271,7 @@ DAP_IMPLEMENT_STRUCT_TYPEINFO(InstructionBreakpoint,
|
|||||||
DAP_FIELD(hitCondition, "hitCondition"),
|
DAP_FIELD(hitCondition, "hitCondition"),
|
||||||
DAP_FIELD(instructionReference,
|
DAP_FIELD(instructionReference,
|
||||||
"instructionReference"),
|
"instructionReference"),
|
||||||
|
DAP_FIELD(mode, "mode"),
|
||||||
DAP_FIELD(offset, "offset"));
|
DAP_FIELD(offset, "offset"));
|
||||||
|
|
||||||
DAP_IMPLEMENT_STRUCT_TYPEINFO(StackFrame,
|
DAP_IMPLEMENT_STRUCT_TYPEINFO(StackFrame,
|
||||||
|
@ -138,7 +138,7 @@ class Impl : public dap::Session {
|
|||||||
return send(s.dump());
|
return send(s.dump());
|
||||||
}
|
}
|
||||||
|
|
||||||
~Impl() {
|
~Impl() override {
|
||||||
inbox.close();
|
inbox.close();
|
||||||
reader.close();
|
reader.close();
|
||||||
writer.close();
|
writer.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user