+2006-05-11 Bryce McKinlay <mckinlay@redhat.com>
+
+ * gnu/gcj/runtime/NameFinder.java (blacklist): New static field.
+ (lookup): If addr2line fails to find an address, flag the binary as
+ having no debug info and avoid calling addr2line on it again.
+
2006-05-11 David Daney <ddaney@avtrex.com>
* testsuite/libjava.compile/PR20418.java: New.
import java.io.OutputStreamWriter;
import java.io.IOException;
import java.io.File;
+import java.util.Collections;
import java.util.Iterator;
import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
/**
private String sourceFile;
private int lineNum;
private HashMap procs = new HashMap();
+ /**
+ * Set of binary files that addr2line should not be called on.
+ */
+ private static Set blacklist = Collections.synchronizedSet(new HashSet());
private static final boolean use_addr2line
= Boolean.valueOf(System.getProperty
sourceFile = null;
lineNum = -1;
- if (! use_addr2line)
+ if (! use_addr2line || blacklist.contains(file))
return;
Addr2Line addr2line = (Addr2Line) procs.get(file);
if (addr2line == null)
String lineNumStr = result.substring(split + 1, result.length());
lineNum = Integer.parseInt (lineNumStr);
}
+ else
+ {
+ /* This binary has no debug info (assuming addr was valid).
+ Avoid repeat addr2line invocations. */
+ blacklist.add(binaryFile);
+ }
}
catch (IOException ioe)
{