org.eclipse.datatools.sqltools.debugger.model
Class SPDebugTarget

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.datatools.sqltools.debugger.model.SPDebugElement
          extended by org.eclipse.datatools.sqltools.debugger.model.SPDebugTarget
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.debug.core.IBreakpointListener, org.eclipse.debug.core.ILaunchListener, org.eclipse.debug.core.model.IDebugElement, org.eclipse.debug.core.model.IDebugTarget, org.eclipse.debug.core.model.IDisconnect, org.eclipse.debug.core.model.IMemoryBlockRetrieval, org.eclipse.debug.core.model.ISuspendResume, org.eclipse.debug.core.model.ITerminate

public class SPDebugTarget
extends SPDebugElement
implements org.eclipse.debug.core.model.IDebugTarget, org.eclipse.debug.core.ILaunchListener

SP debug target will only have at most one SPThread associated with it, many method of this class will delegate to the SPThread.

Author:
Yang Liu

Constructor Summary
SPDebugTarget(org.eclipse.debug.core.ILaunch launch, org.eclipse.debug.core.model.IProcess process, java.lang.String name)
           
 
Method Summary
 void breakpointAdded(org.eclipse.debug.core.model.IBreakpoint breakpoint)
           
 void breakpointChanged(org.eclipse.debug.core.model.IBreakpoint breakpoint, org.eclipse.core.resources.IMarkerDelta delta)
           
 void breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint breakpoint, org.eclipse.core.resources.IMarkerDelta delta)
           
 boolean canDisconnect()
           
 boolean canResume()
           
 boolean canSuspend()
           
 boolean canTerminate()
           
 void disconnect()
           
 void disconnected()
           
 org.eclipse.debug.core.ILaunch getLaunch()
           
 org.eclipse.debug.core.model.IMemoryBlock getMemoryBlock(long startAddress, long length)
           
 java.lang.String getName()
           
 org.eclipse.debug.core.model.IProcess getProcess()
           
 SPThread getSPThread()
           
 int getSuspendCount()
           
 org.eclipse.debug.core.model.IThread[] getThreads()
           
 boolean hasThreads()
           
 void internalIncreaseSuspendCount()
          Increases the suspend count by one.
 boolean isDisconnected()
           
 boolean isSuspended()
           
 boolean isTerminated()
           
 void launchAdded(org.eclipse.debug.core.ILaunch launch)
           
 void launchChanged(org.eclipse.debug.core.ILaunch launch)
           
 void launchRemoved(org.eclipse.debug.core.ILaunch launch)
           
 void resume()
           
 void setSPThread(SPThread thread)
          Associates the sole thread.
 boolean supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint breakpoint)
           
 boolean supportsStorageRetrieval()
           
 void suspend()
           
 void terminate()
           
 void terminated()
          this method is called by itself or the thread when the debug target is terminated.
 
Methods inherited from class org.eclipse.datatools.sqltools.debugger.model.SPDebugElement
fireChangeEvent, fireResumeEvent, fireSuspendEvent, getAdapter, getDebugTarget, getModelIdentifier, getSPDebugTarget, notSupported
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.debug.core.model.IDebugElement
getDebugTarget, getModelIdentifier
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

SPDebugTarget

public SPDebugTarget(org.eclipse.debug.core.ILaunch launch,
                     org.eclipse.debug.core.model.IProcess process,
                     java.lang.String name)
Method Detail

setSPThread

public void setSPThread(SPThread thread)
Associates the sole thread. Should only be called once, directly after the constructor

Parameters:
thread -

getProcess

public org.eclipse.debug.core.model.IProcess getProcess()
Specified by:
getProcess in interface org.eclipse.debug.core.model.IDebugTarget

getLaunch

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

getThreads

public org.eclipse.debug.core.model.IThread[] getThreads()
Specified by:
getThreads in interface org.eclipse.debug.core.model.IDebugTarget

getSPThread

public SPThread getSPThread()
Returns:
the associated thread

hasThreads

public boolean hasThreads()
                   throws org.eclipse.debug.core.DebugException
Specified by:
hasThreads in interface org.eclipse.debug.core.model.IDebugTarget
Throws:
org.eclipse.debug.core.DebugException

getName

public java.lang.String getName()
                         throws org.eclipse.debug.core.DebugException
