mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
Renamed "ICDebugElementErrorStatus" to "ICDebugElementStatus".
Added comments to ICDebugElementStatus.java.
This commit is contained in:
parent
d01737efb7
commit
1a63f5490c
8 changed files with 94 additions and 50 deletions
|
@ -1,3 +1,13 @@
|
|||
2004-07-09 Mikhail Khodjaiants
|
||||
Renamed "ICDebugElementErrorStatus" to "ICDebugElementStatus".
|
||||
Added comments to ICDebugElementStatus.java.
|
||||
* ICDebugElementStatus.java
|
||||
* CDebugElement.java
|
||||
* CDebugTarget.java
|
||||
* CThread.java
|
||||
* CValue.java
|
||||
* CVariable.java
|
||||
|
||||
2004-07-02 Alain Magloire
|
||||
|
||||
Move the CDI interface to its own source browser and library
|
||||
|
|
|
@ -1,30 +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 status of a debug element.
|
||||
*
|
||||
* @since May 2, 2003
|
||||
*/
|
||||
public interface ICDebugElementErrorStatus
|
||||
{
|
||||
public static final int OK = 0;
|
||||
public static final int WARNING = 1;
|
||||
public static final int ERROR = 2;
|
||||
|
||||
boolean isOK();
|
||||
|
||||
int getSeverity();
|
||||
|
||||
String getMessage();
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
/*******************************************************************************
|
||||
* 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 status of a C/C++ debug model element.
|
||||
*/
|
||||
public interface ICDebugElementStatus {
|
||||
|
||||
/**
|
||||
* Status severity constant (value 0) indicating this status represents
|
||||
* the nominal case.
|
||||
*/
|
||||
public static final int OK = 0;
|
||||
|
||||
/**
|
||||
* Status severity constant (value 1) indicating indicating this status
|
||||
* represents a warning.
|
||||
*/
|
||||
public static final int WARNING = 1;
|
||||
|
||||
/**
|
||||
* Status severity constant (value 2) indicating indicating this status
|
||||
* represents an error.
|
||||
*/
|
||||
public static final int ERROR = 2;
|
||||
|
||||
/**
|
||||
* Returns whether this status indicates everything is okay
|
||||
* (neither warning, nor error).
|
||||
*
|
||||
* @return <code>true</code> if this status has severity
|
||||
* <code>OK</code>, and <code>false</code> otherwise
|
||||
*/
|
||||
boolean isOK();
|
||||
|
||||
/**
|
||||
* Returns the severity. The severities are as follows (in descending order):
|
||||
* <ul>
|
||||
* <li><code>ERROR</code> - an error</li>
|
||||
* <li><code>WARNING</code> - a warning</li>
|
||||
* <li><code>OK</code> - everything is just fine</li>
|
||||
* </ul>
|
||||
*
|
||||
* @return the severity: one of <code>OK</code>, <code>ERROR</code>,
|
||||
* or <code>WARNING</code>
|
||||
*/
|
||||
int getSeverity();
|
||||
|
||||
/**
|
||||
* Returns the message describing the outcome.
|
||||
*
|
||||
* @return a message
|
||||
*/
|
||||
String getMessage();
|
||||
}
|
|
@ -20,7 +20,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDISession;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||
import org.eclipse.cdt.debug.core.model.CDebugElementState;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElement;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
||||
import org.eclipse.cdt.debug.internal.core.ICDebugInternalConstants;
|
||||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.PlatformObject;
|
||||
|
@ -39,11 +39,11 @@ import org.eclipse.debug.core.model.IDebugTarget;
|
|||
*/
|
||||
public class CDebugElement extends PlatformObject
|
||||
implements ICDebugElement,
|
||||
ICDebugElementErrorStatus
|
||||
ICDebugElementStatus
|
||||
{
|
||||
private CDebugTarget fDebugTarget;
|
||||
|
||||
private int fSeverity = ICDebugElementErrorStatus.OK;
|
||||
private int fSeverity = ICDebugElementStatus.OK;
|
||||
private String fMessage = null;
|
||||
|
||||
/**
|
||||
|
@ -337,20 +337,20 @@ public class CDebugElement extends PlatformObject
|
|||
|
||||
protected void resetStatus()
|
||||
{
|
||||
fSeverity = ICDebugElementErrorStatus.OK;
|
||||
fSeverity = ICDebugElementStatus.OK;
|
||||
fMessage = null;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus#isOK()
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugElementStatus#isOK()
|
||||
*/
|
||||
public boolean isOK()
|
||||
{
|
||||
return ( fSeverity == ICDebugElementErrorStatus.OK );
|
||||
return ( fSeverity == ICDebugElementStatus.OK );
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus#getSeverity()
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugElementStatus#getSeverity()
|
||||
*/
|
||||
public int getSeverity()
|
||||
{
|
||||
|
@ -358,7 +358,7 @@ public class CDebugElement extends PlatformObject
|
|||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus#getMessage()
|
||||
* @see org.eclipse.cdt.debug.core.model.ICDebugElementStatus#getMessage()
|
||||
*/
|
||||
public String getMessage()
|
||||
{
|
||||
|
|
|
@ -62,7 +62,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
|||
import org.eclipse.cdt.debug.core.model.IBreakpointTarget;
|
||||
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugTargetType;
|
||||
import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator;
|
||||
|
@ -1549,7 +1549,7 @@ public class CDebugTarget extends CDebugElement
|
|||
|
||||
private void handleErrorInfo( ICDIErrorInfo info )
|
||||
{
|
||||
setStatus( ICDebugElementErrorStatus.ERROR, ( info != null ) ? info.getMessage() : null );
|
||||
setStatus( ICDebugElementStatus.ERROR, ( info != null ) ? info.getMessage() : null );
|
||||
if ( info != null )
|
||||
{
|
||||
MultiStatus status = new MultiStatus( CDebugCorePlugin.getUniqueIdentifier(),
|
||||
|
|
|
@ -34,7 +34,7 @@ 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.ICDITarget;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIThread;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
||||
import org.eclipse.cdt.debug.core.model.IDummyStackFrame;
|
||||
import org.eclipse.cdt.debug.core.model.IRestart;
|
||||
import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal;
|
||||
|
@ -154,7 +154,7 @@ public class CThread extends CDebugElement
|
|||
}
|
||||
catch( DebugException e )
|
||||
{
|
||||
setStatus( ICDebugElementErrorStatus.ERROR, e.getStatus().getMessage() );
|
||||
setStatus( ICDebugElementStatus.ERROR, e.getStatus().getMessage() );
|
||||
throw e;
|
||||
}
|
||||
return (IStackFrame[])list.toArray( new IStackFrame[list.size()] );
|
||||
|
@ -277,7 +277,7 @@ public class CThread extends CDebugElement
|
|||
}
|
||||
catch( CDIException e )
|
||||
{
|
||||
setStatus( ICDebugElementErrorStatus.WARNING, MessageFormat.format( CoreModelMessages.getString( "CThread.0" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||
setStatus( ICDebugElementStatus.WARNING, MessageFormat.format( CoreModelMessages.getString( "CThread.0" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||
targetRequestFailed( e.getMessage(), null );
|
||||
}
|
||||
return new ICDIStackFrame[0];
|
||||
|
@ -1050,7 +1050,7 @@ public class CThread extends CDebugElement
|
|||
}
|
||||
catch( CDIException e )
|
||||
{
|
||||
setStatus( ICDebugElementErrorStatus.WARNING, MessageFormat.format( CoreModelMessages.getString( "CThread.1" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||
setStatus( ICDebugElementStatus.WARNING, MessageFormat.format( CoreModelMessages.getString( "CThread.1" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||
}
|
||||
return depth;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import org.eclipse.cdt.debug.core.cdi.model.type.ICDIPointerValue;
|
|||
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIReferenceValue;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIShortValue;
|
||||
import org.eclipse.cdt.debug.core.cdi.model.type.ICDIWCharValue;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICExpressionEvaluator;
|
||||
import org.eclipse.cdt.debug.core.model.ICValue;
|
||||
import org.eclipse.debug.core.DebugException;
|
||||
|
@ -141,7 +141,7 @@ public class CValue extends CDebugElement implements ICValue
|
|||
{
|
||||
fVariables = new ArrayList( 1 );
|
||||
CModificationVariable var = new CModificationVariable( this, new CVariable.ErrorVariable( null, e ) );
|
||||
var.setStatus( ICDebugElementErrorStatus.ERROR, e.getMessage() );
|
||||
var.setStatus( ICDebugElementStatus.ERROR, e.getMessage() );
|
||||
fVariables.add( var );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ 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.cdi.model.type.ICDIType;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementErrorStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICDebugElementStatus;
|
||||
import org.eclipse.cdt.debug.core.model.ICType;
|
||||
import org.eclipse.cdt.debug.core.model.ICValue;
|
||||
import org.eclipse.cdt.debug.core.model.ICVariable;
|
||||
|
@ -211,7 +211,7 @@ public abstract class CVariable extends CDebugElement
|
|||
catch( CDIException e )
|
||||
{
|
||||
fCDIVariable = new ErrorVariable( getCDIVariableObject(), e );
|
||||
setStatus( ICDebugElementErrorStatus.ERROR, MessageFormat.format( CoreModelMessages.getString( "CVariable.0" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||
setStatus( ICDebugElementStatus.ERROR, MessageFormat.format( CoreModelMessages.getString( "CVariable.0" ), new String[] { e.getMessage() } ) ); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
return fCDIVariable;
|
||||
|
@ -419,7 +419,7 @@ public abstract class CVariable extends CDebugElement
|
|||
fOriginal = createOriginal( cdiVariableObject );
|
||||
fShadow = null;
|
||||
if ( cdiVariableObject instanceof ErrorVariable )
|
||||
setStatus( ICDebugElementErrorStatus.ERROR,
|
||||
setStatus( ICDebugElementStatus.ERROR,
|
||||
MessageFormat.format( CoreModelMessages.getString( "CVariable.1" ), new String[] { ((ErrorVariable)cdiVariableObject).getException().getMessage() } ) ); //$NON-NLS-1$
|
||||
fFormat = CDebugCorePlugin.getDefault().getPluginPreferences().getInt( ICDebugConstants.PREF_DEFAULT_VARIABLE_FORMAT );
|
||||
getCDISession().getEventManager().addEventListener( this );
|
||||
|
@ -631,7 +631,7 @@ public abstract class CVariable extends CDebugElement
|
|||
if ( getCDIVariable() instanceof ErrorVariable )
|
||||
{
|
||||
getInternalVariable().invalidate();
|
||||
setStatus( ICDebugElementErrorStatus.OK, null );
|
||||
setStatus( ICDebugElementStatus.OK, null );
|
||||
}
|
||||
}
|
||||
catch( CDIException e )
|
||||
|
|
Loading…
Add table
Reference in a new issue