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
.UstDebugInfoAnalysisModule
;
16 import org
.eclipse
.tracecompass
.lttng2
.ust
.core
.analysis
.debuginfo
.UstDebugInfoBinaryAspect
;
17 import org
.eclipse
.tracecompass
.lttng2
.ust
.core
.analysis
.debuginfo
.UstDebugInfoSourceAspect
;
18 import org
.eclipse
.tracecompass
.lttng2
.ust
.core
.trace
.LttngUstTrace
;
19 import org
.eclipse
.tracecompass
.tmf
.core
.event
.lookup
.TmfCallsite
;
20 import org
.eclipse
.tracecompass
.tmf
.ui
.symbols
.DefaultSymbolProvider
;
21 import org
.eclipse
.tracecompass
.tmf
.ui
.symbols
.ISymbolProviderPreferencePage
;
24 * Symbol provider for UST traces with debug information.
26 * @author Alexandre Montplaisir
27 * @see UstDebugInfoAnalysisModule
29 public class UstDebugInfoSymbolProvider
extends DefaultSymbolProvider
{
32 * Create a new {@link UstDebugInfoSymbolProvider} for the given trace
37 public UstDebugInfoSymbolProvider(LttngUstTrace trace
) {
42 * Sets the configured path prefix. Usually called from the preferences
45 * @param newPathPrefix
46 * The new path prefix to use
48 void setConfiguredPathPrefix(LttngUstTrace
.SymbolProviderConfig newConfig
) {
49 getTrace().setSymbolProviderConfig(newConfig
);
53 public @NonNull LttngUstTrace
getTrace() {
54 /* Type enforced at constructor */
55 return (LttngUstTrace
) super.getTrace();
59 public @Nullable String
getSymbolText(int pid
, long timestamp
, long address
) {
60 TmfCallsite callsite
= getSymbolInfo(pid
, timestamp
, address
);
61 return (callsite
== null ?
null : callsite
.getFunctionName());
65 public @Nullable TmfCallsite
getSymbolInfo(int pid
, long timestamp
, long address
) {
66 BinaryCallsite bc
= UstDebugInfoBinaryAspect
.getBinaryCallsite(getTrace(), pid
, timestamp
, address
);
71 return UstDebugInfoSourceAspect
.getSourceCallsite(getTrace(), bc
);
75 public @NonNull ISymbolProviderPreferencePage
createPreferencePage() {
76 return new UstDebugInfoSymbolProviderPreferencePage(this);