From 48599f108ff70261d59b18aeaa77b648b996ee37 Mon Sep 17 00:00:00 2001 From: Alexandre Montplaisir Date: Mon, 18 Jul 2016 15:02:36 -0400 Subject: [PATCH] tmf: Remove ITmfCallsite from ISymbolProvider 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 Reviewed-on: https://git.eclipse.org/r/77553 Reviewed-by: Hudson CI Reviewed-by: Matthew Khouzam --- .../ui/analysis/debuginfo/UstDebugInfoSymbolProvider.java | 8 +++++++- .../internal/tmf/ui/symbols/BasicSymbolProvider.java | 1 + .../tmf/ui/symbols/DefaultSymbolProvider.java | 1 + .../tracecompass/tmf/ui/symbols/ISymbolProvider.java | 6 ++++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/lttng/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/tracecompass/internal/lttng2/ust/ui/analysis/debuginfo/UstDebugInfoSymbolProvider.java b/lttng/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/tracecompass/internal/lttng2/ust/ui/analysis/debuginfo/UstDebugInfoSymbolProvider.java index 8ca91fd2a3..c6670d8aa9 100644 --- a/lttng/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/tracecompass/internal/lttng2/ust/ui/analysis/debuginfo/UstDebugInfoSymbolProvider.java +++ b/lttng/org.eclipse.tracecompass.lttng2.ust.ui/src/org/eclipse/tracecompass/internal/lttng2/ust/ui/analysis/debuginfo/UstDebugInfoSymbolProvider.java @@ -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); diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/symbols/BasicSymbolProvider.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/symbols/BasicSymbolProvider.java index 9d75550ebb..3135a4e454 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/symbols/BasicSymbolProvider.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/internal/tmf/ui/symbols/BasicSymbolProvider.java @@ -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); diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/DefaultSymbolProvider.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/DefaultSymbolProvider.java index aa25c11953..9736e5fc37 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/DefaultSymbolProvider.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/DefaultSymbolProvider.java @@ -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; diff --git a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/ISymbolProvider.java b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/ISymbolProvider.java index f3311a0cb2..dbac47e4da 100644 --- a/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/ISymbolProvider.java +++ b/tmf/org.eclipse.tracecompass.tmf.ui/src/org/eclipse/tracecompass/tmf/ui/symbols/ISymbolProvider.java @@ -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); } -- 2.34.1