public Promise<Breakpoint> createBreakpoint(String file, int line) { return createBreakpoint(new SourceLocation(file, line)); }
private static SourceLocation map(TextLocation location) { if (location == null) { return null; } return new SourceLocation(location.getFileName(), location.getLine()); }
public SourceLocation getSourceLocation(GeneratedLocation generatedLocation) { String fileName = componentByKey(fileMapping, fileNames, generatedLocation); int lineNumberIndex = indexByKey(lineMapping, generatedLocation); int lineNumber = lineNumberIndex >= 0 ? lineMapping.get(lineNumberIndex).get(2) : -1; return new SourceLocation(fileName, lineNumber); }
public SourceLocation[] getFollowingLines(SourceLocation location) { Integer fileIndex = fileNameMap.get(location.getFileName()); if (fileIndex == null) { return null; } RecordArray cfg = controlFlowGraphs[fileIndex]; if (cfg == null) { return null; } if (location.getLine() >= cfg.size()) { return null; } int type = cfg.get(location.getLine()).get(0); if (type == 0) { return null; } int[] data = cfg.get(location.getLine()).getArray(0); int length = data.length / 2; int size = length; if (type == 2) { ++size; } SourceLocation[] result = new SourceLocation[size]; for (int i = 0; i < length; ++i) { result[i] = new SourceLocation(fileNames[data[i * 2]], data[i * 2 + 1]); } return result; }
public Breakpoint createBreakpoint(String file, int line) { return createBreakpoint(new SourceLocation(file, line)); }
private static SourceLocation map(TextLocation location) { if (location == null) { return null; } return new SourceLocation(location.getFileName(), location.getLine()); } }
public SourceLocation getSourceLocation(GeneratedLocation generatedLocation) { String fileName = componentByKey(fileMapping, fileNames, generatedLocation); int lineNumberIndex = indexByKey(lineMapping, generatedLocation); int lineNumber = lineNumberIndex >= 0 ? lineMapping.get(lineNumberIndex).get(2) : -1; return new SourceLocation(fileName, lineNumber); }
public SourceLocation[] getFollowingLines(SourceLocation location) { Integer fileIndex = fileNameMap.get(location.getFileName()); if (fileIndex == null) { return null; } RecordArray cfg = controlFlowGraphs[fileIndex]; if (cfg == null) { return null; } if (location.getLine() >= cfg.size()) { return null; } int type = cfg.get(location.getLine()).get(0); if (type == 0) { return null; } int[] data = cfg.get(location.getLine()).getArray(0); int length = data.length / 2; int size = length; if (type == 2) { ++size; } SourceLocation[] result = new SourceLocation[size]; for (int i = 0; i < length; ++i) { result[i] = new SourceLocation(fileNames[data[i * 2]], data[i * 2 + 1]); } return result; }