lttng.core: add Address handling to BinaryAspect
authorMatthew Khouzam <matthew.khouzam@ericsson.com>
Fri, 5 May 2017 13:41:19 +0000 (09:41 -0400)
committerMatthew Khouzam <matthew.khouzam@ericsson.com>
Thu, 18 May 2017 17:05:41 +0000 (13:05 -0400)
The address is identical to the context_.ip. This is a good fallback
if the user forgets to add the context.

Change-Id: I93829cea195e4a3da8c91ba50d6f5e5bfa939ecd
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/96484
Reviewed-by: Hudson CI
Reviewed-by: Genevieve Bastien <gbastien+lttng@versatic.net>
lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoBinaryAspect.java

index 15ce8c5b56e7e45ecdf56fc03cf3b6f2b625d6a6..aef3ee64c2cdd2789d91f1847c8a5f79354e564f 100644 (file)
@@ -34,7 +34,8 @@ public class UstDebugInfoBinaryAspect implements ITmfEventAspect<BinaryCallsite>
     /** Singleton instance */
     public static final UstDebugInfoBinaryAspect INSTANCE = new UstDebugInfoBinaryAspect();
 
-    private UstDebugInfoBinaryAspect() {}
+    private UstDebugInfoBinaryAspect() {
+    }
 
     @Override
     public String getName() {
@@ -59,6 +60,9 @@ public class UstDebugInfoBinaryAspect implements ITmfEventAspect<BinaryCallsite>
         /* We need both the vpid and ip contexts */
         ITmfEventField vpidField = event.getContent().getField(layout.contextVpid());
         ITmfEventField ipField = event.getContent().getField(layout.contextIp());
+        if (ipField == null) {
+            ipField = event.getContent().getField(layout.fieldAddr());
+        }
         if (vpidField == null || ipField == null) {
             return null;
         }
@@ -89,13 +93,12 @@ public class UstDebugInfoBinaryAspect implements ITmfEventAspect<BinaryCallsite>
          * First match the IP to the correct binary or library, by using the
          * UstDebugInfoAnalysis.
          */
-        UstDebugInfoAnalysisModule module =
-                TmfTraceUtils.getAnalysisModuleOfClass(trace,
-                        UstDebugInfoAnalysisModule.class, UstDebugInfoAnalysisModule.ID);
+        UstDebugInfoAnalysisModule module = TmfTraceUtils.getAnalysisModuleOfClass(trace,
+                UstDebugInfoAnalysisModule.class, UstDebugInfoAnalysisModule.ID);
         if (module == null) {
             /*
-             * The analysis is not available for this trace, we won't be
-             * able to find the information.
+             * The analysis is not available for this trace, we won't be able to
+             * find the information.
              */
             return null;
         }
@@ -112,8 +115,8 @@ public class UstDebugInfoBinaryAspect implements ITmfEventAspect<BinaryCallsite>
             offset = ip - file.getBaseAddress();
         } else {
             /*
-             * In the case of the object being non-position-independent, we
-             * must pass the actual 'ip' address directly to addr2line.
+             * In the case of the object being non-position-independent, we must
+             * pass the actual 'ip' address directly to addr2line.
              */
             offset = ip;
         }
This page took 0.026178 seconds and 5 git commands to generate.