1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc. and others
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 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.internal
.lttng2
.ust
.ui
.analysis
.debuginfo
;
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
;
25 * Symbol provider for UST traces with debug information.
27 * @author Alexandre Montplaisir
28 * @see UstDebugInfoAnalysisModule
30 public class UstDebugInfoSymbolProvider
extends DefaultSymbolProvider
implements ISymbolProvider
{
33 * Create a new {@link UstDebugInfoSymbolProvider} for the given trace
38 public UstDebugInfoSymbolProvider(LttngUstTrace trace
) {
43 * Sets the configured path prefix. Usually called from the preferences
46 * @param newPathPrefix
47 * The new path prefix to use
49 void setConfiguredPathPrefix(LttngUstTrace
.SymbolProviderConfig newConfig
) {
50 getTrace().setSymbolProviderConfig(newConfig
);
54 public @NonNull LttngUstTrace
getTrace() {
55 /* Type enforced at constructor */
56 return (LttngUstTrace
) super.getTrace();
60 public @Nullable String
getSymbolText(int pid
, long timestamp
, long address
) {
61 BinaryCallsite bc
= UstDebugInfoBinaryAspect
.getBinaryCallsite(getTrace(), pid
, timestamp
, address
);
66 FunctionLocation loc
= UstDebugInfoFunctionAspect
.getFunctionFromBinaryLocation(bc
);
67 return (loc
== null ?
null : loc
.getFunctionName());
71 public @NonNull ISymbolProviderPreferencePage
createPreferencePage() {
72 return new UstDebugInfoSymbolProviderPreferencePage(this);