1 /*******************************************************************************
2 * Copyright (c) 2016 EfficiOS Inc., Alexandre Montplaisir
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
10 package org
.eclipse
.tracecompass
.lttng2
.ust
.core
.analysis
.debuginfo
;
12 import static org
.eclipse
.tracecompass
.common
.core
.NonNullUtils
.nullToEmptyString
;
14 import org
.eclipse
.jdt
.annotation
.Nullable
;
15 import org
.eclipse
.tracecompass
.tmf
.core
.event
.ITmfEvent
;
16 import org
.eclipse
.tracecompass
.tmf
.core
.event
.aspect
.ITmfEventAspect
;
19 * Aspect for the function location obtained with the UST debug info.
21 * @author Alexandre Montplaisir
24 public class UstDebugInfoFunctionAspect
implements ITmfEventAspect
<FunctionLocation
> {
26 /** Singleton instance */
27 public static final UstDebugInfoFunctionAspect INSTANCE
= new UstDebugInfoFunctionAspect();
29 private UstDebugInfoFunctionAspect() {}
32 public String
getName() {
33 return nullToEmptyString(Messages
.UstDebugInfoAnalysis_FunctionAspectName
);
37 public String
getHelpText() {
38 return nullToEmptyString(Messages
.UstDebugInfoAnalysis_FunctionAspectHelpText
);
42 public @Nullable FunctionLocation
resolve(ITmfEvent event
) {
43 SourceCallsite sc
= UstDebugInfoSourceAspect
.INSTANCE
.resolve(event
);
48 String functionName
= sc
.getFunctionName();
49 if (functionName
== null) {
53 /* We do not track the offset in the function at this time */
54 return new FunctionLocation(functionName
, null);