tmf: remove deprecated methods from tmf
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.ust.ui / src / org / eclipse / tracecompass / internal / lttng2 / ust / ui / analysis / debuginfo / UstDebugInfoSymbolProvider.java
1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc. and others
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10 package org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.debuginfo;
11
12 import org.eclipse.jdt.annotation.NonNull;
13 import org.eclipse.jdt.annotation.Nullable;
14 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.BinaryCallsite;
15 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.FunctionLocation;
16 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoAnalysisModule;
17 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect;
18 import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoFunctionAspect;
19 import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
20 import org.eclipse.tracecompass.tmf.core.symbols.DefaultSymbolProvider;
21 import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
22 import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProviderPreferencePage;
23
24 /**
25 * Symbol provider for UST traces with debug information.
26 *
27 * @author Alexandre Montplaisir
28 * @see UstDebugInfoAnalysisModule
29 */
30 public class UstDebugInfoSymbolProvider extends DefaultSymbolProvider implements ISymbolProvider{
31
32 /**
33 * Create a new {@link UstDebugInfoSymbolProvider} for the given trace
34 *
35 * @param trace
36 * A non-null trace
37 */
38 public UstDebugInfoSymbolProvider(LttngUstTrace trace) {
39 super(trace);
40 }
41
42 /**
43 * Sets the configured path prefix. Usually called from the preferences
44 * page.
45 *
46 * @param newPathPrefix
47 * The new path prefix to use
48 */
49 void setConfiguredPathPrefix(LttngUstTrace.SymbolProviderConfig newConfig) {
50 getTrace().setSymbolProviderConfig(newConfig);
51 }
52
53 @Override
54 public @NonNull LttngUstTrace getTrace() {
55 /* Type enforced at constructor */
56 return (LttngUstTrace) super.getTrace();
57 }
58
59 @Override
60 public @Nullable String getSymbolText(int pid, long timestamp, long address) {
61 BinaryCallsite bc = UstDebugInfoBinaryAspect.getBinaryCallsite(getTrace(), pid, timestamp, address);
62 if (bc == null) {
63 return null;
64 }
65
66 FunctionLocation loc = UstDebugInfoFunctionAspect.getFunctionFromBinaryLocation(bc);
67 return (loc == null ? null : loc.getFunctionName());
68 }
69
70 @Override
71 public @NonNull ISymbolProviderPreferencePage createPreferencePage() {
72 return new UstDebugInfoSymbolProviderPreferencePage(this);
73 }
74
75 }
This page took 0.033301 seconds and 5 git commands to generate.