diff options
author | Bryce McKinlay <mckinlay@redhat.com> | 2006-05-11 20:53:04 +0000 |
---|---|---|
committer | Bryce McKinlay <bryce@gcc.gnu.org> | 2006-05-11 21:53:04 +0100 |
commit | 64c90367183dc7bfe3fa2b8b73b3b0d4bb828ba3 (patch) | |
tree | 2ebddb0c7876525f8fd0157cba925718c4cc7d8e /libjava/gnu | |
parent | 1dbf8c2405ea8618f493c0d5bb985f4c28d73570 (diff) | |
download | gcc-64c90367183dc7bfe3fa2b8b73b3b0d4bb828ba3.zip gcc-64c90367183dc7bfe3fa2b8b73b3b0d4bb828ba3.tar.gz gcc-64c90367183dc7bfe3fa2b8b73b3b0d4bb828ba3.tar.bz2 |
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
Diffstat (limited to 'libjava/gnu')
-rw-r--r-- | libjava/gnu/gcj/runtime/NameFinder.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libjava/gnu/gcj/runtime/NameFinder.java b/libjava/gnu/gcj/runtime/NameFinder.java index 3a31a2d..bfc3e25 100644 --- a/libjava/gnu/gcj/runtime/NameFinder.java +++ b/libjava/gnu/gcj/runtime/NameFinder.java @@ -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) { |