tmf: Remove ITmfCallsite from ISymbolProvider
authorAlexandre Montplaisir <alexmonthy@efficios.com>
Mon, 18 Jul 2016 19:02:36 +0000 (15:02 -0400)
committerAlexandre Montplaisir <alexmonthy@efficios.com>
Thu, 21 Jul 2016 23:50:01 +0000 (19:50 -0400)
We should let ISymbolProvider focus on function/symbol names,
and use a separate interface for source code locations.

Change-Id: Iab4bbe0945f8ab1f633eadb862885a86dccde708
Signed-off-by: Alexandre Montplaisir <alexmonthy@efficios.com>
Reviewed-on: https://git.eclipse.org/r/77553
Reviewed-by: Hudson CI
Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
lttng/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/tracecompass/internal/lttng2/ust/ui/analysis/debuginfo/UstDebugInfoSymbolProvider.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/symbols/BasicSymbolProvider.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/DefaultSymbolProvider.java
tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/ISymbolProvider.java

index 8ca91fd2a3c16d624e003c6d04893dc15549800d..c6670d8aa97883d72e69a8d2080aaf47be24ef0f 100644 (file)
@@ -57,10 +57,16 @@ public class UstDebugInfoSymbolProvider extends DefaultSymbolProvider {
 
     @Override
     public @Nullable String getSymbolText(int pid, long timestamp, long address) {
-        TmfCallsite callsite = getSymbolInfo(pid, timestamp, address);
+        BinaryCallsite bc = UstDebugInfoBinaryAspect.getBinaryCallsite(getTrace(), pid, timestamp, address);
+        if (bc == null) {
+            return null;
+        }
+
+        TmfCallsite callsite = UstDebugInfoSourceAspect.getSourceCallsite(getTrace(), bc);
         return (callsite == null ? null : callsite.getFunctionName());
     }
 
+    @Deprecated
     @Override
     public @Nullable TmfCallsite getSymbolInfo(int pid, long timestamp, long address) {
         BinaryCallsite bc = UstDebugInfoBinaryAspect.getBinaryCallsite(getTrace(), pid, timestamp, address);
index 9d75550ebbddb63581d43461724f6edff2203b21..3135a4e454bc73077cae19d4d02d23242ccf4878 100644 (file)
@@ -138,6 +138,7 @@ public class BasicSymbolProvider implements ISymbolProvider {
         return fMapping.get(Long.toHexString(address));
     }
 
+    @Deprecated
     @Override
     public @Nullable ITmfCallsite getSymbolInfo(long address) {
         loadConfiguration(null);
index aa25c1195308b818785ce6434b61a05182ba923d..9736e5fc372bca7c328a352cfdce054760cc199f 100644 (file)
@@ -72,6 +72,7 @@ public class DefaultSymbolProvider implements ISymbolProvider {
      *            the symbol address
      * @return always null
      */
+    @Deprecated
     @Override
     public @Nullable ITmfCallsite getSymbolInfo(long address) {
         return null;
index f3311a0cb222d5dec97be16ef7d2951ae3869e70..dbac47e4da2d71e7746b3eb6a6c95d47cebe113f 100644 (file)
@@ -62,7 +62,10 @@ public interface ISymbolProvider {
      *            the address of the symbol
      * @return the symbol {@link ITmfCallsite} information or null if the symbol
      *         cannot be found
+     * @deprecated This interface should only provide function/symbol names, not
+     *             full source locations.
      */
+    @Deprecated
     @Nullable ITmfCallsite getSymbolInfo(long address);
 
     /**
@@ -93,7 +96,10 @@ public interface ISymbolProvider {
      *            the address of the symbol
      * @return the symbol {@link ITmfCallsite} information or null if the symbol
      *         cannot be found
+     * @deprecated This interface should only provide function/symbol names, not
+     *             full source locations.
      */
+    @Deprecated
     default @Nullable ITmfCallsite getSymbolInfo(int pid, long timestamp, long address) {
         return getSymbolInfo(address);
     }
This page took 0.040339 seconds and 5 git commands to generate.