mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 22:52:11 +02:00
Asynchronous resume, suspend and step operations. Cleanup.
This commit is contained in:
parent
75875e9870
commit
2295bd9473
14 changed files with 1259 additions and 1884 deletions
|
@ -1,3 +1,19 @@
|
|||
2004-07-16 Mikhail Khodjaiants
|
||||
Asynchronous resume, suspend and step operations. Cleanup.
|
||||
* CDebugModel.java
|
||||
* CDebugElementState.java
|
||||
* ICDebugElement.java
|
||||
* ICDebugTarget.java
|
||||
* ICThread.java: new
|
||||
* ICDebugTargetType: removed
|
||||
* IState: removed
|
||||
* CCoreFileDebugTarget.java
|
||||
* CDebugElement.java
|
||||
* CDebugTarget.java
|
||||
* CStackFrame.java
|
||||
* CThread.java
|
||||
* CModificationVariable.java
|
||||
|
||||
2004-07-15 Alain Magloire
|
||||
|
||||
org.eclipse.cdt.debug.core.cdi.model.type should
|
||||
|
|
|
@ -24,7 +24,6 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIObject;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugTargetType;
|
||||
import org.eclipse.cdt.debug.core.model.IFormattedMemoryBlock;
|
||||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||
import org.eclipse.cdt.debug.internal.core.model.CCoreFileDebugTarget;
|
||||
|
@ -112,7 +111,6 @@ public class CDebugModel
|
|||
public void run( IProgressMonitor m )
|
||||
{
|
||||
target[0] = new CDebugTarget( launch,
|
||||
ICDebugTargetType.TARGET_TYPE_LOCAL_RUN,
|
||||
cdiTarget,
|
||||
name,
|
||||
debuggeeProcess,
|
||||
|
@ -160,7 +158,6 @@ public class CDebugModel
|
|||
public void run( IProgressMonitor m )
|
||||
{
|
||||
target[0] = new CDebugTarget( launch,
|
||||
ICDebugTargetType.TARGET_TYPE_LOCAL_ATTACH,
|
||||
cdiTarget,
|
||||
name,
|
||||
null,
|
||||
|
|
|
@ -35,9 +35,6 @@ public class CDebugElementState {
|
|||
public static final CDebugElementState STEPPING = new CDebugElementState( "stepping" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState SUSPENDING = new CDebugElementState( "suspending" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState SUSPENDED = new CDebugElementState( "suspended" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState EVALUATING = new CDebugElementState( "evaluating" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState EVALUATED = new CDebugElementState( "evaluated" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState CHANGING = new CDebugElementState( "changing" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState CHANGED = new CDebugElementState( "changed" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState POSTMORTEM = new CDebugElementState( "postmortem" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState RESTARTING = new CDebugElementState( "restarting" ); //$NON-NLS-1$
|
||||
public static final CDebugElementState EXITED = new CDebugElementState( "exited" ); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -17,5 +17,18 @@ import org.eclipse.debug.core.model.IDebugElement;
|
|||
*/
|
||||
public interface ICDebugElement extends IDebugElement {
|
||||
|
||||
/**
|
||||
* Returns the current state of this element.
|
||||
*
|
||||
* @return the current state
|
||||
*/
|
||||
public CDebugElementState getState();
|
||||
|
||||
|
||||
/**
|
||||
* Returns the info object associated with the current state.
|
||||
*
|
||||
* @return the info object associated with the current state
|
||||
*/
|
||||
public Object getCurrentStateInfo();
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ import org.eclipse.debug.core.model.IDebugTarget;
|
|||
* C/C++ extension of <code>IDebugTarget</code>.
|
||||
*/
|
||||
public interface ICDebugTarget extends IDebugTarget,
|
||||
ICDebugTargetType,
|
||||
ICExpressionEvaluator,
|
||||
IExecFileInfo,
|
||||
IRestart,
|
||||
|
@ -26,7 +25,6 @@ public interface ICDebugTarget extends IDebugTarget,
|
|||
IJumpToLine,
|
||||
IJumpToAddress,
|
||||
IResumeWithoutSignal,
|
||||
IState,
|
||||
ISwitchToThread,
|
||||
ICDebugElement,
|
||||
IBreakpointTarget,
|
||||
|
@ -89,4 +87,11 @@ public interface ICDebugTarget extends IDebugTarget,
|
|||
* @throws DebugException if this method fails.
|
||||
*/
|
||||
public IDisassembly getDisassembly() throws DebugException;
|
||||
|
||||
/**
|
||||
* Returns whether this target is a post mortem type.
|
||||
*
|
||||
* @return whether this target is a post mortem type
|
||||
*/
|
||||
public boolean isPostMortem();
|
||||
}
|
||||
|
|
|
@ -1,32 +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.model;
|
||||
|
||||
/**
|
||||
*
|
||||
* Enter type comment.
|
||||
*
|
||||
* @since: Sep 30, 2002
|
||||
*/
|
||||
public interface ICDebugTargetType
|
||||
{
|
||||
public static final int TARGET_TYPE_UNKNOWN = 0;
|
||||
public static final int TARGET_TYPE_LOCAL_RUN = 1;
|
||||
public static final int TARGET_TYPE_LOCAL_ATTACH = 2;
|
||||
public static final int TARGET_TYPE_LOCAL_CORE_DUMP = 3;
|
||||
|
||||
/**
|
||||
* Returns the type of this target.
|
||||
*
|
||||
* @return the type of this target
|
||||
*/
|
||||
int getTargetType();
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
/**********************************************************************
|
||||
* Copyright (c) 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.model;
|
||||
|
||||
import org.eclipse.debug.core.model.IThread;
|
||||
|
||||
/**
|
||||
* C/C++ extension of <code>IThread</code>.
|
||||
*/
|
||||
public interface ICThread extends IThread, ICDebugElement {
|
||||
}
|
|
@ -1,48 +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.model;
|
||||
|
||||
/**
|
||||
*
|
||||
* Represents the current state of debug element.
|
||||
*
|
||||
* @since Aug 6, 2002
|
||||
*/
|
||||
public interface IState
|
||||
{
|
||||
public static final int UNKNOWN = 0;
|
||||
public static final int NOT_RESPONDING = 1;
|
||||
public static final int STARTING = 2;
|
||||
public static final int ATTACHING = 3;
|
||||
public static final int DISCONNECTING = 4;
|
||||
public static final int RUNNING = 5;
|
||||
public static final int STEPPING = 6;
|
||||
public static final int SUSPENDED = 7;
|
||||
public static final int EXITED = 8;
|
||||
public static final int DISCONNECTED = 9;
|
||||
public static final int TERMINATED = 10;
|
||||
public static final int CORE_DUMP_FILE = 11;
|
||||
|
||||
/**
|
||||
* Returns the identifier of the current state.
|
||||
*
|
||||
* @return the identifier of the current state
|
||||
*/
|
||||
int getCurrentStateId();
|
||||
|
||||
/**
|
||||
* Returns the info object associated with the current state.
|
||||
*
|
||||
* @return the info object associated with the current state
|
||||
*/
|
||||
Object getCurrentStateInfo();
|
||||
}
|
|
@ -8,54 +8,47 @@
|
|||
* Contributors:
|
||||
* QNX Software Systems - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.cdt.debug.internal.core.model;
|
||||
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugTargetType;
|
||||
import org.eclipse.cdt.debug.core.model.CDebugElementState;
|
||||
import org.eclipse.core.resources.IFile;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.ILaunch;
|
||||
import org.eclipse.debug.core.model.IProcess;
|
||||
|
||||
/**
|
||||
* Enter type comment.
|
||||
*
|
||||
* @since Aug 20, 2003
|
||||
* A debug target for the postmortem debugging.
|
||||
*/
|
||||
public class CCoreFileDebugTarget extends CDebugTarget
|
||||
{
|
||||
public CCoreFileDebugTarget( ILaunch launch,
|
||||
ICDITarget cdiTarget,
|
||||
String name,
|
||||
IProcess debuggerProcess,
|
||||
IFile file )
|
||||
{
|
||||
super( launch,
|
||||
ICDebugTargetType.TARGET_TYPE_LOCAL_CORE_DUMP,
|
||||
cdiTarget,
|
||||
name,
|
||||
null,
|
||||
debuggerProcess,
|
||||
file,
|
||||
true,
|
||||
false );
|
||||
public class CCoreFileDebugTarget extends CDebugTarget {
|
||||
|
||||
public CCoreFileDebugTarget( ILaunch launch, ICDITarget cdiTarget, String name, IProcess debuggerProcess, IFile file ) {
|
||||
super( launch, cdiTarget, name, null, debuggerProcess, file, true, false );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.debug.core.model.ITerminate#canTerminate()
|
||||
*/
|
||||
public boolean canTerminate()
|
||||
{
|
||||
return !isTerminated();
|
||||
public boolean canTerminate() {
|
||||
return !isTerminated() || !isTerminating();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.debug.core.model.ITerminate#terminate()
|
||||
*/
|
||||
public void terminate() throws DebugException {
|
||||
setState( CDebugElementState.TERMINATING );
|
||||
terminated();
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.debug.core.model.ITerminate#terminate()
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugTarget#isPostMortem()
|
||||
*/
|
||||
public void terminate() throws DebugException
|
||||
{
|
||||
setTerminating( true );
|
||||
terminated();
|
||||
public boolean isPostMortem() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,11 @@ abstract public class CDebugElement extends PlatformObject implements ICDebugEle
|
|||
*/
|
||||
private CDebugElementState fState = CDebugElementState.UNDEFINED;
|
||||
|
||||
/**
|
||||
* The current state info.
|
||||
*/
|
||||
private Object fCurrentStateInfo = null;
|
||||
|
||||
/**
|
||||
* Constructor for CDebugElement.
|
||||
*/
|
||||
|
@ -341,4 +346,15 @@ abstract public class CDebugElement extends PlatformObject implements ICDebugEle
|
|||
}
|
||||
fState = state;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugElement#getCurrentStateInfo()
|
||||
*/
|
||||
public Object getCurrentStateInfo() {
|
||||
return fCurrentStateInfo;
|
||||
}
|
||||
|
||||
protected void setCurrentStateInfo( Object currentStateInfo ) {
|
||||
fCurrentStateInfo = currentStateInfo;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -15,6 +15,7 @@ import org.eclipse.cdt.debug.core.cdi.CDIException;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.ICDIValue;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariable;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIVariableObject;
|
||||
import org.eclipse.cdt.debug.core.model.CDebugElementState;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
import org.eclipse.debug.core.model.IValue;
|
||||
import org.eclipse.debug.core.model.IValueModification;
|
||||
|
@ -43,7 +44,7 @@ public class CModificationVariable extends CVariable
|
|||
public boolean supportsValueModification()
|
||||
{
|
||||
CDebugTarget target = (CDebugTarget)getDebugTarget().getAdapter( CDebugTarget.class );
|
||||
return ( target != null && !target.isCoreDumpTarget() && isEditable() );
|
||||
return ( target != null && CDebugElementState.SUSPENDED.equals( target.getState() ) && isEditable() );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -730,4 +730,16 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
|
|||
}
|
||||
return new ICGlobalVariable[0];
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
try {
|
||||
return getName();
|
||||
}
|
||||
catch( DebugException e ) {
|
||||
return e.getLocalizedMessage();
|
||||
}
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue