org.eclipse.cdt.debug.internal.core.model
Class CDebugElement

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.cdt.debug.internal.core.model.CDebugElement
All Implemented Interfaces:
ICDebugElement, ICDebugElementStatus, org.eclipse.core.runtime.IAdaptable, org.eclipse.debug.core.model.IDebugElement
Direct Known Subclasses:
AbstractCValue, AbstractCVariable, CDebugTarget, CDummyStackFrame, CMemoryBlockExtension, CModule, CRegisterGroup, CSignal, CStackFrame, CThread, Disassembly

public abstract class CDebugElement
extends org.eclipse.core.runtime.PlatformObject
implements ICDebugElement, ICDebugElementStatus

The super class of all C/C++ debug model elements.


Field Summary
 
Fields inherited from interface org.eclipse.cdt.debug.core.model.ICDebugElementStatus
ERROR, OK, WARNING
 
Constructor Summary
CDebugElement(CDebugTarget target)
          Constructor for CDebugElement.
 
Method Summary
 org.eclipse.debug.core.DebugEvent createChangeEvent(int detail)
           
 org.eclipse.debug.core.DebugEvent createCreateEvent()
           
 org.eclipse.debug.core.DebugEvent createResumeEvent(int detail)
           
 org.eclipse.debug.core.DebugEvent createSuspendEvent(int detail)
           
 org.eclipse.debug.core.DebugEvent createTerminateEvent()
           
 void fireChangeEvent(int detail)
          Fires a debug event marking the CHANGE of this element with the specifed detail code.
 void fireCreationEvent()
          Fires a debug event marking the creation of this element.
 void fireResumeEvent(int detail)
          Fires a debug event marking the RESUME of this element with the associated detail.
 void fireSuspendEvent(int detail)
          Fires a debug event marking the SUSPEND of this element with the associated detail.
 void fireTerminateEvent()
          Fires a debug event marking the termination of this element.
 java.lang.Object getAdapter(java.lang.Class adapter)
           
 org.eclipse.cdt.debug.core.cdi.ICDISession getCDISession()
          Returns the CDI session associated with this element.
 org.eclipse.cdt.debug.core.cdi.model.ICDITarget getCDITarget()
          Returns the underlying CDI target associated with this element.
 java.lang.Object getCurrentStateInfo()
          Returns the info object associated with the current state.
 org.eclipse.debug.core.model.IDebugTarget getDebugTarget()
           
 org.eclipse.debug.core.ILaunch getLaunch()
           
 java.lang.String getMessage()
          Returns the message describing the outcome.
 java.lang.String getModelIdentifier()
           
 int getSeverity()
          Returns the severity.
 CDebugElementState getState()
          Returns the current state of this element.
 boolean isOK()
          Returns whether this status indicates everything is okay (neither warning, nor error).
static void notSupported(java.lang.String message)
          Throws a new debug exception with a status code of NOT_SUPPORTED.
static void requestFailed(java.lang.String message, java.lang.Exception e)
          Throws a new debug exception with a status code of REQUEST_FAILED.
static void requestFailed(java.lang.String message, java.lang.Throwable e, int code)
          Throws a new debug exception with the given status code.
static void targetRequestFailed(java.lang.String message, org.eclipse.cdt.debug.core.cdi.CDIException e)
          Throws a new debug exception with a status code of TARGET_REQUEST_FAILED with the given underlying exception.
static void targetRequestFailed(java.lang.String message, java.lang.Throwable e)
          Throws a new debug exception with a status code of TARGET_REQUEST_FAILED.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDebugElement

public CDebugElement(CDebugTarget target)
Constructor for CDebugElement.

Method Detail

getModelIdentifier

public java.lang.String getModelIdentifier()
Specified by:
getModelIdentifier in interface org.eclipse.debug.core.model.IDebugElement

getDebugTarget

public org.eclipse.debug.core.model.IDebugTarget getDebugTarget()
Specified by:
getDebugTarget in interface org.eclipse.debug.core.model.IDebugElement

getLaunch

public org.eclipse.debug.core.ILaunch getLaunch()
Specified by:
getLaunch in interface org.eclipse.debug.core.model.IDebugElement

fireCreationEvent

public void fireCreationEvent()
Fires a debug event marking the creation of this element.


createCreateEvent

public org.eclipse.debug.core.DebugEvent createCreateEvent()

fireResumeEvent

public void fireResumeEvent(int detail)
Fires a debug event marking the RESUME of this element with the associated detail.

