Commit 64c90367 by Bryce McKinlay Committed by Bryce McKinlay

NameFinder.java (blacklist): New static field.

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.

From-SVN: r113711
parent 1dbf8c24
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.
......
......@@ -20,8 +20,11 @@ import java.io.InputStreamReader;
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;
/**
......@@ -54,6 +57,10 @@ public class NameFinder
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
......@@ -150,7 +157,7 @@ public class NameFinder
sourceFile = null;
lineNum = -1;
if (! use_addr2line)
if (! use_addr2line || blacklist.contains(file))
return;
Addr2Line addr2line = (Addr2Line) procs.get(file);
if (addr2line == null)
......@@ -179,6 +186,12 @@ public class NameFinder
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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment