Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uftrace: demangle c++ names #131

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ Export-Package: org.eclipse.tracecompass.incubator.internal.uftrace.core;x-frien
org.eclipse.tracecompass.incubator.internal.uftrace.core.trace;x-friends:="org.eclipse.tracecompass.incubator.uftrace.core.tests"
Import-Package: com.google.common.collect,
org.apache.commons.io,
org.apache.commons.lang3.math
org.apache.commons.lang3.math,
org.eclipse.cdt.utils
Automatic-Module-Name: org.eclipse.tracecompass.incubator.uftrace.core
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.Set;

import org.apache.commons.io.FilenameUtils;
import org.eclipse.cdt.utils.CPPFilt;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
Expand All @@ -39,6 +40,7 @@
import org.eclipse.tracecompass.incubator.analysis.core.aspects.ProcessNameAspect;
import org.eclipse.tracecompass.incubator.internal.uftrace.core.Activator;
import org.eclipse.tracecompass.incubator.internal.uftrace.core.trace.SymParser.Symbol;
import org.eclipse.tracecompass.internal.tmf.core.callstack.FunctionNameMapper;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
import org.eclipse.tracecompass.tmf.core.event.ITmfEventType;
import org.eclipse.tracecompass.tmf.core.event.aspect.ITmfEventAspect;
Expand Down Expand Up @@ -491,9 +493,15 @@ private Map<Long, MapParser> getMap() {
private static class UfTraceSymbolProvider implements ISymbolProvider {

private Uftrace fTrace;
private CPPFilt fCppFilt;

public UfTraceSymbolProvider(Uftrace trace) {
fTrace = trace;
try {
fCppFilt = new CPPFilt();
} catch (IOException e) {
Activator.getInstance().logError("Could not load CPP Filt, C++ functions will be mangled." , e); //$NON-NLS-1$
}
}

@Override
Expand Down Expand Up @@ -526,6 +534,9 @@ public TmfResolvedSymbol getSymbol(int tid, long timestamp, long address) {
Symbol value = floorEntry.getValue();
if (value != null) {
String name = String.valueOf(value.getName());
if(fCppFilt != null) {
name = FunctionNameMapper.nameFromCppFilt(fCppFilt, name);
}
return new TmfResolvedSymbol(address, name);
}
}
Expand Down
Loading