Index: runtime/observatory/lib/src/service/object.dart |
diff --git a/runtime/observatory/lib/src/service/object.dart b/runtime/observatory/lib/src/service/object.dart |
index ccc9054597b92b533b9fa16d6c53f5a9fdc20d47..b99cf538c37e2b4005374b1e01a7a92e1e9436bb 100644 |
--- a/runtime/observatory/lib/src/service/object.dart |
+++ b/runtime/observatory/lib/src/service/object.dart |
@@ -217,6 +217,7 @@ abstract class ServiceObject { |
case 'Field': |
obj = new Field._empty(owner); |
break; |
+ case 'AsyncFrame': |
case 'Frame': |
obj = new Frame._empty(owner); |
break; |
@@ -4390,11 +4391,13 @@ class ServiceMetric extends ServiceObject implements M.Metric { |
} |
class Frame extends ServiceObject implements M.Frame { |
+ M.FrameKind kind = M.FrameKind.regular; |
int index; |
ServiceFunction function; |
SourceLocation location; |
Code code; |
List<ServiceMap> variables = <ServiceMap>[]; |
+ String marker; |
Frame._empty(ServiceObject owner) : super._empty(owner); |
@@ -4402,14 +4405,30 @@ class Frame extends ServiceObject implements M.Frame { |
assert(!mapIsRef); |
_loaded = true; |
_upgradeCollection(map, owner); |
+ this.kind = _fromString(map['kind']); |
+ this.marker = map['marker']; |
this.index = map['index']; |
this.function = map['function']; |
this.location = map['location']; |
this.code = map['code']; |
- this.variables = map['vars']; |
+ this.variables = map['vars'] ?? []; |
} |
- String toString() => "Frame(${function.qualifiedName} $location)"; |
+ M.FrameKind _fromString(String frameKind) { |
+ if (frameKind == null) { |
+ return M.FrameKind.regular; |
+ } |
+ switch (frameKind) { |
+ case 'kMarker': return M.FrameKind.marker; |
+ case 'kRegular': return M.FrameKind.regular; |
+ case 'kAsyncLive': return M.FrameKind.asyncLive; |
+ case 'kAsyncHistorical': return M.FrameKind.asyncHistorical; |
+ default: |
+ throw new UnsupportedError('Unknown FrameKind: $frameKind'); |
+ } |
+ |
+ } |
+ String toString() => "Frame([$kind] ${function.qualifiedName} $location)"; |
} |
class ServiceMessage extends ServiceObject { |