Adding support for Linux format leak files.

This commit is contained in:
beard%netscape.com 2000-08-18 03:16:29 +00:00
Родитель 51377a3a09
Коммит 9235463395
1 изменённых файлов: 39 добавлений и 22 удалений

Просмотреть файл

@ -64,9 +64,25 @@ public class FileLocator {
int rightBracket = line.indexOf(']', leftBracket + 1);
if (rightBracket == -1)
return line;
// generalize for Linux & Mac versions of the Leak detector.
String fullPath;
int lineNumber, lineAnchor;
int colon = line.indexOf(':', leftBracket + 1);
if (colon != -1) {
// Linux format: unmangled_symbol[unix_path:line_number]
fullPath = line.substring(leftBracket + 1, colon);
try {
lineNumber = Integer.parseInt(line.substring(colon + 1, rightBracket));
} catch (NumberFormatException nfe) {
return line;
}
lineAnchor = lineNumber;
} else {
// Mac format: unmangled_symbol[mac_path,byte_offset]
int comma = line.indexOf(',', leftBracket + 1);
String macPath = line.substring(leftBracket + 1, comma);
String fullPath = "/" + macPath.replace(':', '/');
fullPath = "/" + macPath.replace(':', '/');
// compute the line number in the file.
int offset = 0;
@ -86,8 +102,9 @@ public class FileLocator {
table = new FileTable(fullPath);
fileTables.put(fullPath, table);
}
int lineNumber = 1 + table.getLine(offset);
int lineAnchor = lineNumber;
lineNumber = 1 + table.getLine(offset);
lineAnchor = lineNumber;
}
// compute the URL of the file.
int mozillaIndex = fullPath.indexOf(MOZILLA_BASE);