1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

Merge remote-tracking branch 'cdt/master' into sd90

This commit is contained in:
Andrew Gvozdev 2012-05-11 18:09:26 -04:00
commit d7542914e9
33 changed files with 108 additions and 61 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006, 2011 Wind River Systems, Inc. and others. * Copyright (c) 2006, 2012 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -209,7 +209,7 @@ public class BasicCEditorTest extends BaseUITestCase {
content= fDocument.get(); content= fDocument.get();
assertEquals("Save failed", newContent, content); assertEquals("Save failed", newContent, content);
// check reconciler // check reconciler
ITranslationUnit tUnit= (ITranslationUnit)fEditor.getInputCElement(); ITranslationUnit tUnit= fEditor.getInputCElement();
ICElement[] children= tUnit.getChildren(); ICElement[] children= tUnit.getChildren();
assertEquals(2, children.length); assertEquals(2, children.length);
setCaret(content.length()); setCaret(content.length());
@ -287,7 +287,7 @@ public class BasicCEditorTest extends BaseUITestCase {
content= fDocument.get().trim(); content= fDocument.get().trim();
assertEquals("Save failed", newContent, content); assertEquals("Save failed", newContent, content);
// check reconciler // check reconciler
ITranslationUnit tUnit= (ITranslationUnit)fEditor.getInputCElement(); ITranslationUnit tUnit= fEditor.getInputCElement();
ICElement[] children= tUnit.getChildren(); ICElement[] children= tUnit.getChildren();
assertEquals(4, children.length); assertEquals(4, children.length);
setCaret(content.length()); setCaret(content.length());
@ -349,7 +349,7 @@ public class BasicCEditorTest extends BaseUITestCase {
content= fDocument.get(); content= fDocument.get();
assertEquals("Save failed", newContent, content); assertEquals("Save failed", newContent, content);
// check reconciler // check reconciler
ITranslationUnit tUnit= (ITranslationUnit)fEditor.getInputCElement(); ITranslationUnit tUnit= fEditor.getInputCElement();
ICElement[] children= tUnit.getChildren(); ICElement[] children= tUnit.getChildren();
assertEquals(2, children.length); assertEquals(2, children.length);
setCaret(content.length()); setCaret(content.length());
@ -390,7 +390,7 @@ public class BasicCEditorTest extends BaseUITestCase {
content= fDocument.get(); content= fDocument.get();
assertEquals("Save failed", newContent, content); assertEquals("Save failed", newContent, content);
// check reconciler // check reconciler
ITranslationUnit tUnit= (ITranslationUnit)fEditor.getInputCElement(); ITranslationUnit tUnit= fEditor.getInputCElement();
ICElement[] children= tUnit.getChildren(); ICElement[] children= tUnit.getChildren();
assertEquals(2, children.length); assertEquals(2, children.length);
setCaret(content.length()); setCaret(content.length());
@ -459,7 +459,7 @@ public class BasicCEditorTest extends BaseUITestCase {
int ngc = 10; int ngc = 10;
while (ref.get() != null && ngc-- > 0) { while (ref.get() != null && ngc-- > 0) {
System.gc(); System.gc();
Thread.sleep(200); EditorTestHelper.runEventQueue(200);
} }
assertNull("CEditor instance seems to be leaking after close", ref.get()); assertNull("CEditor instance seems to be leaking after close", ref.get());
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2010 IBM Corporation and others. * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -55,7 +55,9 @@ import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.cdt.core.dom.ast.ASTVisitor; import org.eclipse.cdt.core.dom.ast.ASTVisitor;
import org.eclipse.cdt.core.dom.ast.IASTBreakStatement; import org.eclipse.cdt.core.dom.ast.IASTBreakStatement;
import org.eclipse.cdt.core.dom.ast.IASTCaseStatement; import org.eclipse.cdt.core.dom.ast.IASTCaseStatement;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement; import org.eclipse.cdt.core.dom.ast.IASTCompoundStatement;
import org.eclipse.cdt.core.dom.ast.IASTDeclSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTDeclaration; import org.eclipse.cdt.core.dom.ast.IASTDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTDefaultStatement; import org.eclipse.cdt.core.dom.ast.IASTDefaultStatement;
import org.eclipse.cdt.core.dom.ast.IASTDoStatement; import org.eclipse.cdt.core.dom.ast.IASTDoStatement;
@ -73,6 +75,7 @@ import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIfdefStatement;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIfndefStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorIfndefStatement;
import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement; import org.eclipse.cdt.core.dom.ast.IASTPreprocessorStatement;
import org.eclipse.cdt.core.dom.ast.IASTProblem; import org.eclipse.cdt.core.dom.ast.IASTProblem;
import org.eclipse.cdt.core.dom.ast.IASTSimpleDeclaration;
import org.eclipse.cdt.core.dom.ast.IASTStatement; import org.eclipse.cdt.core.dom.ast.IASTStatement;
import org.eclipse.cdt.core.dom.ast.IASTSwitchStatement; import org.eclipse.cdt.core.dom.ast.IASTSwitchStatement;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
@ -121,7 +124,7 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
} }
private final Stack<StatementRegion> fStatements; private final Stack<StatementRegion> fStatements;
int fLevel= 0; int fLevel= 0;
String fFunction= ""; //$NON-NLS-1$ Stack<String> fScope= new Stack<String>();
private StatementVisitor(Stack<StatementRegion> statements) { private StatementVisitor(Stack<StatementRegion> statements) {
fStatements = statements; fStatements = statements;
@ -239,9 +242,14 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
if (declaration instanceof IASTFunctionDefinition) { if (declaration instanceof IASTFunctionDefinition) {
final IASTFunctionDeclarator declarator = ((IASTFunctionDefinition)declaration).getDeclarator(); final IASTFunctionDeclarator declarator = ((IASTFunctionDefinition)declaration).getDeclarator();
if (declarator != null) { if (declarator != null) {
fFunction= new String(ASTQueries.findInnermostDeclarator(declarator).getName().toCharArray()); fScope.push(new String(ASTQueries.findInnermostDeclarator(declarator).getName().toCharArray()));
fLevel= 0; fLevel= 0;
} }
} else if (declaration instanceof IASTSimpleDeclaration) {
IASTDeclSpecifier declSpecifier = ((IASTSimpleDeclaration) declaration).getDeclSpecifier();
if (declSpecifier instanceof IASTCompositeTypeSpecifier) {
fScope.push(new String(((IASTCompositeTypeSpecifier) declSpecifier).getName().toCharArray()));
}
} }
return PROCESS_CONTINUE; return PROCESS_CONTINUE;
} }
@ -249,13 +257,20 @@ public class DefaultCFoldingStructureProvider implements ICFoldingStructureProvi
@Override @Override
public int leave(IASTDeclaration declaration) { public int leave(IASTDeclaration declaration) {
if (declaration instanceof IASTFunctionDefinition) { if (declaration instanceof IASTFunctionDefinition) {
fFunction= ""; //$NON-NLS-1$ if (!fScope.isEmpty())
fScope.pop();
} else if (declaration instanceof IASTSimpleDeclaration) {
IASTDeclSpecifier declSpecifier = ((IASTSimpleDeclaration) declaration).getDeclSpecifier();
if (declSpecifier instanceof IASTCompositeTypeSpecifier) {
if (!fScope.isEmpty())
fScope.pop();
}
} }
return PROCESS_CONTINUE; return PROCESS_CONTINUE;
} }
private StatementRegion createRegion() { private StatementRegion createRegion() {
return new StatementRegion(fFunction, fLevel); return new StatementRegion(fScope.toString(), fLevel);
} }
} }

View file

@ -264,6 +264,7 @@ public abstract class AbstractLangsListTab extends AbstractCPropertyTab {
/** /**
* Displays warning message - if any - for selected language settings entry. * Displays warning message - if any - for selected language settings entry.
* Multiline selection is not supported. * Multiline selection is not supported.
* @since 5.4
*/ */
protected void updateStatusLine() { protected void updateStatusLine() {
ICConfigurationDescription cfgDescription = page.getResDesc().getConfiguration(); ICConfigurationDescription cfgDescription = page.getResDesc().getConfiguration();

View file

@ -236,8 +236,12 @@ public class MulticoreVisualizerUIPlugin extends AbstractUIPlugin
/** Returns resource manager for this plugin */ /** Returns resource manager for this plugin */
public UIResourceManager getPluginResources() { public UIResourceManager getPluginResources() {
if (s_resources == null) { if (s_resources == null) {
s_resources = new UIResourceManager(this); // FindBugs reported that it is unsafe to set s_resources
s_resources.setParentManager(CDTVisualizerUIPlugin.getResources()); // before we finish to initialize the object, because of
// multi-threading. This is why we use a temporary variable.
UIResourceManager resourceManager = new UIResourceManager(this);
resourceManager.setParentManager(CDTVisualizerUIPlugin.getResources());
s_resources = resourceManager;
} }
return s_resources; return s_resources;
@ -245,7 +249,7 @@ public class MulticoreVisualizerUIPlugin extends AbstractUIPlugin
/** Releases resource manager for this plugin. */ /** Releases resource manager for this plugin. */
public void cleanupPluginResources() { public void cleanupPluginResources() {
s_resources.dispose(); if (s_resources != null) s_resources.dispose();
} }
/** Convenience method for getting plugin resource manager */ /** Convenience method for getting plugin resource manager */

View file

@ -69,6 +69,11 @@ public class VisualizerThread
return result; return result;
} }
@Override
public int hashCode() {
return m_pid ^ m_tid ^ m_gdbtid;
}
/** Returns string representation. */ /** Returns string representation. */
@Override @Override
public String toString() { public String toString() {

View file

@ -215,9 +215,9 @@ public class GdbPinProvider implements IPinProvider {
IDMContext dmc = null; IDMContext dmc = null;
if (debugContext instanceof IAdaptable) { if (debugContext instanceof IAdaptable) {
dmc = (IDMContext) ((IAdaptable) debugContext).getAdapter(IDMContext.class); dmc = (IDMContext) ((IAdaptable) debugContext).getAdapter(IDMContext.class);
sessionId = dmc.getSessionId() + "."; //$NON-NLS-1$
if (dmc != null) { if (dmc != null) {
sessionId = dmc.getSessionId() + "."; //$NON-NLS-1$
IMIExecutionDMContext execDmc = getExecutionDmc(dmc); IMIExecutionDMContext execDmc = getExecutionDmc(dmc);
IProcessDMContext processDmc = getProcessDmc(dmc); IProcessDMContext processDmc = getProcessDmc(dmc);

View file

@ -41,7 +41,6 @@ import org.eclipse.debug.core.commands.IEnabledStateRequest;
* *
* @since 2.1 * @since 2.1
*/ */
@SuppressWarnings("restriction")
public class GdbSelectNextTraceRecordCommand extends AbstractDebugCommand implements ISelectNextTraceRecordHandler { public class GdbSelectNextTraceRecordCommand extends AbstractDebugCommand implements ISelectNextTraceRecordHandler {
private final DsfExecutor fExecutor; private final DsfExecutor fExecutor;
private final DsfServicesTracker fTracker; private final DsfServicesTracker fTracker;

View file

@ -41,7 +41,6 @@ import org.eclipse.debug.core.commands.IEnabledStateRequest;
* *
* @since 2.1 * @since 2.1
*/ */
@SuppressWarnings("restriction")
public class GdbSelectPrevTraceRecordCommand extends AbstractDebugCommand implements ISelectPrevTraceRecordHandler { public class GdbSelectPrevTraceRecordCommand extends AbstractDebugCommand implements ISelectPrevTraceRecordHandler {
private final DsfExecutor fExecutor; private final DsfExecutor fExecutor;
private final DsfServicesTracker fTracker; private final DsfServicesTracker fTracker;

View file

@ -77,7 +77,6 @@ import org.eclipse.ui.PlatformUI;
/** /**
* A preference page for settings that are currently only supported in GDB. * A preference page for settings that are currently only supported in GDB.
*/ */
@SuppressWarnings("restriction")
public class GdbDebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { public class GdbDebugPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
/** /**

View file

@ -50,7 +50,6 @@ import org.eclipse.jface.viewers.TreePath;
* A specialization of ExpressionVMProvider that uses a GDB-specific variable VM * A specialization of ExpressionVMProvider that uses a GDB-specific variable VM
* node. To understand why this is necessary, see GdbVariableVMNode. * node. To understand why this is necessary, see GdbVariableVMNode.
*/ */
@SuppressWarnings("restriction")
public class GdbExpressionVMProvider extends ExpressionVMProvider { public class GdbExpressionVMProvider extends ExpressionVMProvider {
private IPropertyChangeListener fPreferencesListener; private IPropertyChangeListener fPreferencesListener;

View file

@ -41,7 +41,6 @@ import org.eclipse.jface.viewers.TreePath;
* A specialization of VariableVMProvider that uses a GDB-specific variable VM * A specialization of VariableVMProvider that uses a GDB-specific variable VM
* node. To understand why this is necessary, see GdbVariableVMNode. * node. To understand why this is necessary, see GdbVariableVMNode.
*/ */
@SuppressWarnings("restriction")
public class GdbVariableVMProvider extends VariableVMProvider { public class GdbVariableVMProvider extends VariableVMProvider {
private IPropertyChangeListener fPreferencesListener; private IPropertyChangeListener fPreferencesListener;

View file

@ -9,6 +9,7 @@
* Ericsson - Initial API and implementation * Ericsson - Initial API and implementation
* Wind River Systems - Factored out AbstractContainerVMNode * Wind River Systems - Factored out AbstractContainerVMNode
* Patrick Chuong (Texas Instruments) - Add support for icon overlay in the debug view (Bug 334566) * Patrick Chuong (Texas Instruments) - Add support for icon overlay in the debug view (Bug 334566)
* Marc Khouzam (Ericsson) - Respect the "Show Full Path" option for the process name (Bug 378418)
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.launch; package org.eclipse.cdt.dsf.gdb.internal.ui.viewmodel.launch;
@ -32,6 +33,7 @@ import org.eclipse.cdt.dsf.debug.service.IRunControl.IContainerDMContext;
import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext; import org.eclipse.cdt.dsf.debug.service.IRunControl.IExecutionDMContext;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService;
import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent; import org.eclipse.cdt.dsf.debug.service.command.ICommandControlService.ICommandControlShutdownDMEvent;
import org.eclipse.cdt.dsf.debug.ui.IDsfDebugUIConstants;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.AbstractContainerVMNode; import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.AbstractContainerVMNode;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ExecutionContextLabelText; import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ExecutionContextLabelText;
import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ILaunchVMConstants; import org.eclipse.cdt.dsf.debug.ui.viewmodel.launch.ILaunchVMConstants;
@ -55,6 +57,7 @@ import org.eclipse.cdt.dsf.ui.viewmodel.properties.PropertiesBasedLabelProvider;
import org.eclipse.cdt.dsf.ui.viewmodel.properties.VMDelegatingPropertiesUpdate; import org.eclipse.cdt.dsf.ui.viewmodel.properties.VMDelegatingPropertiesUpdate;
import org.eclipse.cdt.ui.CDTSharedImages; import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate; import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest; import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider; import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
@ -320,7 +323,14 @@ public class ContainerVMNode extends AbstractContainerVMNode
} }
protected void fillThreadDataProperties(IPropertiesUpdate update, IThreadDMData data) { protected void fillThreadDataProperties(IPropertiesUpdate update, IThreadDMData data) {
update.setProperty(PROP_NAME, data.getName()); String fileName = data.getName();
if (fileName != null) {
Object showFullPathPreference = getVMProvider().getPresentationContext().getProperty(IDsfDebugUIConstants.DEBUG_VIEW_SHOW_FULL_PATH_PROPERTY);
if (showFullPathPreference instanceof Boolean && (Boolean)showFullPathPreference == false) {
fileName = new Path(fileName).lastSegment();
}
}
update.setProperty(PROP_NAME, fileName);
update.setProperty(ILaunchVMConstants.PROP_ID, data.getId()); update.setProperty(ILaunchVMConstants.PROP_ID, data.getId());
String coresStr = null; String coresStr = null;

View file

@ -36,7 +36,6 @@ import org.eclipse.cdt.dsf.gdb.IGdbDebugPreferenceConstants;
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbPinProvider; import org.eclipse.cdt.dsf.gdb.internal.ui.GdbPinProvider;
import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin; import org.eclipse.cdt.dsf.gdb.internal.ui.GdbUIPlugin;
import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses.IGdbThreadDMData; import org.eclipse.cdt.dsf.gdb.service.IGDBProcesses.IGdbThreadDMData;
import org.eclipse.cdt.dsf.internal.ui.DsfUIPlugin;
import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext; import org.eclipse.cdt.dsf.mi.service.IMIExecutionDMContext;
import org.eclipse.cdt.dsf.service.DsfSession; import org.eclipse.cdt.dsf.service.DsfSession;
import org.eclipse.cdt.dsf.ui.concurrent.ViewerCountingRequestMonitor; import org.eclipse.cdt.dsf.ui.concurrent.ViewerCountingRequestMonitor;
@ -53,6 +52,7 @@ import org.eclipse.cdt.dsf.ui.viewmodel.properties.PropertiesBasedLabelProvider;
import org.eclipse.cdt.dsf.ui.viewmodel.properties.VMDelegatingPropertiesUpdate; import org.eclipse.cdt.dsf.ui.viewmodel.properties.VMDelegatingPropertiesUpdate;
import org.eclipse.cdt.ui.CDTSharedImages; import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate; import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest; import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementCompareRequest;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider; import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider;
@ -67,7 +67,6 @@ import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.ui.IMemento; import org.eclipse.ui.IMemento;
@SuppressWarnings("restriction")
public class ThreadVMNode extends AbstractThreadVMNode public class ThreadVMNode extends AbstractThreadVMNode
implements IElementLabelProvider, IElementMementoProvider implements IElementLabelProvider, IElementMementoProvider
{ {
@ -317,7 +316,7 @@ public class ThreadVMNode extends AbstractThreadVMNode
final IThreadDMContext threadDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IThreadDMContext.class); final IThreadDMContext threadDmc = findDmcInPath(update.getViewerInput(), update.getElementPath(), IThreadDMContext.class);
if (processService == null || threadDmc == null) { if (processService == null || threadDmc == null) {
update.setStatus(DsfUIPlugin.newErrorStatus(IDsfStatusConstants.INVALID_HANDLE, "Service or handle invalid", null)); //$NON-NLS-1$ update.setStatus(new Status(IDsfStatusConstants.INVALID_HANDLE, GdbUIPlugin.PLUGIN_ID, "Service or handle invalid", null)); //$NON-NLS-1$
} else { } else {
processService.getExecutionData( processService.getExecutionData(
threadDmc, threadDmc,

View file

@ -10,15 +10,16 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.dsf.gdb.internal.service.command.output; package org.eclipse.cdt.dsf.gdb.internal.service.command.output;
import java.util.Arrays;
import org.eclipse.cdt.dsf.debug.service.command.ICommand; import org.eclipse.cdt.dsf.debug.service.command.ICommand;
import org.eclipse.cdt.dsf.debug.service.command.ICommandResult; import org.eclipse.cdt.dsf.debug.service.command.ICommandResult;
import org.eclipse.cdt.internal.core.ICoreInfo; import org.eclipse.cdt.internal.core.ICoreInfo;
/** /**
* Result obtined from MIMetaGetCPUInfo. * Result obtained from MIMetaGetCPUInfo.
* @since 4.1 * @since 4.1
*/ */
@SuppressWarnings("restriction")
public class MIMetaGetCPUInfoInfo implements ICommandResult { public class MIMetaGetCPUInfoInfo implements ICommandResult {
private final ICoreInfo[] fCoresInfo; private final ICoreInfo[] fCoresInfo;
@ -36,6 +37,6 @@ public class MIMetaGetCPUInfoInfo implements ICommandResult {
@Override @Override
public String toString() { public String toString() {
return getClass().getSimpleName() + " (" + getInfo() + ")"; //$NON-NLS-1$ //$NON-NLS-2$ return getClass().getSimpleName() + " (" + Arrays.toString(getInfo()) + ")"; //$NON-NLS-1$ //$NON-NLS-2$
} }
} }

View file

@ -110,7 +110,8 @@ public class GdbLaunchDelegate extends AbstractCLaunchDelegate2
} }
} }
private void launchDebugSession( final ILaunchConfiguration config, ILaunch l, IProgressMonitor monitor ) throws CoreException { /** @since 4.1 */
protected void launchDebugSession( final ILaunchConfiguration config, ILaunch l, IProgressMonitor monitor ) throws CoreException {
if ( monitor.isCanceled() ) { if ( monitor.isCanceled() ) {
cleanupLaunch(); cleanupLaunch();
return; return;

View file

@ -65,7 +65,6 @@ import org.osgi.framework.BundleContext;
* *
* @since 4.1 * @since 4.1
*/ */
@SuppressWarnings("restriction")
public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardwareAndOS, ICachingService { public class GDBHardwareAndOS extends AbstractDsfService implements IGDBHardwareAndOS, ICachingService {
@Immutable @Immutable

View file

@ -256,7 +256,7 @@ public class MIBreakpoints extends AbstractDsfService implements IBreakpoints, I
*/ */
@Override @Override
public boolean equals(Object obj) { public boolean equals(Object obj) {
return baseEquals(obj) && (fReference == ((MIBreakpointDMContext) obj).fReference); return baseEquals(obj) && (fReference.equals(((MIBreakpointDMContext)obj).fReference));
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -399,7 +399,7 @@ public class MIExpressions extends AbstractDsfService implements IMIExpressions,
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
return super.baseEquals(other) && return super.baseEquals(other) &&
expression == null ? ((InvalidContextExpressionDMC) other).getExpression() == null : expression.equals(((InvalidContextExpressionDMC) other).getExpression()); (expression == null ? ((InvalidContextExpressionDMC) other).getExpression() == null : expression.equals(((InvalidContextExpressionDMC) other).getExpression()));
} }
@Override @Override

View file

@ -20,6 +20,7 @@ import java.io.InputStream;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
@ -814,7 +815,7 @@ public abstract class AbstractMIControl extends AbstractDsfService
} catch(IllegalArgumentException e2) { } catch(IllegalArgumentException e2) {
// Message format string invalid. Fallback to just appending the strings. // Message format string invalid. Fallback to just appending the strings.
clientMsg.append(message); clientMsg.append(message);
clientMsg.append(parameters); clientMsg.append(Arrays.toString(parameters));
} }
} else { } else {
clientMsg.append(message); clientMsg.append(message);
@ -865,7 +866,7 @@ public abstract class AbstractMIControl extends AbstractDsfService
} catch(IllegalArgumentException e2) { } catch(IllegalArgumentException e2) {
// Message format string invalid. Fallback to just appending the strings. // Message format string invalid. Fallback to just appending the strings.
clientMsg.append(message); clientMsg.append(message);
clientMsg.append(parameters); clientMsg.append(Arrays.toString(parameters));
} }
} else { } else {
clientMsg.append(message); clientMsg.append(message);

View file

@ -36,12 +36,7 @@ public class CLITraceDumpInfo extends MIInfo {
// tdump parsed info // tdump parsed info
private String fTracepointNum = null; private String fTracepointNum = null;
private String fTraceFrameNumber = null; private String fTraceFrameNumber = null;
/*
* Timestamp, if present in tracepoint frame data
* Note: not yet available in printout of command
* "tdump" -> revisit when it is.
*/
private String timestamp = null;
// keep the tdump header in parsed result or not - by default we keep // keep the tdump header in parsed result or not - by default we keep
private static final boolean KEEP_HEADER = true; private static final boolean KEEP_HEADER = true;
@ -156,7 +151,9 @@ public class CLITraceDumpInfo extends MIInfo {
* @return the timestamp of the tracepoint frame * @return the timestamp of the tracepoint frame
*/ */
public String getTimestamp() { public String getTimestamp() {
return timestamp; // Timestamp not yet available in printout of command
// "tdump" -> revisit when it is.
return null;
} }
} }

View file

@ -41,8 +41,7 @@ public class CLITraceInfo extends MIInfo {
for (int i = 0; i < oobs.length; i++) { for (int i = 0; i < oobs.length; i++) {
if (oobs[i] instanceof MIConsoleStreamOutput) { if (oobs[i] instanceof MIConsoleStreamOutput) {
MIStreamRecord cons = (MIStreamRecord) oobs[i]; MIStreamRecord cons = (MIStreamRecord) oobs[i];
String str = cons.getString(); String str = cons.getString().trim();
str.trim();
if(str.length() > 0 ){ if(str.length() > 0 ){
Pattern pattern = Pattern.compile("^Tracepoint\\s(\\d+)", Pattern.MULTILINE); //$NON-NLS-1$ Pattern pattern = Pattern.compile("^Tracepoint\\s(\\d+)", Pattern.MULTILINE); //$NON-NLS-1$
Matcher matcher = pattern.matcher(str); Matcher matcher = pattern.matcher(str);

View file

@ -180,6 +180,9 @@ public class MIParser {
case '=' : case '=' :
async = new MINotifyAsyncOutput(); async = new MINotifyAsyncOutput();
break; break;
default :
assert false;
async = new MINotifyAsyncOutput();
} }
async.setToken(id); async.setToken(id);
// Extract the Async-Class // Extract the Async-Class
@ -212,6 +215,9 @@ public class MIParser {
case '&' : case '&' :
stream = new MILogStreamOutput(); stream = new MILogStreamOutput();
break; break;
default :
assert false;
stream = new MIConsoleStreamOutput();
} }
// translateCString() assumes that the leading " is deleted // translateCString() assumes that the leading " is deleted
if (buffer.length() > 0 && buffer.charAt(0) == '"') { if (buffer.length() > 0 && buffer.charAt(0) == '"') {

View file

@ -32,8 +32,8 @@ Export-Package: org.eclipse.cdt.dsf.debug.internal.ui;x-internal:=true,
org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;x-friends:="org.eclipse.cdt.dsf.gdb.ui", org.eclipse.cdt.dsf.debug.internal.ui.disassembly.provisional;x-friends:="org.eclipse.cdt.dsf.gdb.ui",
org.eclipse.cdt.dsf.debug.internal.ui.disassembly.text;x-internal:=true, org.eclipse.cdt.dsf.debug.internal.ui.disassembly.text;x-internal:=true,
org.eclipse.cdt.dsf.debug.internal.ui.disassembly.util;x-internal:=true, org.eclipse.cdt.dsf.debug.internal.ui.disassembly.util;x-internal:=true,
org.eclipse.cdt.dsf.debug.internal.ui.preferences;x-internal:=true, org.eclipse.cdt.dsf.debug.internal.ui.preferences;x-friends:="org.eclipse.cdt.dsf.gdb.ui",
org.eclipse.cdt.dsf.debug.internal.ui.viewmodel;x-internal:=true, org.eclipse.cdt.dsf.debug.internal.ui.viewmodel;x-friends:="org.eclipse.cdt.dsf.gdb.ui",
org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.actions;x-friends:="org.eclipse.cdt.dsf.gdb.ui", org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.actions;x-friends:="org.eclipse.cdt.dsf.gdb.ui",
org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.detailsupport;x-internal:=true, org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.detailsupport;x-internal:=true,
org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.numberformat.detail;x-internal:=true, org.eclipse.cdt.dsf.debug.internal.ui.viewmodel.numberformat.detail;x-internal:=true,

View file

@ -54,13 +54,18 @@ public class EvaluationContextManager implements IWindowListener, IDebugContextL
@Override @Override
public void run() { public void run() {
if ( fgManager == null ) { if ( fgManager == null ) {
fgManager = new EvaluationContextManager(); // FindBugs reported that it is unsafe to set s_resources
// before we finish to initialize the object, because of
// multi-threading. This is why we use a temporary variable.
EvaluationContextManager manager = new EvaluationContextManager();
IWorkbench workbench = PlatformUI.getWorkbench(); IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows(); IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
for( int i = 0; i < windows.length; i++ ) { for( int i = 0; i < windows.length; i++ ) {
fgManager.windowOpened( windows[i] ); manager.windowOpened( windows[i] );
} }
workbench.addWindowListener( fgManager ); workbench.addWindowListener( manager );
fgManager = manager;
} }
} }
}; };

View file

@ -851,7 +851,7 @@ public class DisassemblyDocument extends REDDocument implements IDisassemblyDocu
if (positions != null) { if (positions != null) {
positions.removeAll(toRemove); positions.removeAll(toRemove);
} }
if (category != CATEGORY_MODEL) { if (!category.equals(CATEGORY_MODEL)) {
positions = (List<Position>) getDocumentManagedPositions().get(CATEGORY_MODEL); positions = (List<Position>) getDocumentManagedPositions().get(CATEGORY_MODEL);
if (positions != null) { if (positions != null) {
positions.removeAll(toRemove); positions.removeAll(toRemove);

View file

@ -117,7 +117,7 @@ public class REDRun implements CharSequence {
try { try {
return asString(); return asString();
} catch (IOException e) { } catch (IOException e) {
return null; return ""; //$NON-NLS-1$
} }
} }

View file

@ -788,7 +788,7 @@ public class NumberFormatDetailPane implements IDetailPane2, IAdaptable, IProper
* elements being displayed in this view * elements being displayed in this view
*/ */
protected void setDebugModel(String id) { protected void setDebugModel(String id) {
if (id != fDebugModelIdentifier) { if (!id.equals(fDebugModelIdentifier)) {
fDebugModelIdentifier = id; fDebugModelIdentifier = id;
configureDetailsViewer(); configureDetailsViewer();
} }

View file

@ -65,9 +65,10 @@ public class VMHandlerUtils {
IPartService partService = (IPartService)serviceLocator.getService(IPartService.class); IPartService partService = (IPartService)serviceLocator.getService(IPartService.class);
if (partService != null) { if (partService != null) {
part = partService.getActivePart(); part = partService.getActivePart();
}
return getVMProviderForPart(part); return getVMProviderForPart(part);
} }
return null;
}
} }
/** /**

View file

@ -152,7 +152,7 @@ public abstract class AbstractBreakpointVMNode extends AbstractVMNode {
return IModelDelta.EXPAND | IModelDelta.SELECT; return IModelDelta.EXPAND | IModelDelta.SELECT;
} }
} }
else if (event instanceof DebugContextEvent && (((DebugContextEvent)event).getFlags() | DebugContextEvent.ACTIVATED) != 0) { else if (event instanceof DebugContextEvent && (((DebugContextEvent)event).getFlags() & DebugContextEvent.ACTIVATED) != 0) {
int flags = IModelDelta.NO_CHANGE; int flags = IModelDelta.NO_CHANGE;
if ( Boolean.TRUE.equals(getVMProvider().getPresentationContext().getProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_FILTER_SELECTION)) ) { if ( Boolean.TRUE.equals(getVMProvider().getPresentationContext().getProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_FILTER_SELECTION)) ) {
flags |= IModelDelta.CONTENT; flags |= IModelDelta.CONTENT;
@ -203,7 +203,7 @@ public abstract class AbstractBreakpointVMNode extends AbstractVMNode {
} }
} }
} }
else if (event instanceof DebugContextEvent && (((DebugContextEvent)event).getFlags() | DebugContextEvent.ACTIVATED) != 0) { else if (event instanceof DebugContextEvent && (((DebugContextEvent)event).getFlags() & DebugContextEvent.ACTIVATED) != 0) {
if ( Boolean.TRUE.equals(getVMProvider().getPresentationContext().getProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_FILTER_SELECTION)) ) { if ( Boolean.TRUE.equals(getVMProvider().getPresentationContext().getProperty(IBreakpointUIConstants.PROP_BREAKPOINTS_FILTER_SELECTION)) ) {
parent.setFlags(parent.getFlags() | IModelDelta.CONTENT); parent.setFlags(parent.getFlags() | IModelDelta.CONTENT);
} }

View file

@ -114,7 +114,7 @@ abstract class DataCache<V> {
if (!isCanceled()) { if (!isCanceled()) {
fValid = true; fValid = true;
fRm = null; fRm = null;
set(getData(), getStatus()); set(super.getData(), super.getStatus());
} }
} }
}; };

View file

@ -729,9 +729,10 @@ public class SyncRegisterDataAccess {
IRegisterGroupDMContext.class); IRegisterGroupDMContext.class);
} }
if (dmc != null) {
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (dmc != null && session != null) { if (session != null) {
GetRegisterGroupDataQuery query = new GetRegisterGroupDataQuery(dmc); GetRegisterGroupDataQuery query = new GetRegisterGroupDataQuery(dmc);
session.getExecutor().execute(query); session.getExecutor().execute(query);
@ -741,6 +742,7 @@ public class SyncRegisterDataAccess {
} catch (ExecutionException e) { } catch (ExecutionException e) {
} }
} }
}
return null; return null;
} }
@ -762,9 +764,11 @@ public class SyncRegisterDataAccess {
if (element instanceof IDMVMContext) { if (element instanceof IDMVMContext) {
dmc = DMContexts.getAncestorOfType( ((IDMVMContext) element).getDMContext(), IRegisterDMContext.class ); dmc = DMContexts.getAncestorOfType( ((IDMVMContext) element).getDMContext(), IRegisterDMContext.class );
} }
if (dmc != null) {
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (dmc != null && session != null) { if (session != null) {
GetRegisterDataQuery query = new GetRegisterDataQuery(dmc); GetRegisterDataQuery query = new GetRegisterDataQuery(dmc);
session.getExecutor().execute(query); session.getExecutor().execute(query);
@ -774,6 +778,7 @@ public class SyncRegisterDataAccess {
} catch (ExecutionException e) { } catch (ExecutionException e) {
} }
} }
}
return null; return null;
} }
@ -794,9 +799,11 @@ public class SyncRegisterDataAccess {
if (element instanceof IDMVMContext) { if (element instanceof IDMVMContext) {
dmc = DMContexts.getAncestorOfType( ((IDMVMContext) element).getDMContext(), IBitFieldDMContext.class ); dmc = DMContexts.getAncestorOfType( ((IDMVMContext) element).getDMContext(), IBitFieldDMContext.class );
} }
if (dmc != null) {
DsfSession session = DsfSession.getSession(dmc.getSessionId()); DsfSession session = DsfSession.getSession(dmc.getSessionId());
if (dmc != null && session != null) { if (session != null) {
GetBitFieldQuery query = new GetBitFieldQuery(dmc); GetBitFieldQuery query = new GetBitFieldQuery(dmc);
session.getExecutor().execute(query); session.getExecutor().execute(query);
@ -806,6 +813,7 @@ public class SyncRegisterDataAccess {
} catch (ExecutionException e) { } catch (ExecutionException e) {
} }
} }
}
return null; return null;
} }

View file

@ -169,7 +169,7 @@ abstract public class AbstractDMVMNode extends AbstractVMNode implements IVMNode
if (element instanceof IDMVMContext) { if (element instanceof IDMVMContext) {
// If update element is a DMC, check if session is still alive. // If update element is a DMC, check if session is still alive.
IDMContext dmc = ((IDMVMContext)element).getDMContext(); IDMContext dmc = ((IDMVMContext)element).getDMContext();
if (dmc.getSessionId() != getSession().getId() || !DsfSession.isSessionActive(dmc.getSessionId())) { if (!dmc.getSessionId().equals(getSession().getId()) || !DsfSession.isSessionActive(dmc.getSessionId())) {
handleFailedUpdate(update); handleFailedUpdate(update);
return false; return false;
} }

View file

@ -473,9 +473,9 @@ public class DsfSession
if (o1.fListener == o2.fListener) { if (o1.fListener == o2.fListener) {
return 0; return 0;
} if (o1.fListener instanceof IDsfService && !(o2.fListener instanceof IDsfService)) { } if (o1.fListener instanceof IDsfService && !(o2.fListener instanceof IDsfService)) {
return Integer.MIN_VALUE; return -1;
} else if (o2.fListener instanceof IDsfService && !(o1.fListener instanceof IDsfService)) { } else if (o2.fListener instanceof IDsfService && !(o1.fListener instanceof IDsfService)) {
return Integer.MAX_VALUE; return 1;
} else if ( (o1.fListener instanceof IDsfService) && (o2.fListener instanceof IDsfService) ) { } else if ( (o1.fListener instanceof IDsfService) && (o2.fListener instanceof IDsfService) ) {
return ((IDsfService)o1.fListener).getStartupNumber() - ((IDsfService)o2.fListener).getStartupNumber(); return ((IDsfService)o1.fListener).getStartupNumber() - ((IDsfService)o2.fListener).getStartupNumber();
} }