lttng.ust: Do not skip unknown lines in addr2line output
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.ust.core / src / org / eclipse / tracecompass / internal / lttng2 / ust / core / analysis / debuginfo / FileOffsetMapper.java
index 7717955aef228758a21cc671fc288788b5ab01af..d6700046d216c57145fa101fa2138b8ee10141d5 100644 (file)
@@ -163,6 +163,12 @@ public final class FileOffsetMapper {
     // Utility methods making use of 'addr2line'
     // ------------------------------------------------------------------------
 
+    /**
+     * Value used in addr2line output to represent unknown function names or
+     * source files.
+     */
+    private static final String UNKNOWN_VALUE = "??"; //$NON-NLS-1$
+
     /**
      * Cache of all calls to 'addr2line', so that we can avoid recalling the
      * external process repeatedly.
@@ -252,25 +258,26 @@ public final class FileOffsetMapper {
 
             if (oddLine) {
                 /* This is a line indicating the function name */
-                currentFunctionName = outputLine;
+                if (outputLine.equals(UNKNOWN_VALUE)) {
+                    currentFunctionName = null;
+                } else {
+                    currentFunctionName = outputLine;
+                }
             } else {
                 /* This is a line indicating a call site */
                 String[] elems = outputLine.split(":"); //$NON-NLS-1$
                 String fileName = elems[0];
-                if (fileName.equals("??")) { //$NON-NLS-1$
-                    continue;
+                if (fileName.equals(UNKNOWN_VALUE)) {
+                    fileName = null;
                 }
+                Long lineNumber;
                 try {
-                    long lineNumber = Long.parseLong(elems[1]);
-                    callsites.add(new Addr2lineInfo(fileName, currentFunctionName, lineNumber));
-
+                    lineNumber = Long.valueOf(elems[1]);
                 } catch (NumberFormatException e) {
-                    /*
-                     * Probably a '?' output, meaning unknown line number.
-                     * Ignore this entry.
-                     */
-                    continue;
+                    /* Probably a '?' output, meaning unknown line number. */
+                    lineNumber = null;
                 }
+                callsites.add(new Addr2lineInfo(fileName, currentFunctionName, lineNumber));
             }
         }
 
This page took 0.037195 seconds and 5 git commands to generate.