Parameters:
detail - The int detail of the event
See Also:
DebugEvent

createResumeEvent

public org.eclipse.debug.core.DebugEvent createResumeEvent(int detail)

fireSuspendEvent

public void fireSuspendEvent(int detail)
Fires a debug event marking the SUSPEND of this element with the associated detail.

Parameters:
detail - The int detail of the event
See Also:
DebugEvent

createSuspendEvent

public org.eclipse.debug.core.DebugEvent createSuspendEvent(int detail)

fireTerminateEvent

public void fireTerminateEvent()
Fires a debug event marking the termination of this element.


createTerminateEvent

public org.eclipse.debug.core.DebugEvent createTerminateEvent()

fireChangeEvent

public void fireChangeEvent(int detail)
Fires a debug event marking the CHANGE of this element with the specifed detail code.

Parameters:
detail - one of STATE or CONTENT

createChangeEvent

public org.eclipse.debug.core.DebugEvent createChangeEvent(int detail)

getCDISession

public org.eclipse.cdt.debug.core.cdi.ICDISession getCDISession()
Returns the CDI session associated with this element.

Returns:
the CDI session

getCDITarget

public org.eclipse.cdt.debug.core.cdi.model.ICDITarget getCDITarget()
Returns the underlying CDI target associated with this element.

Returns:
the underlying CDI target

requestFailed

public static void requestFailed(java.lang.String message,
                                 java.lang.Exception e)
                          throws org.eclipse.debug.core.DebugException
Throws a new debug exception with a status code of REQUEST_FAILED.

Parameters:
message - Failure message
e - Exception that has occurred (can be null)
Throws:
org.eclipse.debug.core.DebugException - The exception with a status code of REQUEST_FAILED

targetRequestFailed

public static void targetRequestFailed(java.lang.String message,
                                       org.eclipse.cdt.debug.core.cdi.CDIException e)
                                throws org.eclipse.debug.core.DebugException
Throws a new debug exception with a status code of TARGET_REQUEST_FAILED with the given underlying exception.

Parameters:
message - Failure message
e - underlying exception that has occurred
Throws:
org.eclipse.debug.core.DebugException - The exception with a status code of TARGET_REQUEST_FAILED

requestFailed

public static void requestFailed(java.lang.String message,
                                 java.lang.Throwable e,
                                 int code)
                          throws org.eclipse.debug.core.DebugException
Throws a new debug exception with the given status code.

Parameters:
message - Failure message
e - Exception that has occurred (can be null)
code - status code
Throws:
org.eclipse.debug.core.DebugException - a new exception with given status code

targetRequestFailed

public static void targetRequestFailed(java.lang.String message,
                                       java.lang.Throwable e)
                                throws org.eclipse.debug.core.DebugException
Throws a new debug exception with a status code of TARGET_REQUEST_FAILED.

Parameters:
message - Failure message
e - Throwable that has occurred
Throws:
org.eclipse.debug.core.DebugException - The exception with a status code of TARGET_REQUEST_FAILED

notSupported

public static void notSupported(java.lang.String message)
                         throws org.eclipse.debug.core.DebugException
Throws a new debug exception with a status code of NOT_SUPPORTED.

Parameters:
message - Failure message
Throws:
org.eclipse.debug.core.DebugException - The exception with a status code of NOT_SUPPORTED.

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.core.runtime.PlatformObject

isOK

public boolean isOK()
Description copied from interface: ICDebugElementStatus
Returns whether this status indicates everything is okay (neither warning, nor error).

Specified by:
isOK in interface ICDebugElementStatus
Returns:
true if this status has severity OK, and false otherwise

getSeverity

public int getSeverity()
Description copied from interface: ICDebugElementStatus
Returns the severity. The severities are as follows (in descending order):

Specified by:
getSeverity in interface ICDebugElementStatus
Returns:
the severity: one of OK, ERROR, or WARNING

getMessage

public java.lang.String getMessage()
Description copied from interface: ICDebugElementStatus
Returns the message describing the outcome.

Specified by:
getMessage in interface ICDebugElementStatus
Returns:
a message

getState

public CDebugElementState getState()
Description copied from interface: ICDebugElement
Returns the current state of this element.

Specified by:
getState in interface ICDebugElement
Returns:
the current state

getCurrentStateInfo

public java.lang.Object getCurrentStateInfo()
Description copied from interface: ICDebugElement
Returns the info object associated with the current state.

Specified by:
getCurrentStateInfo in interface ICDebugElement
Returns:
the info object associated with the current state