Package org.chromium.debug.core.sourcemap.TextSectionMapping

Examples of org.chromium.debug.core.sourcemap.TextSectionMapping.TextPoint


    }

    SourcePosition transformImpl(VmResourceId id, int line, int column) {
      ResourceData resourceData = resourceIdToData.get(id);
      if (resourceData != null) {
        TextPoint originalPoint = new TextPoint(line, column);
        SourcePosition resultPosition = resourceData.transform(originalPoint, direction);
        if (resultPosition != null) {
          return resultPosition;
        }
      }
View Full Code Here


    SourcePosition transform(TextPoint point, TextSectionMapping.Direction direction) {
      RangeGroup structure = findRange(point);
      if (structure == null) {
        return null;
      }
      TextPoint resPoint = structure.nonEmptyRangeMapping.mapTable.transform(point, direction);
      return new SourcePosition(structure.nonEmptyRangeMapping.targetResourceId,
          resPoint.getLine(), resPoint.getColumn());
    }
View Full Code Here

    }

    void checkCanAddRange(Range range) throws CannotAddException {
      Map.Entry<TextPoint, RangeGroup> previousEntry = rangeMap.lowerEntry(range.end);
      if (previousEntry != null) {
        TextPoint previousRangeStart = previousEntry.getKey();
        RangeGroup previousRangeGroup = previousEntry.getValue();
        TextPoint previousRangeEnd;
        if (previousRangeGroup.nonEmptyRangeMapping == null) {
          previousRangeEnd = previousRangeStart;
        } else {
          previousRangeEnd = previousRangeGroup.nonEmptyRangeMapping.sourceRange.end;
        }
        if (previousRangeEnd.compareTo(range.start) > 0) {
          throw new CannotAddException("Ranges overlaps: " + range + " with " +
              new Range(previousRangeStart, previousRangeEnd));
        }
      }
    }
View Full Code Here

            new int[] { 0,0, 0,2, 0,12, 2,5, 2,10, 2,10, 2,103,0,   4,}5, 0),
        new StringMappingData(
            new int[] { 5,3, 5,5, 7,39,5, 9,10, 11,3, 11,17, 11,17, 12,0 }, 13, 0)
        );

    checkTwoWays(mapping, new TextPoint(0, 0), new TextPoint(5, 3));
    checkTwoWays(mapping, new TextPoint(0, 1), new TextPoint(5, 4));
    checkTwoWays(mapping, new TextPoint(0, 2), new TextPoint(5, 5));
    checkTwoWays(mapping, new TextPoint(0, 3), new TextPoint(5, 6));
    checkTwoWays(mapping, new TextPoint(0, 10), new TextPoint(5, 13));
    checkTwoWays(mapping, new TextPoint(0, 11), new TextPoint(5, 14));

    assertEquals(new TextPoint(0, 11),
        mapping.transform(new TextPoint(5, 15), Direction.REVERSE));
    assertEquals(new TextPoint(0, 11),
        mapping.transform(new TextPoint(5, 16), Direction.REVERSE));
    assertEquals(new TextPoint(0, 11),
        mapping.transform(new TextPoint(6, 3), Direction.REVERSE));
    assertEquals(new TextPoint(0, 11),
        mapping.transform(new TextPoint(7, 2), Direction.REVERSE));

    checkTwoWays(mapping, new TextPoint(0, 12), new TextPoint(7, 3));
    checkTwoWays(mapping, new TextPoint(0, 13), new TextPoint(7, 4));
    checkTwoWays(mapping, new TextPoint(1, 13), new TextPoint(8, 13));
    checkTwoWays(mapping, new TextPoint(2, 0), new TextPoint(9, 0));
    checkTwoWays(mapping, new TextPoint(2, 4), new TextPoint(9, 4));
    checkTwoWays(mapping, new TextPoint(2, 5), new TextPoint(9, 5));
    checkTwoWays(mapping, new TextPoint(2, 9), new TextPoint(9, 9));

    assertEquals(new TextPoint(2, 10),
        mapping.transform(new TextPoint(11, 3), Direction.REVERSE));
    assertEquals(new TextPoint(2, 10),
        mapping.transform(new TextPoint(11, 4), Direction.REVERSE));
    assertEquals(new TextPoint(2, 10),
        mapping.transform(new TextPoint(11, 16), Direction.REVERSE));
    assertEquals(new TextPoint(3, 0),
        mapping.transform(new TextPoint(11, 17), Direction.REVERSE));
    assertEquals(new TextPoint(11, 18),
        mapping.transform(new TextPoint(3, 1), Direction.DIRECT));
  }
View Full Code Here

        mapping.transform(new TextPoint(3, 1), Direction.DIRECT));
  }

  private static void checkTwoWays(TextSectionMapping mapping,
      TextPoint source, TextPoint destination) {
    TextPoint resultOne = mapping.transform(source, Direction.DIRECT);
    assertEquals(destination, resultOne);
    TextPoint resultTwo = mapping.transform(resultOne, Direction.REVERSE);
    assertEquals(source, resultTwo);
  }
View Full Code Here

TOP

Related Classes of org.chromium.debug.core.sourcemap.TextSectionMapping.TextPoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.