From 3dfceb5ad8b6904a44648cedd2bde97fe4b0a9b3 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 21 Nov 2022 19:30:09 +0000 Subject: [PATCH] [vm, service] Fix documentation on the various flavors of reference. These have always been able to return non-Instances. TEST=ci Change-Id: I13e46aae8705ea1f79ec0618cdb815a8ed9c0fdb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/270461 Reviewed-by: Ben Konyi Reviewed-by: Derek Xu Commit-Queue: Ryan Macnak --- pkg/vm_service/CHANGELOG.md | 4 +++ pkg/vm_service/java/version.properties | 2 +- pkg/vm_service/lib/src/vm_service.dart | 40 ++++++++++++++++++-------- pkg/vm_service/pubspec.yaml | 2 +- runtime/vm/service/service.md | 8 +++--- 5 files changed, 38 insertions(+), 18 deletions(-) diff --git a/pkg/vm_service/CHANGELOG.md b/pkg/vm_service/CHANGELOG.md index a50a0133a46..a61794e2c28 100644 --- a/pkg/vm_service/CHANGELOG.md +++ b/pkg/vm_service/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 10.0.0 +- Update to version `3.62` of the spec. +- Update for incorrectly documented types for WeakReference's target, WeakProperty's key and value, and MirrorReference's mirrorReferent. + ## 9.4.0 - Update to version `3.61` of the spec. - Add `isolateGroupId` property to `@Isolate` and `Isolate`. diff --git a/pkg/vm_service/java/version.properties b/pkg/vm_service/java/version.properties index 034bc0f04e8..8822aaf8ba2 100644 --- a/pkg/vm_service/java/version.properties +++ b/pkg/vm_service/java/version.properties @@ -1 +1 @@ -version=3.61 +version=3.62 diff --git a/pkg/vm_service/lib/src/vm_service.dart b/pkg/vm_service/lib/src/vm_service.dart index 9331689f601..132563c83a2 100644 --- a/pkg/vm_service/lib/src/vm_service.dart +++ b/pkg/vm_service/lib/src/vm_service.dart @@ -26,7 +26,7 @@ export 'snapshot_graph.dart' HeapSnapshotObjectNoData, HeapSnapshotObjectNullData; -const String vmServiceVersion = '3.61.0'; +const String vmServiceVersion = '3.62.0'; /// @optional const String optional = 'optional'; @@ -709,7 +709,7 @@ abstract class VmServiceInterface { /// collected, then an [Obj] will be returned. /// /// The `offset` and `count` parameters are used to request subranges of - /// Instance objects with the kinds: String, List, Map, Uint8ClampedList, + /// Instance objects with the kinds: String, List, Map, Set, Uint8ClampedList, /// Uint8List, Uint16List, Uint32List, Uint64List, Int8List, Int16List, /// Int32List, Int64List, Flooat32List, Float64List, Inst32x3List, /// Float32x4List, and Float64x2List. These parameters are otherwise ignored. @@ -2733,6 +2733,9 @@ class InstanceKind { /// An instance of the Dart class WeakProperty. static const String kWeakProperty = 'WeakProperty'; + /// An instance of the Dart class WeakReference. + static const String kWeakReference = 'WeakReference'; + /// An instance of the Dart class Type. static const String kType = 'Type'; @@ -4902,6 +4905,7 @@ class InstanceRef extends ObjRef { /// - String /// - List /// - Map + /// - Set /// - Uint8ClampedList /// - Uint8List /// - Uint16List @@ -5153,6 +5157,7 @@ class Instance extends Obj implements InstanceRef { /// - String /// - List /// - Map + /// - Set /// - Uint8ClampedList /// - Uint8List /// - Uint16List @@ -5177,6 +5182,7 @@ class Instance extends Obj implements InstanceRef { /// - String /// - List /// - Map + /// - Set /// - Uint8ClampedList /// - Uint8List /// - Uint16List @@ -5201,6 +5207,7 @@ class Instance extends Obj implements InstanceRef { /// - String /// - List /// - Map + /// - Set /// - Uint8ClampedList /// - Uint8List /// - Uint16List @@ -5264,10 +5271,11 @@ class Instance extends Obj implements InstanceRef { @optional List? fields; - /// The elements of a List instance. + /// The elements of a List or Set instance. /// /// Provided for instance kinds: /// - List + /// - Set @optional List? elements; @@ -5305,7 +5313,7 @@ class Instance extends Obj implements InstanceRef { /// Provided for instance kinds: /// - MirrorReference @optional - InstanceRef? mirrorReferent; + ObjRef? mirrorReferent; /// The pattern of a RegExp instance. /// @@ -5347,14 +5355,21 @@ class Instance extends Obj implements InstanceRef { /// Provided for instance kinds: /// - WeakProperty @optional - InstanceRef? propertyKey; + ObjRef? propertyKey; /// The key for a WeakProperty instance. /// /// Provided for instance kinds: /// - WeakProperty @optional - InstanceRef? propertyValue; + ObjRef? propertyValue; + + /// The target for a WeakReference instance. + /// + /// Provided for instance kinds: + /// - WeakReference + @optional + ObjRef? target; /// The type arguments for this type. /// @@ -5442,6 +5457,7 @@ class Instance extends Obj implements InstanceRef { this.isMultiLine, this.propertyKey, this.propertyValue, + this.target, this.typeArguments, this.parameterIndex, this.targetType, @@ -5496,8 +5512,8 @@ class Instance extends Obj implements InstanceRef { _createSpecificObject(json['associations'], MapAssociation.parse)); bytes = json['bytes']; mirrorReferent = - createServiceObject(json['mirrorReferent'], const ['InstanceRef']) - as InstanceRef?; + createServiceObject(json['mirrorReferent'], const ['ObjRef']) + as ObjRef?; pattern = createServiceObject(json['pattern'], const ['InstanceRef']) as InstanceRef?; closureFunction = @@ -5509,11 +5525,10 @@ class Instance extends Obj implements InstanceRef { isCaseSensitive = json['isCaseSensitive']; isMultiLine = json['isMultiLine']; propertyKey = - createServiceObject(json['propertyKey'], const ['InstanceRef']) - as InstanceRef?; + createServiceObject(json['propertyKey'], const ['ObjRef']) as ObjRef?; propertyValue = - createServiceObject(json['propertyValue'], const ['InstanceRef']) - as InstanceRef?; + createServiceObject(json['propertyValue'], const ['ObjRef']) as ObjRef?; + target = createServiceObject(json['target'], const ['ObjRef']) as ObjRef?; typeArguments = createServiceObject(json['typeArguments'], const ['TypeArgumentsRef']) as TypeArgumentsRef?; @@ -5567,6 +5582,7 @@ class Instance extends Obj implements InstanceRef { _setIfNotNull(json, 'isMultiLine', isMultiLine); _setIfNotNull(json, 'propertyKey', propertyKey?.toJson()); _setIfNotNull(json, 'propertyValue', propertyValue?.toJson()); + _setIfNotNull(json, 'target', target?.toJson()); _setIfNotNull(json, 'typeArguments', typeArguments?.toJson()); _setIfNotNull(json, 'parameterIndex', parameterIndex); _setIfNotNull(json, 'targetType', targetType?.toJson()); diff --git a/pkg/vm_service/pubspec.yaml b/pkg/vm_service/pubspec.yaml index 94ce6002dd0..43391631fae 100644 --- a/pkg/vm_service/pubspec.yaml +++ b/pkg/vm_service/pubspec.yaml @@ -1,5 +1,5 @@ name: vm_service -version: 9.4.0 +version: 10.0.0 description: >- A library to communicate with a service implementing the Dart VM service protocol. diff --git a/runtime/vm/service/service.md b/runtime/vm/service/service.md index 06ff659afd6..ded9453d213 100644 --- a/runtime/vm/service/service.md +++ b/runtime/vm/service/service.md @@ -2971,7 +2971,7 @@ class Instance extends Object { // // Provided for instance kinds: // MirrorReference - @Instance mirrorReferent [optional]; + @Object mirrorReferent [optional]; // The pattern of a RegExp instance. // @@ -3007,19 +3007,19 @@ class Instance extends Object { // // Provided for instance kinds: // WeakProperty - @Instance propertyKey [optional]; + @Object propertyKey [optional]; // The key for a WeakProperty instance. // // Provided for instance kinds: // WeakProperty - @Instance propertyValue [optional]; + @Object propertyValue [optional]; // The target for a WeakReference instance. // // Provided for instance kinds: // WeakReference - @Instance target [optional]; + @Object target [optional]; // The type arguments for this type. //