diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index b610e60d270..49772138dd5 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -1,3 +1,14 @@ +2004-11-02 Alain Magloire + Refactor ICDIConfiguratio --> ICDISessionConfiguration and ICDITargetConfiguration + * cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java + * cdi/org/eclipse/cdt/debug/core/cdi/ICDISessionConfiguration.java + * cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java + * cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITargetConfiguration.java + + * src/org/eclipse/cdt/debug/core/CDIDebugModel.java + * src/org/eclipse/cdt/debug/interternal/core/model/CDIDebugTarget.java + * src/org/eclipse/cdt/debug/interternal/core/model/CThread.java + 2004-11-1 David Inglis Fixed bogus exception with older CDI debuggers. diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java deleted file mode 100644 index d616bc9c056..00000000000 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDIConfiguration.java +++ /dev/null @@ -1,124 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2000, 2004 QNX Software Systems and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v10.html - * - * Contributors: - * QNX Software Systems - Initial API and implementation - *******************************************************************************/ - -package org.eclipse.cdt.debug.core.cdi; - -/** - * Describes the configuration of debug session. - * - * @since Aug 6, 2002 - */ -public interface ICDIConfiguration { - /** - * Returns whether this session supports termination. - * - * @return whether this session supports termination - */ - boolean supportsTerminate(); - - /** - * Returns whether this session supports disconnecting. - * - * @return whether this session supports disconnecting - */ - boolean supportsDisconnect(); - - /** - * Returns whether this session supports suspend. - * - * @return whether this session supports suspend. - */ - boolean supportsSuspend(); - - /** - * Returns whether this session supports Resume. - * - * @return whether this session supports Resume. - */ - boolean supportsResume(); - - /** - * Returns whether this session supports restarting. - * - * @return whether this session supports restarting - */ - boolean supportsRestart(); - - /** - * Returns whether this session supports stepping. - * - * @return whether this session supports stepping - */ - boolean supportsStepping(); - - /** - * Returns whether this session supports instruction stepping. - * - * @return whether this session supports instruction stepping - */ - boolean supportsInstructionStepping(); - - /** - * Returns whether this session supports breakpoints. - * - * @return whether this session supports breakpoints - */ - boolean supportsBreakpoints(); - - /** - * Returns whether this session supports registers. - * - * @return whether this session supports registers - */ - boolean supportsRegisters(); - - /** - * Returns whether this session supports register modification. - * - * @return whether this session supports registers modification - */ - boolean supportsRegisterModification(); - - /** - * Returns whether this session supports shared library. - * - * @return whether this session supports registers modification - */ - boolean supportsSharedLibrary(); - - /** - * Returns whether this session supports memory retrieval. - * - * @return whether this session supports memory retrieval - */ - boolean supportsMemoryRetrieval(); - - /** - * Returns whether this session supports memory modification. - * - * @return whether this session supports memory modification - */ - boolean supportsMemoryModification(); - - /** - * Returns whether this session supports expression evaluation. - * - * @return whether this session supports expression evaluation - */ - boolean supportsExpressionEvaluation(); - - /** - * Returns whether the session should be terminated when the inferior exits. - * - * @return whether the session be terminated when the inferior exits - */ - boolean terminateSessionOnExit(); -} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java index 94ca9a7187c..89a3ce659d3 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISession.java @@ -57,7 +57,7 @@ public interface ICDISession { * * @return the configuration description */ - ICDIConfiguration getConfiguration(); + ICDISessionConfiguration getConfiguration(); /** * Causes this element to terminate, generating a KIND_TERMINATE event. diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISessionConfiguration.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISessionConfiguration.java new file mode 100644 index 00000000000..a53469193d3 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/ICDISessionConfiguration.java @@ -0,0 +1,27 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi; + +/** + * Describes the configuration of debug session. + * + * @since Aug 6, 2002 + */ +public interface ICDISessionConfiguration extends ICDISessionObject { + + /** + * Returns whether the session should be terminated when the inferior exits. + * + * @return whether the session be terminated when the inferior exits + */ + boolean terminateSessionOnExit(); +} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java index 71c7141d744..2545abded2f 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget.java @@ -36,6 +36,13 @@ public interface ICDITarget extends ICDIThreadGroup, ICDIExpressionManagement, */ Process getProcess(); + /** + * Returns the configuration description of this debug session. + * + * @return the configuration description + */ + ICDITargetConfiguration getConfiguration(); + /** * Evaluates the expression specified by the given string. * Returns the evaluation result as a String. diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITargetConfiguration.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITargetConfiguration.java new file mode 100644 index 00000000000..b019dda44fc --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITargetConfiguration.java @@ -0,0 +1,118 @@ +/******************************************************************************* + * Copyright (c) 2000, 2004 QNX Software Systems and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Common Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/cpl-v10.html + * + * Contributors: + * QNX Software Systems - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +/** + * Describes the configuration of the target. + * + */ +public interface ICDITargetConfiguration extends ICDIObject { + + /** + * Returns whether this target supports termination. + * + * @return whether this target supports termination + */ + boolean supportsTerminate(); + + /** + * Returns whether this target supports disconnecting. + * + * @return whether this target supports disconnecting + */ + boolean supportsDisconnect(); + + /** + * Returns whether this target supports suspend. + * + * @return whether this target supports suspend. + */ + boolean supportsSuspend(); + + /** + * Returns whether this target supports Resume. + * + * @return whether this target supports Resume. + */ + boolean supportsResume(); + + /** + * Returns whether this target supports restarting. + * + * @return whether this target supports restarting + */ + boolean supportsRestart(); + + /** + * Returns whether this target supports stepping. + * + * @return whether this target supports stepping + */ + boolean supportsStepping(); + + /** + * Returns whether this target supports instruction stepping. + * + * @return whether this target supports instruction stepping + */ + boolean supportsInstructionStepping(); + + /** + * Returns whether this target supports breakpoints. + * + * @return whether this target supports breakpoints + */ + boolean supportsBreakpoints(); + + /** + * Returns whether this target supports registers. + * + * @return whether this target supports registers + */ + boolean supportsRegisters(); + + /** + * Returns whether this target supports register modification. + * + * @return whether this target supports registers modification + */ + boolean supportsRegisterModification(); + + /** + * Returns whether this target supports shared library. + * + * @return whether this target supports registers modification + */ + boolean supportsSharedLibrary(); + + /** + * Returns whether this target supports memory retrieval. + * + * @return whether this target supports memory retrieval + */ + boolean supportsMemoryRetrieval(); + + /** + * Returns whether this target supports memory modification. + * + * @return whether this target supports memory modification + */ + boolean supportsMemoryModification(); + + /** + * Returns whether this target supports expression evaluation. + * + * @return whether this target supports expression evaluation + */ + boolean supportsExpressionEvaluation(); + +} diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java index aa523e6b200..42d34c0c433 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDIDebugModel.java @@ -19,9 +19,9 @@ import org.eclipse.cdt.core.IBinaryParser; import org.eclipse.cdt.core.ICExtensionReference; import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; +import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration; import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint; import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; @@ -90,7 +90,7 @@ public class CDIDebugModel { public void run( IProgressMonitor m ) throws CoreException { boolean stop = launch.getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false ); target[0] = new CDebugTarget( launch, project, cdiTarget, name, debuggeeProcess, file, allowTerminate, allowDisconnect ); - ICDIConfiguration config = cdiTarget.getSession().getConfiguration(); + ICDITargetConfiguration config = cdiTarget.getConfiguration(); if ( config.supportsBreakpoints() && stop ) { stopInMain( (CDebugTarget)target[0] ); } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index 440c9057c57..e999e0bb901 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -33,11 +33,11 @@ import org.eclipse.cdt.debug.core.ICSharedLibraryManager; import org.eclipse.cdt.debug.core.ICSignalManager; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange; import org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo; import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.ICDISession; +import org.eclipse.cdt.debug.core.cdi.ICDISessionConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent; import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; @@ -58,6 +58,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; +import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration; import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor; import org.eclipse.cdt.debug.core.model.CDebugElementState; @@ -154,7 +155,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv /** * The debug configuration of this session */ - private ICDIConfiguration fConfig; + private ICDITargetConfiguration fConfig; /** * The memory manager for this target. @@ -232,7 +233,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv setCDITarget( cdiTarget ); setState( CDebugElementState.SUSPENDED ); initializePreferences(); - setConfiguration( cdiTarget.getSession().getConfiguration() ); + setConfiguration( cdiTarget.getConfiguration() ); setThreadList( new ArrayList( 5 ) ); createDisassembly(); setSharedLibraryManager( new CSharedLibraryManager( this ) ); @@ -1216,7 +1217,8 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv setState( CDebugElementState.EXITED ); setCurrentStateInfo( event.getReason() ); fireChangeEvent( DebugEvent.CONTENT ); - if ( getConfiguration().terminateSessionOnExit() ) + ICDISessionConfiguration sessionConfig = getCDISession().getConfiguration(); + if ( sessionConfig != null && sessionConfig.terminateSessionOnExit() ) terminated(); } @@ -1283,7 +1285,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv * * @return the debug configuration of this target */ - protected ICDIConfiguration getConfiguration() { + protected ICDITargetConfiguration getConfiguration() { return fConfig; } @@ -1292,7 +1294,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv * * @param config the debug configuration to set */ - private void setConfiguration( ICDIConfiguration config ) { + private void setConfiguration( ICDITargetConfiguration config ) { fConfig = config; } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java index f6ed3d919fd..5d7b46320ba 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java @@ -19,7 +19,6 @@ import org.eclipse.cdt.debug.core.CDebugModel; import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; -import org.eclipse.cdt.debug.core.cdi.ICDIConfiguration; import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange; import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; @@ -34,6 +33,7 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDIStackFrame; +import org.eclipse.cdt.debug.core.cdi.model.ICDITargetConfiguration; import org.eclipse.cdt.debug.core.cdi.model.ICDIThread; import org.eclipse.cdt.debug.core.model.CDebugElementState; import org.eclipse.cdt.debug.core.model.ICDebugElementStatus; @@ -80,7 +80,7 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum /** * The debug configuration of this session. */ - private ICDIConfiguration fConfig; + private ICDITargetConfiguration fConfig; /** * Whether this thread is current. @@ -104,7 +104,7 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum super( target ); setState( cdiThread.isSuspended() ? CDebugElementState.SUSPENDED : CDebugElementState.RESUMED ); setCDIThread( cdiThread ); - fConfig = getCDISession().getConfiguration(); + fConfig = getCDITarget().getConfiguration(); initialize(); getCDISession().getEventManager().addEventListener( this ); }