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
CommitLineData
cb2b5e56
AM
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
10package org.eclipse.tracecompass.internal.lttng2.ust.ui.analysis.debuginfo;
11
12import org.eclipse.jdt.annotation.NonNull;
13import org.eclipse.jdt.annotation.Nullable;
14import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.BinaryCallsite;
0c65e461 15import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.FunctionLocation;
cb2b5e56
AM
16import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoAnalysisModule;
17import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect;
0c65e461 18import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoFunctionAspect;
cb2b5e56 19import org.eclipse.tracecompass.lttng2.ust.core.trace.LttngUstTrace;
37c87032
MK
20import org.eclipse.tracecompass.tmf.core.symbols.DefaultSymbolProvider;
21import org.eclipse.tracecompass.tmf.ui.symbols.ISymbolProvider;
cb2b5e56
AM
22import 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 */
37c87032 30public class UstDebugInfoSymbolProvider extends DefaultSymbolProvider implements ISymbolProvider{
cb2b5e56
AM
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) {
48599f10
AM
61 BinaryCallsite bc = UstDebugInfoBinaryAspect.getBinaryCallsite(getTrace(), pid, timestamp, address);
62 if (bc == null) {
63 return null;
64 }
65
0c65e461
AM
66 FunctionLocation loc = UstDebugInfoFunctionAspect.getFunctionFromBinaryLocation(bc);
67 return (loc == null ? null : loc.getFunctionName());
cb2b5e56
AM
68 }
69
cb2b5e56
AM
70 @Override
71 public @NonNull ISymbolProviderPreferencePage createPreferencePage() {
72 return new UstDebugInfoSymbolProviderPreferencePage(this);
73 }
74
75}
This page took 0.037135 seconds and 5 git commands to generate.