import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst20EventLayout;
import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst27EventLayout;
import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst28EventLayout;
+import org.eclipse.tracecompass.internal.lttng2.ust.core.trace.layout.LttngUst29EventLayout;
import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoBinaryAspect;
+import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoFunctionAspect;
import org.eclipse.tracecompass.lttng2.ust.core.analysis.debuginfo.UstDebugInfoSourceAspect;
import org.eclipse.tracecompass.lttng2.ust.core.trace.layout.ILttngUstEventLayout;
import org.eclipse.tracecompass.tmf.core.event.ITmfEvent;
private static final int CONFIDENCE = 100;
- private static final @NonNull Collection<ITmfEventAspect> LTTNG_UST_ASPECTS;
+ private static final @NonNull Collection<ITmfEventAspect<?>> LTTNG_UST_ASPECTS;
static {
- ImmutableSet.Builder<ITmfEventAspect> builder = ImmutableSet.builder();
+ ImmutableSet.Builder<ITmfEventAspect<?>> builder = ImmutableSet.builder();
builder.addAll(CtfTmfTrace.CTF_ASPECTS);
builder.add(UstDebugInfoBinaryAspect.INSTANCE);
+ builder.add(UstDebugInfoFunctionAspect.INSTANCE);
builder.add(UstDebugInfoSourceAspect.INSTANCE);
LTTNG_UST_ASPECTS = builder.build();
}
if (TRACER_NAME.equals(tracerName)) {
if (tracerMajor >= 2) {
- if (tracerMinor >= 8) {
+ if (tracerMinor >= 9) {
+ return LttngUst29EventLayout.getInstance();
+ } else if (tracerMinor >= 8) {
return LttngUst28EventLayout.getInstance();
} else if (tracerMinor >= 7) {
return LttngUst27EventLayout.getInstance();
}
@Override
- public Iterable<ITmfEventAspect> getEventAspects() {
+ public Iterable<ITmfEventAspect<?>> getEventAspects() {
return LTTNG_UST_ASPECTS;
}
}
return status;
}
+
+ // ------------------------------------------------------------------------
+ // Fields/methods bridging the Debug-info symbol provider
+ // ------------------------------------------------------------------------
+
+ /*
+ * FIXME Once the symbol provider is split in core/ui components, the
+ * UstDebugInfoSymbolProvider should be moved to the core plugin, and this
+ * here can be removed.
+ */
+
+ /**
+ * Configuration of the symbol provider.
+ *
+ * @since 2.0
+ */
+ public static class SymbolProviderConfig {
+
+ private final boolean fUseCustomRootDir;
+ private final @NonNull String fCustomRootDirPath;
+
+ /**
+ * Constructor
+ *
+ * Note that a path can be specified even if 'useCustomRootDir' is
+ * false. This will keep the setting in the text field even when it is
+ * grayed out.
+ *
+ * @param useCustomRootDir
+ * Should a custom directory be used
+ * @param rootDirPath
+ * Custom directory path
+ */
+ public SymbolProviderConfig(boolean useCustomRootDir, @NonNull String rootDirPath) {
+ fUseCustomRootDir = useCustomRootDir;
+ fCustomRootDirPath = rootDirPath;
+ }
+
+ /**
+ * @return Should a custom directory be used
+ */
+ public boolean useCustomRootDir() {
+ return fUseCustomRootDir;
+ }
+
+ /**
+ * @return The configured root directory
+ */
+ public String getCustomRootDirPath() {
+ return fCustomRootDirPath;
+ }
+
+ /**
+ * Return the "real" path to use for symbol resolution. This is a
+ * convenience method that avoids having to check the state of
+ * {@link #useCustomRootDir()} separately.
+ *
+ * @return The actual root directory to use
+ */
+ public String getActualRootDirPath() {
+ if (fUseCustomRootDir) {
+ return fCustomRootDirPath;
+ }
+ return ""; //$NON-NLS-1$
+ }
+ }
+
+ private @NonNull SymbolProviderConfig fCurrentProviderConfig =
+ /* Default settings for new traces */
+ new SymbolProviderConfig(false, ""); //$NON-NLS-1$
+
+
+ /**
+ * Get the current symbol provider configuration for this trace.
+ *
+ * @return The current symbol provider configuration
+ * @since 2.0
+ */
+ public @NonNull SymbolProviderConfig getSymbolProviderConfig() {
+ return fCurrentProviderConfig;
+ }
+
+ /**
+ * Set the symbol provider configuration for this trace.
+ *
+ * @param config
+ * The new symbol provider configuration to use
+ * @since 2.0
+ */
+ public void setSymbolProviderConfig(@NonNull SymbolProviderConfig config) {
+ fCurrentProviderConfig = config;
+ }
}