1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

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
This commit is contained in:
Alain Magloire 2004-11-02 19:29:58 +00:00
parent c1db45f6f6
commit 5ce890bd56
9 changed files with 177 additions and 136 deletions

View file

@ -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 2004-11-1 David Inglis
Fixed bogus exception with older CDI debuggers. Fixed bogus exception with older CDI debuggers.

View file

@ -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();
}

View file

@ -57,7 +57,7 @@ public interface ICDISession {
* *
* @return the configuration description * @return the configuration description
*/ */
ICDIConfiguration getConfiguration(); ICDISessionConfiguration getConfiguration();
/** /**
* Causes this element to terminate, generating a <code>KIND_TERMINATE</code> event. * Causes this element to terminate, generating a <code>KIND_TERMINATE</code> event.

View file

@ -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();
}

View file

@ -36,6 +36,13 @@ public interface ICDITarget extends ICDIThreadGroup, ICDIExpressionManagement,
*/ */
Process getProcess(); Process getProcess();
/**
* Returns the configuration description of this debug session.
*
* @return the configuration description
*/
ICDITargetConfiguration getConfiguration();
/** /**
* Evaluates the expression specified by the given string. * Evaluates the expression specified by the given string.
* Returns the evaluation result as a String. * Returns the evaluation result as a String.

View file

@ -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();
}

View file

@ -19,9 +19,9 @@ import org.eclipse.cdt.core.IBinaryParser;
import org.eclipse.cdt.core.ICExtensionReference; import org.eclipse.cdt.core.ICExtensionReference;
import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable; import org.eclipse.cdt.core.IBinaryParser.IBinaryExecutable;
import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; 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.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; 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.ICAddressBreakpoint;
import org.eclipse.cdt.debug.core.model.ICBreakpoint; import org.eclipse.cdt.debug.core.model.ICBreakpoint;
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint; import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
@ -90,7 +90,7 @@ public class CDIDebugModel {
public void run( IProgressMonitor m ) throws CoreException { public void run( IProgressMonitor m ) throws CoreException {
boolean stop = launch.getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false ); boolean stop = launch.getLaunchConfiguration().getAttribute( ICDTLaunchConfigurationConstants.ATTR_DEBUGGER_STOP_AT_MAIN, false );
target[0] = new CDebugTarget( launch, project, cdiTarget, name, debuggeeProcess, file, allowTerminate, allowDisconnect ); 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 ) { if ( config.supportsBreakpoints() && stop ) {
stopInMain( (CDebugTarget)target[0] ); stopInMain( (CDebugTarget)target[0] );
} }

View file

@ -33,11 +33,11 @@ import org.eclipse.cdt.debug.core.ICSharedLibraryManager;
import org.eclipse.cdt.debug.core.ICSignalManager; import org.eclipse.cdt.debug.core.ICSignalManager;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; 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.ICDIEndSteppingRange;
import org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo; import org.eclipse.cdt.debug.core.cdi.ICDIErrorInfo;
import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.ICDISession; 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.ICDISessionObject;
import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent; import org.eclipse.cdt.debug.core.cdi.ICDISharedLibraryEvent;
import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; 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.ICDISharedLibrary;
import org.eclipse.cdt.debug.core.cdi.model.ICDISignal; 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.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.ICDIThread;
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor; import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableDescriptor;
import org.eclipse.cdt.debug.core.model.CDebugElementState; 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 * The debug configuration of this session
*/ */
private ICDIConfiguration fConfig; private ICDITargetConfiguration fConfig;
/** /**
* The memory manager for this target. * The memory manager for this target.
@ -232,7 +233,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
setCDITarget( cdiTarget ); setCDITarget( cdiTarget );
setState( CDebugElementState.SUSPENDED ); setState( CDebugElementState.SUSPENDED );
initializePreferences(); initializePreferences();
setConfiguration( cdiTarget.getSession().getConfiguration() ); setConfiguration( cdiTarget.getConfiguration() );
setThreadList( new ArrayList( 5 ) ); setThreadList( new ArrayList( 5 ) );
createDisassembly(); createDisassembly();
setSharedLibraryManager( new CSharedLibraryManager( this ) ); setSharedLibraryManager( new CSharedLibraryManager( this ) );
@ -1216,7 +1217,8 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
setState( CDebugElementState.EXITED ); setState( CDebugElementState.EXITED );
setCurrentStateInfo( event.getReason() ); setCurrentStateInfo( event.getReason() );
fireChangeEvent( DebugEvent.CONTENT ); fireChangeEvent( DebugEvent.CONTENT );
if ( getConfiguration().terminateSessionOnExit() ) ICDISessionConfiguration sessionConfig = getCDISession().getConfiguration();
if ( sessionConfig != null && sessionConfig.terminateSessionOnExit() )
terminated(); terminated();
} }
@ -1283,7 +1285,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
* *
* @return the debug configuration of this target * @return the debug configuration of this target
*/ */
protected ICDIConfiguration getConfiguration() { protected ICDITargetConfiguration getConfiguration() {
return fConfig; return fConfig;
} }
@ -1292,7 +1294,7 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
* *
* @param config the debug configuration to set * @param config the debug configuration to set
*/ */
private void setConfiguration( ICDIConfiguration config ) { private void setConfiguration( ICDITargetConfiguration config ) {
fConfig = config; fConfig = config;
} }

View file

@ -19,7 +19,6 @@ import org.eclipse.cdt.debug.core.CDebugModel;
import org.eclipse.cdt.debug.core.CDebugUtils; import org.eclipse.cdt.debug.core.CDebugUtils;
import org.eclipse.cdt.debug.core.cdi.CDIException; import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit; 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.ICDIEndSteppingRange;
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject; import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived; 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.ICDIBreakpoint;
import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; 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.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.cdi.model.ICDIThread;
import org.eclipse.cdt.debug.core.model.CDebugElementState; import org.eclipse.cdt.debug.core.model.CDebugElementState;
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus; 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. * The debug configuration of this session.
*/ */
private ICDIConfiguration fConfig; private ICDITargetConfiguration fConfig;
/** /**
* Whether this thread is current. * Whether this thread is current.
@ -104,7 +104,7 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
super( target ); super( target );
setState( cdiThread.isSuspended() ? CDebugElementState.SUSPENDED : CDebugElementState.RESUMED ); setState( cdiThread.isSuspended() ? CDebugElementState.SUSPENDED : CDebugElementState.RESUMED );
setCDIThread( cdiThread ); setCDIThread( cdiThread );
fConfig = getCDISession().getConfiguration(); fConfig = getCDITarget().getConfiguration();
initialize(); initialize();
getCDISession().getEventManager().addEventListener( this ); getCDISession().getEventManager().addEventListener( this );
} }