From 1323e984d25fd58b2fcd23776d9b47c4ff603454 Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Fri, 5 May 2017 09:41:19 -0400 Subject: [PATCH] lttng.core: add Address handling to BinaryAspect 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 Reviewed-on: https://git.eclipse.org/r/96484 Reviewed-by: Hudson CI Reviewed-by: Genevieve Bastien --- .../debuginfo/UstDebugInfoBinaryAspect.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoBinaryAspect.java b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoBinaryAspect.java index 15ce8c5b56..aef3ee64c2 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoBinaryAspect.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.core/src/org/eclipse/tracecompass/lttng2/ust/core/analysis/debuginfo/UstDebugInfoBinaryAspect.java @@ -34,7 +34,8 @@ public class UstDebugInfoBinaryAspect implements ITmfEventAspect /** 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 /* 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 * 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 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; } -- 2.34.1