mirror of
https://gcc.gnu.org/git/gcc.git
synced 2025-01-06 11:03:43 +08:00
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
This commit is contained in:
parent
1dbf8c2405
commit
64c9036718
@ -1,3 +1,9 @@
|
||||
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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user