Specified by:
getName in interface org.eclipse.debug.core.model.IDebugTarget
Throws:
org.eclipse.debug.core.DebugException

canResume

public boolean canResume()
Specified by:
canResume in interface org.eclipse.debug.core.model.ISuspendResume

canSuspend

public boolean canSuspend()
Specified by:
canSuspend in interface org.eclipse.debug.core.model.ISuspendResume

isSuspended

public boolean isSuspended()
Specified by:
isSuspended in interface org.eclipse.debug.core.model.ISuspendResume

resume

public void resume()
            throws org.eclipse.debug.core.DebugException
Specified by:
resume in interface org.eclipse.debug.core.model.ISuspendResume
Throws:
org.eclipse.debug.core.DebugException

suspend

public void suspend()
             throws org.eclipse.debug.core.DebugException
Specified by:
suspend in interface org.eclipse.debug.core.model.ISuspendResume
Throws:
org.eclipse.debug.core.DebugException

canTerminate

public boolean canTerminate()
Specified by:
canTerminate in interface org.eclipse.debug.core.model.ITerminate

isTerminated

public boolean isTerminated()
Specified by:
isTerminated in interface org.eclipse.debug.core.model.ITerminate

terminated

public void terminated()
this method is called by itself or the thread when the debug target is terminated.


disconnected

public void disconnected()

terminate

public void terminate()
               throws org.eclipse.debug.core.DebugException
Specified by:
terminate in interface org.eclipse.debug.core.model.ITerminate
Throws:
org.eclipse.debug.core.DebugException

canDisconnect

public boolean canDisconnect()
Specified by:
canDisconnect in interface org.eclipse.debug.core.model.IDisconnect

disconnect

public void disconnect()
                throws org.eclipse.debug.core.DebugException
Specified by:
disconnect in interface org.eclipse.debug.core.model.IDisconnect
Throws:
org.eclipse.debug.core.DebugException

isDisconnected

public boolean isDisconnected()
Specified by:
isDisconnected in interface org.eclipse.debug.core.model.IDisconnect

supportsBreakpoint

public boolean supportsBreakpoint(org.eclipse.debug.core.model.IBreakpoint breakpoint)
Specified by:
supportsBreakpoint in interface org.eclipse.debug.core.model.IDebugTarget

supportsStorageRetrieval

public boolean supportsStorageRetrieval()
Specified by:
supportsStorageRetrieval in interface org.eclipse.debug.core.model.IMemoryBlockRetrieval

getMemoryBlock

public org.eclipse.debug.core.model.IMemoryBlock getMemoryBlock(long startAddress,
                                                                long length)
                                                         throws org.eclipse.debug.core.DebugException
Specified by:
getMemoryBlock in interface org.eclipse.debug.core.model.IMemoryBlockRetrieval
Throws:
org.eclipse.debug.core.DebugException

getSuspendCount

public int getSuspendCount()
Returns:
the number of times the debug target suspended.

internalIncreaseSuspendCount

public void internalIncreaseSuspendCount()
Increases the suspend count by one. Called internally by the IThread when they are being suspended.


launchRemoved

public void launchRemoved(org.eclipse.debug.core.ILaunch launch)
Specified by:
launchRemoved in interface org.eclipse.debug.core.ILaunchListener

launchAdded

public void launchAdded(org.eclipse.debug.core.ILaunch launch)
Specified by:
launchAdded in interface org.eclipse.debug.core.ILaunchListener

launchChanged

public void launchChanged(org.eclipse.debug.core.ILaunch launch)
Specified by:
launchChanged in interface org.eclipse.debug.core.ILaunchListener

breakpointAdded

public void breakpointAdded(org.eclipse.debug.core.model.IBreakpoint breakpoint)
Specified by:
breakpointAdded in interface org.eclipse.debug.core.IBreakpointListener

breakpointRemoved

public void breakpointRemoved(org.eclipse.debug.core.model.IBreakpoint breakpoint,
                              org.eclipse.core.resources.IMarkerDelta delta)
Specified by:
breakpointRemoved in interface org.eclipse.debug.core.IBreakpointListener

breakpointChanged

public void breakpointChanged(org.eclipse.debug.core.model.IBreakpoint breakpoint,
                              org.eclipse.core.resources.IMarkerDelta delta)
Specified by:
breakpointChanged in interface org.eclipse.debug.core.IBreakpointListener