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 7a2780b30ecfe715d29b1a724a32cbb9ca63b55a..32a3548d30cba193d02626cb47b5aba4bf33c666 100644 |
--- a/runtime/observatory/lib/src/service/object.dart |
+++ b/runtime/observatory/lib/src/service/object.dart |
@@ -4404,6 +4404,14 @@ class ServiceMetric extends ServiceObject implements M.Metric { |
String toString() => "ServiceMetric($_id)"; |
} |
+void printFrames(List<Frame> frames) async { |
+ for (int i = 0; i < frames.length; i++) { |
+ final Frame frame = frames[i]; |
+ String frameText = await frame.toUserString(); |
+ print('#${i.toString().padLeft(3)}: $frameText'); |
+ } |
+} |
+ |
class Frame extends ServiceObject implements M.Frame { |
M.FrameKind kind = M.FrameKind.regular; |
int index; |
@@ -4450,6 +4458,17 @@ class Frame extends ServiceObject implements M.Frame { |
return "Frame([$kind])"; |
} |
} |
+ |
+ String toUserString() async { |
+ if (function != null) { |
+ return "Frame([$kind] ${function.qualifiedName} " |
+ "${await location.toUserString()})"; |
+ } else if (location != null) { |
+ return "Frame([$kind] ${await location.toUserString()}"; |
+ } else { |
+ return "Frame([$kind])"; |
+ } |
+ } |
} |
class ServiceMessage extends ServiceObject { |