14package org.dartlang.vm.service;
16import org.dartlang.vm.service.consumer.GetInstanceConsumer;
17import org.dartlang.vm.service.element.BoundField;
18import org.dartlang.vm.service.element.ClassRef;
19import org.dartlang.vm.service.element.Instance;
20import org.dartlang.vm.service.element.InstanceKind;
21import org.dartlang.vm.service.element.InstanceRef;
22import org.dartlang.vm.service.element.Isolate;
23import org.dartlang.vm.service.element.RPCError;
29 private Isolate isolate;
30 private final VmService service;
31 private final OpLatch masterLatch;
40 this.isolate = isolate;
41 this.service = service;
42 this.masterLatch = latch;
49 StringBuilder
result =
new StringBuilder();
50 printInstance(
result, ref, 4);
60 private Instance getInstance(InstanceRef ref) {
73 public void received(Instance
instance) {
88 private void printInstance(StringBuilder
result, InstanceRef ref,
int maxDepth) {
90 result.append(
"-- no value --");
93 InstanceKind kind = ref.getKind();
95 result.append(
"-- unknown instance kind --");
107 result.append(ref.getValueAsString());
112 result.append(ref.getValueAsString());
113 if (ref.getValueAsStringIsTruncated()) {
119 printList(
result, ref, maxDepth);
122 printPlainInstance(
result, ref, maxDepth);
136 case MirrorReference:
144 case Uint8ClampedList:
148 result.append(
"a " + kind);
159 private void printList(StringBuilder
result, InstanceRef ref,
int maxDepth) {
165 Instance list = getInstance(ref);
167 result.append(
"?error?]");
171 for (InstanceRef elem : list.getElements()) {
180 printInstance(
result, elem, maxDepth - 1);
193 private void printPlainInstance(StringBuilder
result, InstanceRef ref,
int maxDepth) {
194 ClassRef classRef = ref.getClassRef();
195 String className = classRef.getName();
197 result.append(
"a " + className);
202 Instance
inst = getInstance(ref);
203 boolean first =
true;
204 for (BoundField field :
inst.getFields()) {
210 printInstance(
result, field.getValue(), maxDepth - 1);
SkIDChangeListener::List List
String toString(InstanceRef ref)
InstanceRefToString(Isolate isolate, VmService service, OpLatch latch)
const uint8_t uint32_t uint32_t GError ** error
SK_API sk_sp< SkSurface > Null(int width, int height)