コード例 #1
0
 /**
  * {@inheritDoc}
  *
  * <p>Show the types of local variables and outer variables.
  */
 @Override
 AvailObjectFieldHelper[] o_DescribeForDebugger(final AvailObject object) {
   final List<AvailObjectFieldHelper> fields = new ArrayList<>();
   fields.addAll(Arrays.asList(super.o_DescribeForDebugger(object)));
   for (int i = 1, end = object.numOuters(); i <= end; i++) {
     fields.add(
         new AvailObjectFieldHelper(object, FakeSlots.OUTER_TYPE_, i, object.outerTypeAt(i)));
   }
   for (int i = 1, end = object.numLocals(); i <= end; i++) {
     fields.add(
         new AvailObjectFieldHelper(object, FakeSlots.LOCAL_TYPE_, i, object.localTypeAt(i)));
   }
   final StringBuilder disassembled = new StringBuilder();
   object.printOnAvoidingIndent(disassembled, new IdentityHashMap<A_BasicObject, Void>(), 0);
   final String[] content = disassembled.toString().split("\n");
   fields.add(new AvailObjectFieldHelper(object, FakeSlots.L1_DISASSEMBLY, -1, content));
   final List<AvailObject> allLiterals = new ArrayList<>();
   for (int i = 1; i <= object.numLiterals(); i++) {
     allLiterals.add(object.literalAt(i));
   }
   fields.add(
       new AvailObjectFieldHelper(
           object, FakeSlots.ALL_LITERALS, -1, TupleDescriptor.fromList(allLiterals)));
   return fields.toArray(new AvailObjectFieldHelper[fields.size()]);
 }
コード例 #2
0
 @Override
 public void printObjectOnAvoidingIndent(
     final AvailObject object,
     final StringBuilder builder,
     final IdentityHashMap<A_BasicObject, Void> recursionMap,
     final int indent) {
   super.printObjectOnAvoidingIndent(object, builder, recursionMap, indent);
   Strings.newlineTab(builder, indent);
   builder.append("Nybblecodes:\n");
   L1Disassembler.disassemble(object, builder, recursionMap, indent + 1);
 }