This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: stack trace: don't try to exec addr2line again if it failed previously


This is another small optimization for NameFinder: If the system doesn't have addr2line installed, we don't want to keep trying to exec it every time a stack trace is printed.

I'm checking this in to trunk.

Bryce


2006-05-11  Bryce McKinlay  <mckinlay@redhat.com>

        * gnu/gcj/runtime/NameFinder.java (lookup): If exec'ing addr2line
        fails, don't try again.
        (use_addr2line): Field no longer final.

Index: gnu/gcj/runtime/NameFinder.java
===================================================================
--- gnu/gcj/runtime/NameFinder.java	(revision 113711)
+++ gnu/gcj/runtime/NameFinder.java	(working copy)
@@ -62,7 +62,7 @@
    */
   private static Set blacklist = Collections.synchronizedSet(new HashSet());
 
-  private static final boolean use_addr2line
+  private static boolean use_addr2line
           = Boolean.valueOf(System.getProperty
                 ("gnu.gcj.runtime.NameFinder.use_addr2line", "true")
             ).booleanValue();
@@ -166,8 +166,11 @@
       procs.put(file, addr2line);
       }
     
-    if (addr2line.proc == null)      
-      return;
+    if (addr2line.proc == null)
+      {
+        use_addr2line = false;
+	return;
+      }
     
     String hexAddr = "0x" + Long.toHexString(addr);
     String name;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]