[dap] Update to the latest version of the DAP spec
This is a result of running `dap/tool/generate_all.dart` to get the latest version of the spec. I'm doing this to get a new value `supportsANSIStyling` that was added recently that VS Code is already using and broke our ansi colors (it's now opt-in but because was just always supported).
This change does not fix that issue, I wanted to keep the spec updates separate.
In order to get a fix for VS Code users, I'm shipping some middleware that forces this on in the client, but we'll need to fix properly here for the benefit of other clients (or people who haven't updated their VS Code extensions?).
See https://github.com/Dart-Code/Dart-Code/issues/5302
Change-Id: Ie066b92da177bba5565d3ed952e5518912918f40
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388700
Commit-Queue: Ben Konyi <bkonyi@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
Reviewed-by: Derek Xu <derekx@google.com>
diff --git a/third_party/pkg/dap/CHANGELOG.md b/third_party/pkg/dap/CHANGELOG.md
index dd201e5..4d5cea5 100644
--- a/third_party/pkg/dap/CHANGELOG.md
+++ b/third_party/pkg/dap/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.4.0
+
+- Updated all generated classes using the latest published version of the DAP spec.
+
## 1.3.0
- Add `showToUser` field to `DebugAdapterException` to specify which errors should be shown to users.
diff --git a/third_party/pkg/dap/lib/src/protocol_generated.dart b/third_party/pkg/dap/lib/src/protocol_generated.dart
index 662755d..30bec5c 100644
--- a/third_party/pkg/dap/lib/src/protocol_generated.dart
+++ b/third_party/pkg/dap/lib/src/protocol_generated.dart
@@ -127,6 +127,15 @@
/// This can be negative.
final int? 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.
+ final String? reason;
+
/// The source where the breakpoint is located.
final Source? source;
@@ -146,6 +155,7 @@
this.line,
this.message,
this.offset,
+ this.reason,
this.source,
required this.verified,
});
@@ -159,6 +169,7 @@
line = obj['line'] as int?,
message = obj['message'] as String?,
offset = obj['offset'] as int?,
+ reason = obj['reason'] as String?,
source = obj['source'] == null
? null
: Source.fromJson(obj['source'] as Map<String, Object?>),
@@ -192,6 +203,9 @@
if (obj['offset'] is! int?) {
return false;
}
+ if (obj['reason'] is! String?) {
+ return false;
+ }
if (!Source.canParse(obj['source'])) {
return false;
}
@@ -211,6 +225,7 @@
if (line != null) 'line': line,
if (message != null) 'message': message,
if (offset != null) 'offset': offset,
+ if (reason != null) 'reason': reason,
if (source != null) 'source': source,
'verified': verified,
};
@@ -302,7 +317,7 @@
final int line;
/// The source location of the breakpoints; either `source.path` or
- /// `source.reference` must be specified.
+ /// `source.sourceReference` must be specified.
final Source source;
static BreakpointLocationsArguments fromJson(Map<String, Object?> obj) =>
@@ -387,6 +402,75 @@
};
}
+/// A `BreakpointMode` is provided as a option when setting breakpoints on
+/// sources or instructions.
+class BreakpointMode {
+ /// Describes one or more type of breakpoint this mode applies to.
+ final List<BreakpointModeApplicability> appliesTo;
+
+ /// A help text providing additional information about the breakpoint mode.
+ /// This string is typically shown as a hover and can be translated.
+ final String? description;
+
+ /// The name of the breakpoint mode. This is shown in the UI.
+ final String label;
+
+ /// The internal ID of the mode. This value is passed to the `setBreakpoints`
+ /// request.
+ final String mode;
+
+ static BreakpointMode fromJson(Map<String, Object?> obj) =>
+ BreakpointMode.fromMap(obj);
+
+ BreakpointMode({
+ required this.appliesTo,
+ this.description,
+ required this.label,
+ required this.mode,
+ });
+
+ BreakpointMode.fromMap(Map<String, Object?> obj)
+ : appliesTo = (obj['appliesTo'] as List)
+ .map((item) => item as BreakpointModeApplicability)
+ .toList(),
+ description = obj['description'] as String?,
+ label = obj['label'] as String,
+ mode = obj['mode'] as String;
+
+ static bool canParse(Object? obj) {
+ if (obj is! Map<String, dynamic>) {
+ return false;
+ }
+ if ((obj['appliesTo'] is! List ||
+ (obj['appliesTo']
+ .any((item) => item is! BreakpointModeApplicability)))) {
+ return false;
+ }
+ if (obj['description'] is! String?) {
+ return false;
+ }
+ if (obj['label'] is! String) {
+ return false;
+ }
+ if (obj['mode'] is! String) {
+ return false;
+ }
+ return true;
+ }
+
+ Map<String, Object?> toJson() => {
+ 'appliesTo': appliesTo,
+ if (description != null) 'description': description,
+ 'label': label,
+ 'mode': mode,
+ };
+}
+
+/// 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.
+typedef BreakpointModeApplicability = String;
+
/// Arguments for `cancel` request.
class CancelArguments extends RequestArguments {
/// The ID (attribute `progressId`) of the progress to cancel. If missing no
@@ -465,6 +549,14 @@
/// The set of additional module information exposed by the debug adapter.
final List<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.
+ final List<BreakpointMode>? breakpointModes;
+
/// The set of characters that should trigger completion in a REPL. If not
/// specified, the UI should assume the `.` character.
final List<String>? completionTriggerCharacters;
@@ -484,6 +576,10 @@
/// Checksum algorithms supported by the debug adapter.
final List<ChecksumAlgorithm>? supportedChecksumAlgorithms;
+ /// The debug adapter supports ANSI escape sequences in styling of
+ /// `OutputEvent.output` and `Variable.value` fields.
+ final bool? supportsANSIStyling;
+
/// The debug adapter supports the `breakpointLocations` request.
final bool? supportsBreakpointLocationsRequest;
@@ -503,6 +599,10 @@
/// The debug adapter supports the `configurationDone` request.
final bool? supportsConfigurationDoneRequest;
+ /// The debug adapter supports the `asAddress` and `bytes` fields in the
+ /// `dataBreakpointInfo` request.
+ final bool? supportsDataBreakpointBytes;
+
/// The debug adapter supports data breakpoints.
final bool? supportsDataBreakpoints;
@@ -604,17 +704,20 @@
Capabilities({
this.additionalModuleColumns,
+ this.breakpointModes,
this.completionTriggerCharacters,
this.exceptionBreakpointFilters,
this.supportSuspendDebuggee,
this.supportTerminateDebuggee,
this.supportedChecksumAlgorithms,
+ this.supportsANSIStyling,
this.supportsBreakpointLocationsRequest,
this.supportsCancelRequest,
this.supportsClipboardContext,
this.supportsCompletionsRequest,
this.supportsConditionalBreakpoints,
this.supportsConfigurationDoneRequest,
+ this.supportsDataBreakpointBytes,
this.supportsDataBreakpoints,
this.supportsDelayedStackTraceLoading,
this.supportsDisassembleRequest,
@@ -649,6 +752,10 @@
?.map((item) =>
ColumnDescriptor.fromJson(item as Map<String, Object?>))
.toList(),
+ breakpointModes = (obj['breakpointModes'] as List?)
+ ?.map(
+ (item) => BreakpointMode.fromJson(item as Map<String, Object?>))
+ .toList(),
completionTriggerCharacters =
(obj['completionTriggerCharacters'] as List?)
?.map((item) => item as String)
@@ -664,6 +771,7 @@
(obj['supportedChecksumAlgorithms'] as List?)
?.map((item) => item as ChecksumAlgorithm)
.toList(),
+ supportsANSIStyling = obj['supportsANSIStyling'] as bool?,
supportsBreakpointLocationsRequest =
obj['supportsBreakpointLocationsRequest'] as bool?,
supportsCancelRequest = obj['supportsCancelRequest'] as bool?,
@@ -673,6 +781,8 @@
obj['supportsConditionalBreakpoints'] as bool?,
supportsConfigurationDoneRequest =
obj['supportsConfigurationDoneRequest'] as bool?,
+ supportsDataBreakpointBytes =
+ obj['supportsDataBreakpointBytes'] as bool?,
supportsDataBreakpoints = obj['supportsDataBreakpoints'] as bool?,
supportsDelayedStackTraceLoading =
obj['supportsDelayedStackTraceLoading'] as bool?,
@@ -722,6 +832,11 @@
.any((item) => !ColumnDescriptor.canParse(item))))) {
return false;
}
+ if ((obj['breakpointModes'] is! List ||
+ (obj['breakpointModes']
+ .any((item) => !BreakpointMode.canParse(item))))) {
+ return false;
+ }
if ((obj['completionTriggerCharacters'] is! List ||
(obj['completionTriggerCharacters'].any((item) => item is! String)))) {
return false;
@@ -742,6 +857,9 @@
.any((item) => item is! ChecksumAlgorithm)))) {
return false;
}
+ if (obj['supportsANSIStyling'] is! bool?) {
+ return false;
+ }
if (obj['supportsBreakpointLocationsRequest'] is! bool?) {
return false;
}
@@ -760,6 +878,9 @@
if (obj['supportsConfigurationDoneRequest'] is! bool?) {
return false;
}
+ if (obj['supportsDataBreakpointBytes'] is! bool?) {
+ return false;
+ }
if (obj['supportsDataBreakpoints'] is! bool?) {
return false;
}
@@ -847,6 +968,7 @@
Map<String, Object?> toJson() => {
if (additionalModuleColumns != null)
'additionalModuleColumns': additionalModuleColumns,
+ if (breakpointModes != null) 'breakpointModes': breakpointModes,
if (completionTriggerCharacters != null)
'completionTriggerCharacters': completionTriggerCharacters,
if (exceptionBreakpointFilters != null)
@@ -857,6 +979,8 @@
'supportTerminateDebuggee': supportTerminateDebuggee,
if (supportedChecksumAlgorithms != null)
'supportedChecksumAlgorithms': supportedChecksumAlgorithms,
+ if (supportsANSIStyling != null)
+ 'supportsANSIStyling': supportsANSIStyling,
if (supportsBreakpointLocationsRequest != null)
'supportsBreakpointLocationsRequest':
supportsBreakpointLocationsRequest,
@@ -870,6 +994,8 @@
'supportsConditionalBreakpoints': supportsConditionalBreakpoints,
if (supportsConfigurationDoneRequest != null)
'supportsConfigurationDoneRequest': supportsConfigurationDoneRequest,
+ if (supportsDataBreakpointBytes != null)
+ 'supportsDataBreakpointBytes': supportsDataBreakpointBytes,
if (supportsDataBreakpoints != null)
'supportsDataBreakpoints': supportsDataBreakpoints,
if (supportsDelayedStackTraceLoading != null)
@@ -1445,14 +1571,35 @@
/// Arguments for `dataBreakpointInfo` request.
class DataBreakpointInfoArguments extends RequestArguments {
+ /// If `true`, the `name` is a memory address and the debugger should
+ /// interpret it as a decimal value, or hex value if it is prefixed with `0x`.
+ ///
+ /// Clients may set this property only if the `supportsDataBreakpointBytes`
+ /// capability is true.
+ final bool? asAddress;
+
+ /// If specified, a debug adapter should return information for the range of
+ /// memory extending `bytes` number of bytes from the address or variable
+ /// specified by `name`. Breakpoints set using the resulting data ID should
+ /// pause on data access anywhere within that range.
+ ///
+ /// Clients may set this property only if the `supportsDataBreakpointBytes`
+ /// capability is true.
+ final int? bytes;
+
/// When `name` is an expression, evaluate it in the scope of this stack
/// frame. If not specified, the expression is evaluated in the global scope.
/// When `variablesReference` is specified, this property has no effect.
final int? frameId;
+ /// The mode of the desired breakpoint. If defined, this must be one of the
+ /// `breakpointModes` the debug adapter advertised in its `Capabilities`.
+ final String? mode;
+
/// 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, or an
+ /// address if `asAddress` is also true.
final String name;
/// Reference to the variable container if the data breakpoint is requested
@@ -1465,13 +1612,19 @@
DataBreakpointInfoArguments.fromMap(obj);
DataBreakpointInfoArguments({
+ this.asAddress,
+ this.bytes,
this.frameId,
+ this.mode,
required this.name,
this.variablesReference,
});
DataBreakpointInfoArguments.fromMap(Map<String, Object?> obj)
- : frameId = obj['frameId'] as int?,
+ : asAddress = obj['asAddress'] as bool?,
+ bytes = obj['bytes'] as int?,
+ frameId = obj['frameId'] as int?,
+ mode = obj['mode'] as String?,
name = obj['name'] as String,
variablesReference = obj['variablesReference'] as int?;
@@ -1479,9 +1632,18 @@
if (obj is! Map<String, dynamic>) {
return false;
}
+ if (obj['asAddress'] is! bool?) {
+ return false;
+ }
+ if (obj['bytes'] is! int?) {
+ return false;
+ }
if (obj['frameId'] is! int?) {
return false;
}
+ if (obj['mode'] is! String?) {
+ return false;
+ }
if (obj['name'] is! String) {
return false;
}
@@ -1492,7 +1654,10 @@
}
Map<String, Object?> toJson() => {
+ if (asAddress != null) 'asAddress': asAddress,
+ if (bytes != null) 'bytes': bytes,
if (frameId != null) 'frameId': frameId,
+ if (mode != null) 'mode': mode,
'name': name,
if (variablesReference != null)
'variablesReference': variablesReference,
@@ -1670,6 +1835,13 @@
/// file as the previous instruction.
final 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.'
+ final String? presentationHint;
+
/// Name of the symbol that corresponds with the location of this instruction,
/// if any.
final String? symbol;
@@ -1686,6 +1858,7 @@
this.instructionBytes,
this.line,
this.location,
+ this.presentationHint,
this.symbol,
});
@@ -1700,6 +1873,7 @@
location = obj['location'] == null
? null
: Source.fromJson(obj['location'] as Map<String, Object?>),
+ presentationHint = obj['presentationHint'] as String?,
symbol = obj['symbol'] as String?;
static bool canParse(Object? obj) {
@@ -1730,6 +1904,9 @@
if (!Source.canParse(obj['location'])) {
return false;
}
+ if (obj['presentationHint'] is! String?) {
+ return false;
+ }
if (obj['symbol'] is! String?) {
return false;
}
@@ -1745,6 +1922,7 @@
if (instructionBytes != null) 'instructionBytes': instructionBytes,
if (line != null) 'line': line,
if (location != null) 'location': location,
+ if (presentationHint != null) 'presentationHint': presentationHint,
if (symbol != null) 'symbol': symbol,
};
}
@@ -1871,6 +2049,13 @@
/// Arguments for `evaluate` request.
class EvaluateArguments extends RequestArguments {
+ /// The contextual column where the expression should be evaluated. This may
+ /// be provided if `line` is also provided.
+ ///
+ /// It is measured in UTF-16 code units and the client capability
+ /// `columnsStartAt1` determines whether it is 0- or 1-based.
+ final int? column;
+
/// The context in which the evaluate request is used.
final String? context;
@@ -1886,28 +2071,48 @@
/// specified, the expression is evaluated in the global scope.
final int? frameId;
+ /// The contextual line where the expression should be evaluated. In the
+ /// 'hover' context, this should be set to the start of the expression being
+ /// hovered.
+ final int? line;
+
+ /// The contextual source in which the `line` is found. This must be provided
+ /// if `line` is provided.
+ final Source? source;
+
static EvaluateArguments fromJson(Map<String, Object?> obj) =>
EvaluateArguments.fromMap(obj);
EvaluateArguments({
+ this.column,
this.context,
required this.expression,
this.format,
this.frameId,
+ this.line,
+ this.source,
});
EvaluateArguments.fromMap(Map<String, Object?> obj)
- : context = obj['context'] as String?,
+ : column = obj['column'] as int?,
+ context = obj['context'] as String?,
expression = obj['expression'] as String,
format = obj['format'] == null
? null
: ValueFormat.fromJson(obj['format'] as Map<String, Object?>),
- frameId = obj['frameId'] as int?;
+ frameId = obj['frameId'] as int?,
+ line = obj['line'] as int?,
+ source = obj['source'] == null
+ ? null
+ : Source.fromJson(obj['source'] as Map<String, Object?>);
static bool canParse(Object? obj) {
if (obj is! Map<String, dynamic>) {
return false;
}
+ if (obj['column'] is! int?) {
+ return false;
+ }
if (obj['context'] is! String?) {
return false;
}
@@ -1920,14 +2125,23 @@
if (obj['frameId'] is! int?) {
return false;
}
+ if (obj['line'] is! int?) {
+ return false;
+ }
+ if (!Source.canParse(obj['source'])) {
+ return false;
+ }
return RequestArguments.canParse(obj);
}
Map<String, Object?> toJson() => {
+ if (column != null) 'column': column,
if (context != null) 'context': context,
'expression': expression,
if (format != null) 'format': format,
if (frameId != null) 'frameId': frameId,
+ if (line != null) 'line': line,
+ if (source != null) 'source': source,
};
}
@@ -2190,17 +2404,23 @@
/// capability.
final String filterId;
+ /// The mode of this exception breakpoint. If defined, this must be one of the
+ /// `breakpointModes` the debug adapter advertised in its `Capabilities`.
+ final String? mode;
+
static ExceptionFilterOptions fromJson(Map<String, Object?> obj) =>
ExceptionFilterOptions.fromMap(obj);
ExceptionFilterOptions({
this.condition,
required this.filterId,
+ this.mode,
});
ExceptionFilterOptions.fromMap(Map<String, Object?> obj)
: condition = obj['condition'] as String?,
- filterId = obj['filterId'] as String;
+ filterId = obj['filterId'] as String,
+ mode = obj['mode'] as String?;
static bool canParse(Object? obj) {
if (obj is! Map<String, dynamic>) {
@@ -2212,12 +2432,16 @@
if (obj['filterId'] is! String) {
return false;
}
+ if (obj['mode'] is! String?) {
+ return false;
+ }
return true;
}
Map<String, Object?> toJson() => {
if (condition != null) 'condition': condition,
'filterId': filterId,
+ if (mode != null) 'mode': mode,
};
}
@@ -2692,6 +2916,11 @@
/// which is the native format.
final String? pathFormat;
+ /// The client will interpret ANSI escape sequences in the display of
+ /// `OutputEvent.output` and `Variable.value` fields when
+ /// `Capabilities.supportsANSIStyling` is also enabled.
+ final bool? supportsANSIStyling;
+
/// Client supports the `argsCanBeInterpretedByShell` attribute on the
/// `runInTerminal` request.
final bool? supportsArgsCanBeInterpretedByShell;
@@ -2731,6 +2960,7 @@
this.linesStartAt1,
this.locale,
this.pathFormat,
+ this.supportsANSIStyling,
this.supportsArgsCanBeInterpretedByShell,
this.supportsInvalidatedEvent,
this.supportsMemoryEvent,
@@ -2750,6 +2980,7 @@
linesStartAt1 = obj['linesStartAt1'] as bool?,
locale = obj['locale'] as String?,
pathFormat = obj['pathFormat'] as String?,
+ supportsANSIStyling = obj['supportsANSIStyling'] as bool?,
supportsArgsCanBeInterpretedByShell =
obj['supportsArgsCanBeInterpretedByShell'] as bool?,
supportsInvalidatedEvent = obj['supportsInvalidatedEvent'] as bool?,
@@ -2788,6 +3019,9 @@
if (obj['pathFormat'] is! String?) {
return false;
}
+ if (obj['supportsANSIStyling'] is! bool?) {
+ return false;
+ }
if (obj['supportsArgsCanBeInterpretedByShell'] is! bool?) {
return false;
}
@@ -2826,6 +3060,8 @@
if (linesStartAt1 != null) 'linesStartAt1': linesStartAt1,
if (locale != null) 'locale': locale,
if (pathFormat != null) 'pathFormat': pathFormat,
+ if (supportsANSIStyling != null)
+ 'supportsANSIStyling': supportsANSIStyling,
if (supportsArgsCanBeInterpretedByShell != null)
'supportsArgsCanBeInterpretedByShell':
supportsArgsCanBeInterpretedByShell,
@@ -2899,7 +3135,11 @@
/// `Breakpoint`.
final 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`.
+ final String? mode;
+
+ /// The offset from the instruction reference in bytes.
/// This can be negative.
final int? offset;
@@ -2910,6 +3150,7 @@
this.condition,
this.hitCondition,
required this.instructionReference,
+ this.mode,
this.offset,
});
@@ -2917,6 +3158,7 @@
: condition = obj['condition'] as String?,
hitCondition = obj['hitCondition'] as String?,
instructionReference = obj['instructionReference'] as String,
+ mode = obj['mode'] as String?,
offset = obj['offset'] as int?;
static bool canParse(Object? obj) {
@@ -2932,6 +3174,9 @@
if (obj['instructionReference'] is! String) {
return false;
}
+ if (obj['mode'] is! String?) {
+ return false;
+ }
if (obj['offset'] is! int?) {
return false;
}
@@ -2942,6 +3187,7 @@
if (condition != null) 'condition': condition,
if (hitCondition != null) 'hitCondition': hitCondition,
'instructionReference': instructionReference,
+ if (mode != null) 'mode': mode,
if (offset != null) 'offset': offset,
};
}
@@ -3070,6 +3316,68 @@
};
}
+/// Arguments for `locations` request.
+class LocationsArguments extends RequestArguments {
+ /// Location reference to resolve.
+ final int locationReference;
+
+ static LocationsArguments fromJson(Map<String, Object?> obj) =>
+ LocationsArguments.fromMap(obj);
+
+ LocationsArguments({
+ required this.locationReference,
+ });
+
+ LocationsArguments.fromMap(Map<String, Object?> obj)
+ : locationReference = obj['locationReference'] as int;
+
+ static bool canParse(Object? obj) {
+ if (obj is! Map<String, dynamic>) {
+ return false;
+ }
+ if (obj['locationReference'] is! int) {
+ return false;
+ }
+ return RequestArguments.canParse(obj);
+ }
+
+ Map<String, Object?> toJson() => {
+ 'locationReference': locationReference,
+ };
+}
+
+/// Response to `locations` request.
+class LocationsResponse extends Response {
+ static LocationsResponse fromJson(Map<String, Object?> obj) =>
+ LocationsResponse.fromMap(obj);
+
+ LocationsResponse({
+ super.body,
+ required super.command,
+ super.message,
+ required super.requestSeq,
+ required super.seq,
+ required super.success,
+ });
+
+ LocationsResponse.fromMap(super.obj) : super.fromMap();
+
+ static bool canParse(Object? obj) {
+ if (obj is! Map<String, dynamic>) {
+ return false;
+ }
+ if (obj['body'] is! Map<String, Object?>?) {
+ return false;
+ }
+ return Response.canParse(obj);
+ }
+
+ @override
+ Map<String, Object?> toJson() => {
+ ...super.toJson(),
+ };
+}
+
/// A structured message object. Used to return errors from requests.
class Message {
/// A format string for the message. Embedded variables have the form
@@ -4519,10 +4827,10 @@
/// information first, followed by `filterOptions` information.
/// The `verified` property of a `Breakpoint` object signals whether the
/// exception breakpoint or filter could be successfully created and whether the
-/// condition or hit count expressions are valid. In case of an error the
-/// `message` property explains the problem. The `id` property can be used to
-/// introduce a unique ID for the exception breakpoint or filter so that it can
-/// be updated subsequently by sending breakpoint events.
+/// condition is valid. In case of an error the `message` property explains the
+/// problem. The `id` property can be used to introduce a unique ID for the
+/// exception breakpoint or filter so that it can be updated subsequently by
+/// sending breakpoint events.
/// For backward compatibility both the `breakpoints` array and the enclosing
/// `body` are optional. If these elements are missing a client is not able to
/// show problems for individual exception breakpoints or filters.
@@ -5068,6 +5376,10 @@
/// should only be logged if those conditions are met.
final String? logMessage;
+ /// The mode of this breakpoint. If defined, this must be one of the
+ /// `breakpointModes` the debug adapter advertised in its `Capabilities`.
+ final String? mode;
+
static SourceBreakpoint fromJson(Map<String, Object?> obj) =>
SourceBreakpoint.fromMap(obj);
@@ -5077,6 +5389,7 @@
this.hitCondition,
required this.line,
this.logMessage,
+ this.mode,
});
SourceBreakpoint.fromMap(Map<String, Object?> obj)
@@ -5084,7 +5397,8 @@
condition = obj['condition'] as String?,
hitCondition = obj['hitCondition'] as String?,
line = obj['line'] as int,
- logMessage = obj['logMessage'] as String?;
+ logMessage = obj['logMessage'] as String?,
+ mode = obj['mode'] as String?;
static bool canParse(Object? obj) {
if (obj is! Map<String, dynamic>) {
@@ -5105,6 +5419,9 @@
if (obj['logMessage'] is! String?) {
return false;
}
+ if (obj['mode'] is! String?) {
+ return false;
+ }
return true;
}
@@ -5114,6 +5431,7 @@
if (hitCondition != null) 'hitCondition': hitCondition,
'line': line,
if (logMessage != null) 'logMessage': logMessage,
+ if (mode != null) 'mode': mode,
};
}
@@ -5151,11 +5469,11 @@
/// A Stackframe contains the source location.
class StackFrame {
- /// Indicates whether this frame can be restarted with the `restart` request.
- /// Clients should only use this if the debug adapter supports the `restart`
- /// request and the corresponding capability `supportsRestartRequest` is true.
- /// If a debug adapter has this capability, then `canRestart` defaults to
- /// `true` if the property is absent.
+ /// Indicates whether this frame can be restarted with the `restartFrame`
+ /// request. Clients should only use this if the debug adapter supports the
+ /// `restart` request and the corresponding capability `supportsRestartFrame`
+ /// is true. If a debug adapter has this capability, then `canRestart`
+ /// defaults to `true` if the property is absent.
final bool? canRestart;
/// Start position of the range covered by the stack frame. It is measured in
@@ -6180,6 +6498,14 @@
/// The client can use this information to present the children in a paged UI
/// and fetch them in chunks.
class Variable {
+ /// A reference that allows the client to request the location where the
+ /// variable is declared. This should be present only if the adapter is likely
+ /// to be able to resolve the location.
+ ///
+ /// This reference shares the same lifetime as the `variablesReference`. See
+ /// 'Lifetime of Object References' in the Overview section for details.
+ final int? declarationLocationReference;
+
/// The evaluatable name of this variable which can be passed to the
/// `evaluate` request to fetch the variable's value.
final String? evaluateName;
@@ -6189,10 +6515,13 @@
/// and fetch them in chunks.
final int? indexedVariables;
- /// The memory reference for the variable if the variable represents
- /// executable code, such as a function pointer.
- /// This attribute is only required if the corresponding capability
- /// `supportsMemoryReferences` is true.
+ /// A memory reference associated with this variable.
+ /// For pointer type variables, this is generally a reference to the memory
+ /// address contained in the pointer.
+ /// For executable data, this reference may later be used in a `disassemble`
+ /// request.
+ /// This attribute may be returned by a debug adapter if corresponding
+ /// capability `supportsMemoryReferences` is true.
final String? memoryReference;
/// The variable's name.
@@ -6222,6 +6551,16 @@
/// An empty string can be used if no value should be shown in the UI.
final String value;
+ /// A reference that allows the client to request the location where the
+ /// variable's value is declared. For example, if the variable contains a
+ /// function pointer, the adapter may be able to look up the function's
+ /// location. This should be present only if the adapter is likely to be able
+ /// to resolve the location.
+ ///
+ /// This reference shares the same lifetime as the `variablesReference`. See
+ /// 'Lifetime of Object References' in the Overview section for details.
+ final int? valueLocationReference;
+
/// If `variablesReference` is > 0, the variable is structured and its
/// children can be retrieved by passing `variablesReference` to the
/// `variables` request as long as execution remains suspended. See 'Lifetime
@@ -6231,6 +6570,7 @@
static Variable fromJson(Map<String, Object?> obj) => Variable.fromMap(obj);
Variable({
+ this.declarationLocationReference,
this.evaluateName,
this.indexedVariables,
this.memoryReference,
@@ -6239,11 +6579,14 @@
this.presentationHint,
this.type,
required this.value,
+ this.valueLocationReference,
required this.variablesReference,
});
Variable.fromMap(Map<String, Object?> obj)
- : evaluateName = obj['evaluateName'] as String?,
+ : declarationLocationReference =
+ obj['declarationLocationReference'] as int?,
+ evaluateName = obj['evaluateName'] as String?,
indexedVariables = obj['indexedVariables'] as int?,
memoryReference = obj['memoryReference'] as String?,
name = obj['name'] as String,
@@ -6254,12 +6597,16 @@
obj['presentationHint'] as Map<String, Object?>),
type = obj['type'] as String?,
value = obj['value'] as String,
+ valueLocationReference = obj['valueLocationReference'] as int?,
variablesReference = obj['variablesReference'] as int;
static bool canParse(Object? obj) {
if (obj is! Map<String, dynamic>) {
return false;
}
+ if (obj['declarationLocationReference'] is! int?) {
+ return false;
+ }
if (obj['evaluateName'] is! String?) {
return false;
}
@@ -6284,6 +6631,9 @@
if (obj['value'] is! String) {
return false;
}
+ if (obj['valueLocationReference'] is! int?) {
+ return false;
+ }
if (obj['variablesReference'] is! int) {
return false;
}
@@ -6291,6 +6641,8 @@
}
Map<String, Object?> toJson() => {
+ if (declarationLocationReference != null)
+ 'declarationLocationReference': declarationLocationReference,
if (evaluateName != null) 'evaluateName': evaluateName,
if (indexedVariables != null) 'indexedVariables': indexedVariables,
if (memoryReference != null) 'memoryReference': memoryReference,
@@ -6299,6 +6651,8 @@
if (presentationHint != null) 'presentationHint': presentationHint,
if (type != null) 'type': type,
'value': value,
+ if (valueLocationReference != null)
+ 'valueLocationReference': valueLocationReference,
'variablesReference': variablesReference,
};
}
@@ -6861,7 +7215,12 @@
/// An identifier for the data on which a data breakpoint can be registered
/// with the `setDataBreakpoints` request or null if no data breakpoint is
- /// available.
+ /// available. If a `variablesReference` or `frameId` is passed, the `dataId`
+ /// is valid in the current suspended state, otherwise it's valid
+ /// indefinitely. See 'Lifetime of Object References' in the Overview section
+ /// for details. Breakpoints set using the `dataId` in the
+ /// `setDataBreakpoints` request may outlive the lifetime of the associated
+ /// `dataId`.
final Either2<String, Null> dataId;
/// UI string that describes on what data the breakpoint is set on or why a
@@ -7012,7 +7371,7 @@
/// A memory reference to a location appropriate for this result.
/// For pointer type eval results, this is generally a reference to the memory
/// address contained in the pointer.
- /// This attribute should be returned by a debug adapter if corresponding
+ /// This attribute may be returned by a debug adapter if corresponding
/// capability `supportsMemoryReferences` is true.
final String? memoryReference;
@@ -7034,6 +7393,16 @@
/// corresponding capability `supportsVariableType` is true.
final String? type;
+ /// A reference that allows the client to request the location where the
+ /// returned value is declared. For example, if a function pointer is
+ /// returned, the adapter may be able to look up the function's location. This
+ /// should be present only if the adapter is likely to be able to resolve the
+ /// location.
+ ///
+ /// This reference shares the same lifetime as the `variablesReference`. See
+ /// 'Lifetime of Object References' in the Overview section for details.
+ final int? valueLocationReference;
+
/// If `variablesReference` is > 0, the evaluate result is structured and its
/// children can be retrieved by passing `variablesReference` to the
/// `variables` request as long as execution remains suspended. See 'Lifetime
@@ -7050,6 +7419,7 @@
this.presentationHint,
required this.result,
this.type,
+ this.valueLocationReference,
required this.variablesReference,
});
@@ -7063,6 +7433,7 @@
obj['presentationHint'] as Map<String, Object?>),
result = obj['result'] as String,
type = obj['type'] as String?,
+ valueLocationReference = obj['valueLocationReference'] as int?,
variablesReference = obj['variablesReference'] as int;
static bool canParse(Object? obj) {
@@ -7087,6 +7458,9 @@
if (obj['type'] is! String?) {
return false;
}
+ if (obj['valueLocationReference'] is! int?) {
+ return false;
+ }
if (obj['variablesReference'] is! int) {
return false;
}
@@ -7100,6 +7474,8 @@
if (presentationHint != null) 'presentationHint': presentationHint,
'result': result,
if (type != null) 'type': type,
+ if (valueLocationReference != null)
+ 'valueLocationReference': valueLocationReference,
'variablesReference': variablesReference,
};
}
@@ -7427,6 +7803,79 @@
};
}
+class LocationsResponseBody {
+ /// Position of the location within the `line`. It is measured in UTF-16 code
+ /// units and the client capability `columnsStartAt1` determines whether it is
+ /// 0- or 1-based. If no column is given, the first position in the start line
+ /// is assumed.
+ final int? column;
+
+ /// End position of the location within `endLine`, present if the location
+ /// refers to a range. It is measured in UTF-16 code units and the client
+ /// capability `columnsStartAt1` determines whether it is 0- or 1-based.
+ final int? endColumn;
+
+ /// End line of the location, present if the location refers to a range. The
+ /// client capability `linesStartAt1` determines whether it is 0- or 1-based.
+ final int? endLine;
+
+ /// The line number of the location. The client capability `linesStartAt1`
+ /// determines whether it is 0- or 1-based.
+ final int line;
+
+ /// The source containing the location; either `source.path` or
+ /// `source.sourceReference` must be specified.
+ final Source source;
+
+ static LocationsResponseBody fromJson(Map<String, Object?> obj) =>
+ LocationsResponseBody.fromMap(obj);
+
+ LocationsResponseBody({
+ this.column,
+ this.endColumn,
+ this.endLine,
+ required this.line,
+ required this.source,
+ });
+
+ LocationsResponseBody.fromMap(Map<String, Object?> obj)
+ : column = obj['column'] as int?,
+ endColumn = obj['endColumn'] as int?,
+ endLine = obj['endLine'] as int?,
+ line = obj['line'] as int,
+ source = Source.fromJson(obj['source'] as Map<String, Object?>);
+
+ static bool canParse(Object? obj) {
+ if (obj is! Map<String, dynamic>) {
+ return false;
+ }
+ if (obj['column'] is! int?) {
+ return false;
+ }
+ if (obj['endColumn'] is! int?) {
+ return false;
+ }
+ if (obj['endLine'] is! int?) {
+ return false;
+ }
+ if (obj['line'] is! int) {
+ return false;
+ }
+ if (!Source.canParse(obj['source'])) {
+ return false;
+ }
+ return true;
+ }
+
+ Map<String, Object?> toJson() => {
+ if (column != null) 'column': column,
+ if (endColumn != null) 'endColumn': endColumn,
+ if (endLine != null) 'endLine': endLine,
+ 'line': line,
+ 'source': source,
+ };
+}
+
class MemoryEventBody extends EventBody {
/// Number of bytes updated.
final int count;
@@ -7594,7 +8043,24 @@
/// The source location's line where the output was produced.
final int? line;
+ /// A reference that allows the client to request the location where the new
+ /// value is declared. For example, if the logged value is function pointer,
+ /// the adapter may be able to look up the function's location. This should be
+ /// present only if the adapter is likely to be able to resolve the location.
+ ///
+ /// This reference shares the same lifetime as the `variablesReference`. See
+ /// 'Lifetime of Object References' in the Overview section for details.
+ final int? locationReference;
+
/// The output to report.
+ ///
+ /// ANSI escape sequences may be used to influence text color and styling if
+ /// `supportsANSIStyling` is present in both the adapter's `Capabilities` and
+ /// the client's `InitializeRequestArguments`. A client may strip any
+ /// unrecognized ANSI sequences.
+ ///
+ /// If the `supportsANSIStyling` capabilities are not both true, then the
+ /// client should display the output literally.
final String output;
/// The source location where the output was produced.
@@ -7616,6 +8082,7 @@
this.data,
this.group,
this.line,
+ this.locationReference,
required this.output,
this.source,
this.variablesReference,
@@ -7627,6 +8094,7 @@
data = obj['data'],
group = obj['group'] as String?,
line = obj['line'] as int?,
+ locationReference = obj['locationReference'] as int?,
output = obj['output'] as String,
source = obj['source'] == null
? null
@@ -7649,6 +8117,9 @@
if (obj['line'] is! int?) {
return false;
}
+ if (obj['locationReference'] is! int?) {
+ return false;
+ }
if (obj['output'] is! String) {
return false;
}
@@ -7667,6 +8138,7 @@
if (data != null) 'data': data,
if (group != null) 'group': group,
if (line != null) 'line': line,
+ if (locationReference != null) 'locationReference': locationReference,
'output': output,
if (source != null) 'source': source,
if (variablesReference != null)
@@ -7709,8 +8181,9 @@
/// Describes how the debug engine started debugging this process.
final String? startMethod;
- /// The system process id of the debugged process. This property is missing
- /// for non-system processes.
+ /// The process ID of the debugged process, as assigned by the operating
+ /// system. This property should be omitted for logical processes that do not
+ /// map to operating system processes on the machine.
final int? systemProcessId;
static ProcessEventBody fromJson(Map<String, Object?> obj) =>
@@ -8236,6 +8709,13 @@
/// The value should be less than or equal to 2147483647 (2^31-1).
final int? 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.
+ final String? memoryReference;
+
/// The number of named child variables.
/// The client can use this information to present the variables in a paged UI
/// and fetch them in chunks.
@@ -8254,6 +8734,15 @@
/// The new value of the expression.
final String value;
+ /// A reference that allows the client to request the location where the new
+ /// value is declared. For example, if the new value is function pointer, the
+ /// adapter may be able to look up the function's location. This should be
+ /// present only if the adapter is likely to be able to resolve the location.
+ ///
+ /// This reference shares the same lifetime as the `variablesReference`. See
+ /// 'Lifetime of Object References' in the Overview section for details.
+ final int? valueLocationReference;
+
/// If `variablesReference` is > 0, the evaluate result is structured and its
/// children can be retrieved by passing `variablesReference` to the
/// `variables` request as long as execution remains suspended. See 'Lifetime
@@ -8265,15 +8754,18 @@
SetExpressionResponseBody({
this.indexedVariables,
+ this.memoryReference,
this.namedVariables,
this.presentationHint,
this.type,
required this.value,
+ this.valueLocationReference,
this.variablesReference,
});
SetExpressionResponseBody.fromMap(Map<String, Object?> obj)
: indexedVariables = obj['indexedVariables'] as int?,
+ memoryReference = obj['memoryReference'] as String?,
namedVariables = obj['namedVariables'] as int?,
presentationHint = obj['presentationHint'] == null
? null
@@ -8281,6 +8773,7 @@
obj['presentationHint'] as Map<String, Object?>),
type = obj['type'] as String?,
value = obj['value'] as String,
+ valueLocationReference = obj['valueLocationReference'] as int?,
variablesReference = obj['variablesReference'] as int?;
static bool canParse(Object? obj) {
@@ -8290,6 +8783,9 @@
if (obj['indexedVariables'] is! int?) {
return false;
}
+ if (obj['memoryReference'] is! String?) {
+ return false;
+ }
if (obj['namedVariables'] is! int?) {
return false;
}
@@ -8302,6 +8798,9 @@
if (obj['value'] is! String) {
return false;
}
+ if (obj['valueLocationReference'] is! int?) {
+ return false;
+ }
if (obj['variablesReference'] is! int?) {
return false;
}
@@ -8310,10 +8809,13 @@
Map<String, Object?> toJson() => {
if (indexedVariables != null) 'indexedVariables': indexedVariables,
+ if (memoryReference != null) 'memoryReference': memoryReference,
if (namedVariables != null) 'namedVariables': namedVariables,
if (presentationHint != null) 'presentationHint': presentationHint,
if (type != null) 'type': type,
'value': value,
+ if (valueLocationReference != null)
+ 'valueLocationReference': valueLocationReference,
if (variablesReference != null)
'variablesReference': variablesReference,
};
@@ -8394,6 +8896,13 @@
/// The value should be less than or equal to 2147483647 (2^31-1).
final int? 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.
+ final String? memoryReference;
+
/// The number of named child variables.
/// The client can use this information to present the variables in a paged UI
/// and fetch them in chunks.
@@ -8407,10 +8916,23 @@
/// The new value of the variable.
final String value;
+ /// A reference that allows the client to request the location where the new
+ /// value is declared. For example, if the new value is function pointer, the
+ /// adapter may be able to look up the function's location. This should be
+ /// present only if the adapter is likely to be able to resolve the location.
+ ///
+ /// This reference shares the same lifetime as the `variablesReference`. See
+ /// 'Lifetime of Object References' in the Overview section for details.
+ final int? valueLocationReference;
+
/// If `variablesReference` is > 0, the new value is structured and its
/// children can be retrieved by passing `variablesReference` to the
/// `variables` request as long as execution remains suspended. See 'Lifetime
/// of Object References' in the Overview section for details.
+ ///
+ /// If this property is included in the response, any `variablesReference`
+ /// previously associated with the updated variable, and those of its
+ /// children, are no longer valid.
final int? variablesReference;
static SetVariableResponseBody fromJson(Map<String, Object?> obj) =>
@@ -8418,17 +8940,21 @@
SetVariableResponseBody({
this.indexedVariables,
+ this.memoryReference,
this.namedVariables,
this.type,
required this.value,
+ this.valueLocationReference,
this.variablesReference,
});
SetVariableResponseBody.fromMap(Map<String, Object?> obj)
: indexedVariables = obj['indexedVariables'] as int?,
+ memoryReference = obj['memoryReference'] as String?,
namedVariables = obj['namedVariables'] as int?,
type = obj['type'] as String?,
value = obj['value'] as String,
+ valueLocationReference = obj['valueLocationReference'] as int?,
variablesReference = obj['variablesReference'] as int?;
static bool canParse(Object? obj) {
@@ -8438,6 +8964,9 @@
if (obj['indexedVariables'] is! int?) {
return false;
}
+ if (obj['memoryReference'] is! String?) {
+ return false;
+ }
if (obj['namedVariables'] is! int?) {
return false;
}
@@ -8447,6 +8976,9 @@
if (obj['value'] is! String) {
return false;
}
+ if (obj['valueLocationReference'] is! int?) {
+ return false;
+ }
if (obj['variablesReference'] is! int?) {
return false;
}
@@ -8455,9 +8987,12 @@
Map<String, Object?> toJson() => {
if (indexedVariables != null) 'indexedVariables': indexedVariables,
+ if (memoryReference != null) 'memoryReference': memoryReference,
if (namedVariables != null) 'namedVariables': namedVariables,
if (type != null) 'type': type,
'value': value,
+ if (valueLocationReference != null)
+ 'valueLocationReference': valueLocationReference,
if (variablesReference != null)
'variablesReference': variablesReference,
};
@@ -9010,6 +9545,7 @@
InitializeRequestArguments: 'initialize',
LaunchRequestArguments: 'launch',
LoadedSourcesArguments: 'loadedSources',
+ LocationsArguments: 'locations',
ModulesArguments: 'modules',
NextArguments: 'next',
PauseArguments: 'pause',
diff --git a/third_party/pkg/dap/pubspec.yaml b/third_party/pkg/dap/pubspec.yaml
index 6e43fbb..94a34f0 100644
--- a/third_party/pkg/dap/pubspec.yaml
+++ b/third_party/pkg/dap/pubspec.yaml
@@ -1,5 +1,5 @@
name: dap
-version: 1.3.0
+version: 1.4.0
description: >-
A package of classes that are generated from the DAP specifications along with
their generating code.
diff --git a/third_party/pkg/dap/tool/external_dap_spec/debugAdapterProtocol.json b/third_party/pkg/dap/tool/external_dap_spec/debugAdapterProtocol.json
index ecb6d4f..51737da 100644
--- a/third_party/pkg/dap/tool/external_dap_spec/debugAdapterProtocol.json
+++ b/third_party/pkg/dap/tool/external_dap_spec/debugAdapterProtocol.json
@@ -130,7 +130,7 @@
"CancelRequest": {
"allOf": [ { "$ref": "#/definitions/Request" }, {
"type": "object",
- "description": "The `cancel` request is used by the client in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence. Clients should only call this request if the corresponding capability `supportsCancelRequest` is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.\nThe `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.\nThe request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).\nReturning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.\nThe progress that got cancelled still needs to send a `progressEnd` event back.\n A client should not assume that progress just got cancelled after sending the `cancel` request.",
+ "description": "The `cancel` request is used by the client in two situations:\n- to indicate that it is no longer interested in the result produced by a specific request issued earlier\n- to cancel a progress sequence.\nClients should only call this request if the corresponding capability `supportsCancelRequest` is true.\nThis request has a hint characteristic: a debug adapter can only be expected to make a 'best effort' in honoring this request but there are no guarantees.\nThe `cancel` request may return an error if it could not cancel an operation but a client should refrain from presenting this error to end users.\nThe request that got cancelled still needs to send a response back. This can either be a normal result (`success` attribute true) or an error response (`success` attribute false and the `message` set to `cancelled`).\nReturning partial results from a cancelled request is possible but please note that a client has no generic way for detecting that a response is partial or not.\nThe progress that got cancelled still needs to send a `progressEnd` event back.\n A client should not assume that progress just got cancelled after sending the `cancel` request.",
"properties": {
"command": {
"type": "string",
@@ -361,7 +361,7 @@
},
"output": {
"type": "string",
- "description": "The output to report."
+ "description": "The output to report.\n\nANSI escape sequences may be used to influence text color and styling if `supportsANSIStyling` is present in both the adapter's `Capabilities` and the client's `InitializeRequestArguments`. A client may strip any unrecognized ANSI sequences.\n\nIf the `supportsANSIStyling` capabilities are not both true, then the client should display the output literally."
},
"group": {
"type": "string",
@@ -392,6 +392,10 @@
"data": {
"type": [ "array", "boolean", "integer", "null", "number" , "object", "string" ],
"description": "Additional data to report. For the `telemetry` category the data is sent to telemetry, for the other categories the data is shown in JSON format."
+ },
+ "locationReference": {
+ "type": "integer",
+ "description": "A reference that allows the client to request the location where the new value is declared. For example, if the logged value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details."
}
},
"required": ["output"]
@@ -508,7 +512,7 @@
},
"systemProcessId": {
"type": "integer",
- "description": "The system process id of the debugged process. This property is missing for non-system processes."
+ "description": "The process ID of the debugged process, as assigned by the operating system. This property should be omitted for logical processes that do not map to operating system processes on the machine."
},
"isLocalProcess": {
"type": "boolean",
@@ -955,6 +959,10 @@
"supportsStartDebuggingRequest": {
"type": "boolean",
"description": "Client supports the `startDebugging` request."
+ },
+ "supportsANSIStyling": {
+ "type": "boolean",
+ "description": "The client will interpret ANSI escape sequences in the display of `OutputEvent.output` and `Variable.value` fields when `Capabilities.supportsANSIStyling` is also enabled."
}
},
"required": [ "adapterID" ]
@@ -1202,7 +1210,7 @@
"properties": {
"source": {
"$ref": "#/definitions/Source",
- "description": "The source location of the breakpoints; either `source.path` or `source.reference` must be specified."
+ "description": "The source location of the breakpoints; either `source.path` or `source.sourceReference` must be specified."
},
"line": {
"type": "integer",
@@ -1370,7 +1378,7 @@
"SetExceptionBreakpointsRequest": {
"allOf": [ { "$ref": "#/definitions/Request" }, {
"type": "object",
- "description": "The request configures the debugger's response to thrown exceptions.\nIf an exception is configured to break, a `stopped` event is fired (with reason `exception`).\nClients should only call this request if the corresponding capability `exceptionBreakpointFilters` returns one or more filters.",
+ "description": "The request configures the debugger's response to thrown exceptions. Each of the `filters`, `filterOptions`, and `exceptionOptions` in the request are independent configurations to a debug adapter indicating a kind of exception to catch. An exception thrown in a program should result in a `stopped` event from the debug adapter (with reason `exception`) if any of the configured filters match.\nClients should only call this request if the corresponding capability `exceptionBreakpointFilters` returns one or more filters.",
"properties": {
"command": {
"type": "string",
@@ -1414,7 +1422,7 @@
"SetExceptionBreakpointsResponse": {
"allOf": [ { "$ref": "#/definitions/Response" }, {
"type": "object",
- "description": "Response to `setExceptionBreakpoints` request.\nThe response contains an array of `Breakpoint` objects with information about each exception breakpoint or filter. The `Breakpoint` objects are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays given as arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information.\nThe `verified` property of a `Breakpoint` object signals whether the exception breakpoint or filter could be successfully created and whether the condition or hit count expressions are valid. In case of an error the `message` property explains the problem. The `id` property can be used to introduce a unique ID for the exception breakpoint or filter so that it can be updated subsequently by sending breakpoint events.\nFor backward compatibility both the `breakpoints` array and the enclosing `body` are optional. If these elements are missing a client is not able to show problems for individual exception breakpoints or filters.",
+ "description": "Response to `setExceptionBreakpoints` request.\nThe response contains an array of `Breakpoint` objects with information about each exception breakpoint or filter. The `Breakpoint` objects are in the same order as the elements of the `filters`, `filterOptions`, `exceptionOptions` arrays given as arguments. If both `filters` and `filterOptions` are given, the returned array must start with `filters` information first, followed by `filterOptions` information.\nThe `verified` property of a `Breakpoint` object signals whether the exception breakpoint or filter could be successfully created and whether the condition is valid. In case of an error the `message` property explains the problem. The `id` property can be used to introduce a unique ID for the exception breakpoint or filter so that it can be updated subsequently by sending breakpoint events.\nFor backward compatibility both the `breakpoints` array and the enclosing `body` are optional. If these elements are missing a client is not able to show problems for individual exception breakpoints or filters.",
"properties": {
"body": {
"type": "object",
@@ -1458,11 +1466,23 @@
},
"name": {
"type": "string",
- "description": "The name of the variable's child to obtain data breakpoint information for.\nIf `variablesReference` isn't specified, this can be an expression."
+ "description": "The name of the variable's child to obtain data breakpoint information for.\nIf `variablesReference` isn't specified, this can be an expression, or an address if `asAddress` is also true."
},
"frameId": {
"type": "integer",
"description": "When `name` is an expression, evaluate it in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. When `variablesReference` is specified, this property has no effect."
+ },
+ "bytes": {
+ "type": "integer",
+ "description": "If specified, a debug adapter should return information for the range of memory extending `bytes` number of bytes from the address or variable specified by `name`. Breakpoints set using the resulting data ID should pause on data access anywhere within that range.\n\nClients may set this property only if the `supportsDataBreakpointBytes` capability is true."
+ },
+ "asAddress": {
+ "type": "boolean",
+ "description": "If `true`, the `name` is a memory address and the debugger should interpret it as a decimal value, or hex value if it is prefixed with `0x`.\n\nClients may set this property only if the `supportsDataBreakpointBytes`\ncapability is true."
+ },
+ "mode": {
+ "type": "string",
+ "description": "The mode of the desired breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`."
}
},
"required": [ "name" ]
@@ -1477,7 +1497,7 @@
"properties": {
"dataId": {
"type": [ "string", "null" ],
- "description": "An identifier for the data on which a data breakpoint can be registered with the `setDataBreakpoints` request or null if no data breakpoint is available."
+ "description": "An identifier for the data on which a data breakpoint can be registered with the `setDataBreakpoints` request or null if no data breakpoint is available. 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`."
},
"description": {
"type": "string",
@@ -2219,7 +2239,7 @@
},
"variablesReference": {
"type": "integer",
- "description": "If `variablesReference` is > 0, the new value is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details."
+ "description": "If `variablesReference` is > 0, the new value is structured and its children can be retrieved by passing `variablesReference` to the `variables` request as long as execution remains suspended. See 'Lifetime of Object References' in the Overview section for details.\n\nIf this property is included in the response, any `variablesReference` previously associated with the updated variable, and those of its children, are no longer valid."
},
"namedVariables": {
"type": "integer",
@@ -2228,6 +2248,14 @@
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
+ },
+ "memoryReference": {
+ "type": "string",
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
+ },
+ "valueLocationReference": {
+ "type": "integer",
+ "description": "A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details."
}
},
"required": [ "value" ]
@@ -2467,7 +2495,7 @@
"EvaluateRequest": {
"allOf": [ { "$ref": "#/definitions/Request" }, {
"type": "object",
- "description": "Evaluates the given expression in the context of the topmost stack frame.\nThe expression has access to any variables and arguments that are in scope.",
+ "description": "Evaluates the given expression in the context of a stack frame.\nThe expression has access to any variables and arguments that are in scope.",
"properties": {
"command": {
"type": "string",
@@ -2492,6 +2520,18 @@
"type": "integer",
"description": "Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope."
},
+ "line": {
+ "type": "integer",
+ "description": "The contextual line where the expression should be evaluated. In the 'hover' context, this should be set to the start of the expression being hovered."
+ },
+ "column": {
+ "type": "integer",
+ "description": "The contextual column where the expression should be evaluated. This may be provided if `line` is also provided.\n\nIt is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based."
+ },
+ "source": {
+ "$ref": "#/definitions/Source",
+ "description": "The contextual source in which the `line` is found. This must be provided if `line` is provided."
+ },
"context": {
"type": "string",
"_enum": [ "watch", "repl", "hover", "clipboard", "variables" ],
@@ -2545,7 +2585,11 @@
},
"memoryReference": {
"type": "string",
- "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute should be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
+ },
+ "valueLocationReference": {
+ "type": "integer",
+ "description": "A reference that allows the client to request the location where the returned value is declared. For example, if a function pointer is returned, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details."
}
},
"required": [ "result", "variablesReference" ]
@@ -2625,6 +2669,14 @@
"indexedVariables": {
"type": "integer",
"description": "The number of indexed child variables.\nThe client can use this information to present the variables in a paged UI and fetch them in chunks.\nThe value should be less than or equal to 2147483647 (2^31-1)."
+ },
+ "memoryReference": {
+ "type": "string",
+ "description": "A memory reference to a location appropriate for this result.\nFor pointer type eval results, this is generally a reference to the memory address contained in the pointer.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
+ },
+ "valueLocationReference": {
+ "type": "integer",
+ "description": "A reference that allows the client to request the location where the new value is declared. For example, if the new value is function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details."
}
},
"required": [ "value" ]
@@ -3051,6 +3103,68 @@
}]
},
+ "LocationsRequest": {
+ "allOf": [ { "$ref": "#/definitions/Request" }, {
+ "type": "object",
+ "description": "Looks up information about a location reference previously returned by the debug adapter.",
+ "properties": {
+ "command": {
+ "type": "string",
+ "enum": [ "locations" ]
+ },
+ "arguments": {
+ "$ref": "#/definitions/LocationsArguments"
+ }
+ },
+ "required": [ "command", "arguments" ]
+ }]
+ },
+ "LocationsArguments": {
+ "type": "object",
+ "description": "Arguments for `locations` request.",
+ "properties": {
+ "locationReference": {
+ "type": "integer",
+ "description": "Location reference to resolve."
+ }
+ },
+ "required": [ "locationReference" ]
+ },
+ "LocationsResponse": {
+ "allOf": [ { "$ref": "#/definitions/Response" }, {
+ "type": "object",
+ "description": "Response to `locations` request.",
+ "properties": {
+ "body": {
+ "type": "object",
+ "properties": {
+ "source": {
+ "$ref": "#/definitions/Source",
+ "description": "The source containing the location; either `source.path` or `source.sourceReference` must be specified."
+ },
+ "line": {
+ "type": "integer",
+ "description": "The line number of the location. The client capability `linesStartAt1` determines whether it is 0- or 1-based."
+ },
+ "column": {
+ "type": "integer",
+ "description": "Position of the location within the `line`. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based. If no column is given, the first position in the start line is assumed."
+ },
+ "endLine": {
+ "type": "integer",
+ "description": "End line of the location, present if the location refers to a range. The client capability `linesStartAt1` determines whether it is 0- or 1-based."
+ },
+ "endColumn": {
+ "type": "integer",
+ "description": "End position of the location within `endLine`, present if the location refers to a range. It is measured in UTF-16 code units and the client capability `columnsStartAt1` determines whether it is 0- or 1-based."
+ }
+ },
+ "required": [ "source", "line" ]
+ }
+ }
+ }]
+ },
+
"Capabilities": {
"type": "object",
"title": "Types",
@@ -3223,6 +3337,21 @@
"supportsSingleThreadExecutionRequests": {
"type": "boolean",
"description": "The debug adapter supports the `singleThread` property on the execution requests (`continue`, `next`, `stepIn`, `stepOut`, `reverseContinue`, `stepBack`)."
+ },
+ "supportsDataBreakpointBytes": {
+ "type": "boolean",
+ "description": "The debug adapter supports the `asAddress` and `bytes` fields in the `dataBreakpointInfo` request."
+ },
+ "breakpointModes": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/BreakpointMode"
+ },
+ "description": "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.\n\nClients may present the first applicable mode in this array as the 'default' mode in gestures that set breakpoints."
+ },
+ "supportsANSIStyling": {
+ "type": "boolean",
+ "description": "The debug adapter supports ANSI escape sequences in styling of `OutputEvent.output` and `Variable.value` fields."
}
}
},
@@ -3472,7 +3601,7 @@
},
"canRestart": {
"type": "boolean",
- "description": "Indicates whether this frame can be restarted with the `restart` request. Clients should only use this if the debug adapter supports the `restart` request and the corresponding capability `supportsRestartRequest` is true. If a debug adapter has this capability, then `canRestart` defaults to `true` if the property is absent."
+ "description": "Indicates whether this frame can be restarted with the `restartFrame` request. Clients should only use this if the debug adapter supports the `restart` request and the corresponding capability `supportsRestartFrame` is true. If a debug adapter has this capability, then `canRestart` defaults to `true` if the property is absent."
},
"instructionPointerReference": {
"type": "string",
@@ -3502,11 +3631,12 @@
"presentationHint": {
"type": "string",
"description": "A hint for how to present this scope in the UI. If this attribute is missing, the scope is shown with a generic UI.",
- "_enum": [ "arguments", "locals", "registers" ],
+ "_enum": [ "arguments", "locals", "registers", "returnValue" ],
"enumDescriptions": [
"Scope contains method arguments.",
"Scope contains local variables.",
- "Scope contains registers. Only a single `registers` scope should be returned from a `scopes` request."
+ "Scope contains registers. Only a single `registers` scope should be returned from a `scopes` request.",
+ "Scope contains one or more return values."
]
},
"variablesReference": {
@@ -3587,7 +3717,15 @@
},
"memoryReference": {
"type": "string",
- "description": "The memory reference for the variable if the variable represents executable code, such as a function pointer.\nThis attribute is only required if the corresponding capability `supportsMemoryReferences` is true."
+ "description": "A memory reference associated with this variable.\nFor pointer type variables, this is generally a reference to the memory address contained in the pointer.\nFor executable data, this reference may later be used in a `disassemble` request.\nThis attribute may be returned by a debug adapter if corresponding capability `supportsMemoryReferences` is true."
+ },
+ "declarationLocationReference": {
+ "type": "integer",
+ "description": "A reference that allows the client to request the location where the variable is declared. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details."
+ },
+ "valueLocationReference": {
+ "type": "integer",
+ "description": "A reference that allows the client to request the location where the variable's value is declared. For example, if the variable contains a function pointer, the adapter may be able to look up the function's location. This should be present only if the adapter is likely to be able to resolve the location.\n\nThis reference shares the same lifetime as the `variablesReference`. See 'Lifetime of Object References' in the Overview section for details."
}
},
"required": [ "name", "value", "variablesReference" ]
@@ -3626,8 +3764,8 @@
"Indicates that the object is a constant.",
"Indicates that the object is read only.",
"Indicates that the object is a raw string.",
- "Indicates that the object can have an Object ID created for it.",
- "Indicates that the object has an Object ID associated with it.",
+ "Indicates that the object can have an Object ID created for it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.",
+ "Indicates that the object has an Object ID associated with it. This is a vestigial attribute that is used by some clients; 'Object ID's are not specified in the protocol.",
"Indicates that the evaluation had side effects.",
"Indicates that the object has its value tracked by a data breakpoint."
]
@@ -3692,6 +3830,10 @@
"logMessage": {
"type": "string",
"description": "If this attribute exists and is non-empty, the debug adapter must not 'break' (stop)\nbut log the message instead. Expressions within `{}` are interpolated.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsLogPoints` is true.\nIf either `hitCondition` or `condition` is specified, then the message should only be logged if those conditions are met."
+ },
+ "mode": {
+ "type": "string",
+ "description": "The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`."
}
},
"required": [ "line" ]
@@ -3757,7 +3899,7 @@
},
"offset": {
"type": "integer",
- "description": "The offset from the instruction reference.\nThis can be negative."
+ "description": "The offset from the instruction reference in bytes.\nThis can be negative."
},
"condition": {
"type": "string",
@@ -3766,6 +3908,10 @@
"hitCondition": {
"type": "string",
"description": "An expression that controls how many hits of the breakpoint are ignored.\nThe debug adapter is expected to interpret the expression as needed.\nThe attribute is only honored by a debug adapter if the corresponding capability `supportsHitConditionalBreakpoints` is true."
+ },
+ "mode": {
+ "type": "string",
+ "description": "The mode of this breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`."
}
},
"required": [ "instructionReference" ]
@@ -3814,6 +3960,11 @@
"offset": {
"type": "integer",
"description": "The offset from the instruction reference.\nThis can be negative."
+ },
+ "reason": {
+ "type": "string",
+ "description": "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:\n\n- `pending`: Indicates a breakpoint might be verified in the future, but the adapter cannot verify it in the current state.\n - `failed`: Indicates a breakpoint was not able to be verified, and the adapter does not believe it can be verified without intervention.",
+ "enum": [ "pending", "failed" ]
}
},
"required": [ "verified" ]
@@ -4029,6 +4180,10 @@
"condition": {
"type": "string",
"description": "An expression for conditional exceptions.\nThe exception breaks into the debugger if the result of the condition is true."
+ },
+ "mode": {
+ "type": "string",
+ "description": "The mode of this exception breakpoint. If defined, this must be one of the `breakpointModes` the debug adapter advertised in its `Capabilities`."
}
},
"required": [ "filterId" ]
@@ -4151,6 +4306,11 @@
"endColumn": {
"type": "integer",
"description": "The end column of the range that corresponds to this instruction, if any."
+ },
+ "presentationHint": {
+ "type": "string",
+ "description": "A hint for how to present the instruction in the UI.\n\nA 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.'",
+ "enum": [ "normal", "invalid" ]
}
},
"required": [ "address", "instruction" ]
@@ -4166,7 +4326,43 @@
"Previously fetched thread related data has become invalid and needs to be refetched.",
"Previously fetched variable data has become invalid and needs to be refetched."
]
+ },
+ "BreakpointMode": {
+ "type": "object",
+ "description": "A `BreakpointMode` is provided as a option when setting breakpoints on sources or instructions.",
+ "required": ["mode", "label", "appliesTo"],
+ "properties": {
+ "mode": {
+ "type": "string",
+ "description": "The internal ID of the mode. This value is passed to the `setBreakpoints` request."
+ },
+ "label": {
+ "type": "string",
+ "description": "The name of the breakpoint mode. This is shown in the UI."
+ },
+ "description": {
+ "type": "string",
+ "description": "A help text providing additional information about the breakpoint mode. This string is typically shown as a hover and can be translated."
+ },
+ "appliesTo": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/BreakpointModeApplicability"
+ },
+ "description": "Describes one or more type of breakpoint this mode applies to."
+ }
+ }
+ },
+ "BreakpointModeApplicability": {
+ "type": "string",
+ "_enum": ["source", "exception", "data", "instruction"],
+ "enumDescriptions": [
+ "In `SourceBreakpoint`s",
+ "In exception breakpoints applied in the `ExceptionFilterOptions`",
+ "In data breakpoints requested in the `DataBreakpointInfo` request",
+ "In `InstructionBreakpoint`s"
+ ],
+ "description": "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."
}
-
}
}