PTP
Release 5.0

org.eclipse.ptp.debug.core
Class PDebugModel

java.lang.Object
  extended by org.eclipse.ptp.debug.core.PDebugModel

public class PDebugModel
extends Object


Constructor Summary
PDebugModel()
           
 
Method Summary
 void addNewDebugTargets(IPLaunch launch, TaskSet tasks, IPDITarget[] pdiTargets, boolean refresh, boolean resumeTarget)
          Add a new debug target to the lauch.
 void addTasks(IPSession session, String setId, TaskSet tasks)
          Add new tasks to a task set
static IPAddressBreakpoint createAddressBreakpoint(String module, String sourceHandle, org.eclipse.core.resources.IResource resource, int lineNumber, BigInteger address, boolean enabled, int ignoreCount, String condition, boolean register, String setId, String jobId, String jobName)
          Create an address breakpoint.
 IPSession createDebugSession(IPDebugger debugger, IPLaunch launch, org.eclipse.core.resources.IProject project, org.eclipse.core.runtime.IProgressMonitor monitor)
          Helper method to create a new debug session.
static IPFunctionBreakpoint createFunctionBreakpoint(String sourceHandle, org.eclipse.core.resources.IResource resource, String function, int charStart, int charEnd, int lineNumber, boolean enabled, int ignoreCount, String condition, boolean register, String setId, String jobId, String jobName)
          Create a function breakpoint.
static IPLineBreakpoint createLineBreakpoint(String sourceHandle, org.eclipse.core.resources.IResource resource, int lineNumber, boolean enabled, int ignoreCount, String condition, boolean register, String setId, String jobId, String jobName)
           
 void createSet(IPSession session, String setId, TaskSet tasks)
          Create a new set containing the given tasks.
static IPWatchpoint createWatchpoint(String sourceHandle, org.eclipse.core.resources.IResource resource, boolean writeAccess, boolean readAccess, String expression, boolean enabled, int ignoreCount, String condition, boolean register, String setId, String jobId, String jobName)
          Create a watchpoint on an expression.
 void deleteSet(IPSession session, String setId)
          Remove a set from the session.
static IPFunctionBreakpoint[] functionBreakpointExists(String sourceHandle, org.eclipse.core.resources.IResource resource, String function)
          Find the breakpoints for a particular function.
static org.eclipse.debug.core.model.IBreakpoint[] getBreakpoints()
          Get all the breakpoints set by the debugger.
static String getPluginIdentifier()
           
 IPSession getSession(String jobId)
          Get the session associated with a job
 TaskSet getTasks(IPSession session, String setId)
          Find the tasks associated with a set in a debug sesison.
static IPLineBreakpoint lineBreakpointExists(IPLineBreakpoint[] breakpoints, org.eclipse.ptp.core.elements.IPJob job)
          Find the first global breakpoint or breakpoint on the supplied job.
static IPLineBreakpoint[] lineBreakpointsExists(String sourceHandle, org.eclipse.core.resources.IResource resource, int lineNumber)
          Find the line breakpoints at a particular line.
 void removeDebugTarget(IPLaunch launch, TaskSet tasks, boolean refresh)
          Remove a debug target from a launch
 void removeTasks(IPSession session, String setId, TaskSet tasks)
          Remove tasks from the set of tasks defined by setId.
 void shutdown()
          Shutdown all debug sessions
 void shutdownSession(String jobId)
          Shutdown the debug session for the given job.
static void updateBreakpoints(String setId, org.eclipse.core.runtime.IProgressMonitor monitor)
          Update breakpoint when a set ID changes.
static IPWatchpoint[] watchpointExists(String sourceHandle, org.eclipse.core.resources.IResource resource, String expression)
          Check if a watchpoint exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDebugModel

public PDebugModel()
Method Detail

createAddressBreakpoint

public static IPAddressBreakpoint createAddressBreakpoint(String module,
                                                          String sourceHandle,
                                                          org.eclipse.core.resources.IResource resource,
                                                          int lineNumber,
                                                          BigInteger address,
                                                          boolean enabled,
                                                          int ignoreCount,
                                                          String condition,
                                                          boolean register,
                                                          String setId,
                                                          String jobId,
                                                          String jobName)
                                                   throws org.eclipse.core.runtime.CoreException
Create an address breakpoint.

Parameters:
module -
sourceHandle -
resource -
lineNumber -
address -
enabled -
ignoreCount -
condition -
register -
setId -
jobId -
jobName -
Returns:
Throws:
org.eclipse.core.runtime.CoreException

createFunctionBreakpoint

public static IPFunctionBreakpoint createFunctionBreakpoint(String sourceHandle,
                                                            org.eclipse.core.resources.IResource resource,
                                                            String function,
                                                            int charStart,
                                                            int charEnd,
                                                            int lineNumber,
                                                            boolean enabled,
                                                            int ignoreCount,
                                                            String condition,
                                                            boolean register,
                                                            String setId,
                                                            String jobId,
                                                            String jobName)
                                                     throws org.eclipse.core.runtime.CoreException
Create a function breakpoint.

Parameters:
sourceHandle -
resource -
function -
charStart -
charEnd -
lineNumber -
enabled -
ignoreCount -
condition -
register -
setId -
jobId -
jobName -
Returns:
Throws:
org.eclipse.core.runtime.CoreException

createLineBreakpoint

public static IPLineBreakpoint createLineBreakpoint(String sourceHandle,
                                                    org.eclipse.core.resources.IResource resource,
                                                    int lineNumber,
                                                    boolean enabled,
                                                    int ignoreCount,
                                                    String condition,
                                                    boolean register,
                                                    String setId,
                                                    String jobId,
                                                    String jobName)
                                             throws org.eclipse.core.runtime.CoreException
Parameters:
sourceHandle -
resource -
lineNumber -
enabled -
ignoreCount -
condition -
register -
setId -
jobId -
Returns:
Throws:
org.eclipse.core.runtime.CoreException
Since:
5.0

createWatchpoint

public static IPWatchpoint createWatchpoint(String sourceHandle,
                                            org.eclipse.core.resources.IResource resource,
                                            boolean writeAccess,
                                            boolean readAccess,
                                            String expression,
                                            boolean enabled,
                                            int ignoreCount,
                                            String condition,
                                            boolean register,
                                            String setId,
                                            String jobId,
                                            String jobName)
                                     throws org.eclipse.core.runtime.CoreException
Create a watchpoint on an expression.

Parameters:
sourceHandle -
resource -
writeAccess -
readAccess -
expression -
enabled -
ignoreCount -
condition -
register -
setId -
jobId -
jobName -
Returns:
Throws:
org.eclipse.core.runtime.CoreException

functionBreakpointExists

public static IPFunctionBreakpoint[] functionBreakpointExists(String sourceHandle,
                                                              org.eclipse.core.resources.IResource resource,
                                                              String function)
                                                       throws org.eclipse.core.runtime.CoreException
Find the breakpoints for a particular function.

Parameters:
sourceHandle -
resource -
function -
Returns:
Throws:
org.eclipse.core.runtime.CoreException

getBreakpoints

public static org.eclipse.debug.core.model.IBreakpoint[] getBreakpoints()
Get all the breakpoints set by the debugger.

Returns:
all breakpoints
Since:
5.0

getPluginIdentifier

public static String getPluginIdentifier()
Returns:

lineBreakpointExists

public static IPLineBreakpoint lineBreakpointExists(IPLineBreakpoint[] breakpoints,
                                                    org.eclipse.ptp.core.elements.IPJob job)
                                             throws org.eclipse.core.runtime.CoreException
Find the first global breakpoint or breakpoint on the supplied job.

Parameters:
breakpoints -
job -
Returns:
Throws:
org.eclipse.core.runtime.CoreException

lineBreakpointsExists

public static IPLineBreakpoint[] lineBreakpointsExists(String sourceHandle,
                                                       org.eclipse.core.resources.IResource resource,
                                                       int lineNumber)
                                                throws org.eclipse.core.runtime.CoreException
Find the line breakpoints at a particular line.

Parameters:
sourceHandle -
resource -
lineNumber -
Returns:
Throws:
org.eclipse.core.runtime.CoreException

updateBreakpoints

public static void updateBreakpoints(String setId,
                                     org.eclipse.core.runtime.IProgressMonitor monitor)
                              throws org.eclipse.core.runtime.CoreException
Update breakpoint when a set ID changes.

Parameters:
setId -
monitor -
Throws:
org.eclipse.core.runtime.CoreException
Since:
5.0

watchpointExists

public static IPWatchpoint[] watchpointExists(String sourceHandle,
                                              org.eclipse.core.resources.IResource resource,
                                              String expression)
                                       throws org.eclipse.core.runtime.CoreException
Check if a watchpoint exists.

Parameters:
sourceHandle -
resource -
expression -
Returns:
Throws:
org.eclipse.core.runtime.CoreException

addNewDebugTargets

public void addNewDebugTargets(IPLaunch launch,
                               TaskSet tasks,
                               IPDITarget[] pdiTargets,
                               boolean refresh,
                               boolean resumeTarget)
Add a new debug target to the lauch.

Parameters:
launch -
tasks -
pdiTargets -
refresh -
resumeTarget -
Since:
4.0

addTasks

public void addTasks(IPSession session,
                     String setId,
                     TaskSet tasks)
Add new tasks to a task set

Parameters:
session - current debug session
setId - ID of the set to add the tasks to
tasks - tasks to add to the set
Since:
4.0

createDebugSession

public IPSession createDebugSession(IPDebugger debugger,
                                    IPLaunch launch,
                                    org.eclipse.core.resources.IProject project,
                                    org.eclipse.core.runtime.IProgressMonitor monitor)
                             throws org.eclipse.core.runtime.CoreException
Helper method to create a new debug session.

Parameters:
timeout - timeout value for debug commands
launch - debugger launch configuration
monitor - progress monitor
Returns:
new debug session
Throws:
org.eclipse.core.runtime.CoreException
Since:
5.0

createSet

public void createSet(IPSession session,
                      String setId,
                      TaskSet tasks)
Create a new set containing the given tasks.

Parameters:
session -
setId -
tasks -
Since:
4.0

deleteSet

public void deleteSet(IPSession session,
                      String setId)
Remove a set from the session.

Parameters:
session - current session
setId -

getSession

public IPSession getSession(String jobId)
Get the session associated with a job

Parameters:
job -
Returns:
Since:
5.0

getTasks

public TaskSet getTasks(IPSession session,
                        String setId)
Find the tasks associated with a set in a debug sesison.

Parameters:
session -
setId -
Returns:
Since:
4.0

removeDebugTarget

public void removeDebugTarget(IPLaunch launch,
                              TaskSet tasks,
                              boolean refresh)
Remove a debug target from a launch. Œ

Parameters:
launch -
tasks -
refresh -
Since:
4.0

removeTasks

public void removeTasks(IPSession session,
                        String setId,
                        TaskSet tasks)
Remove tasks from the set of tasks defined by setId. If there are any breakpoints on tasks in the set, the breakpoint need to be removed also.

Parameters:
session - debug session
setId - id of set containing tasks to be removed
tasks - tasks to be removed from the set
Since:
4.0

shutdown

public void shutdown()
Shutdown all debug sessions


shutdownSession

public void shutdownSession(String jobId)
Shutdown the debug session for the given job.

Parameters:
jobId - job ID for the debug session
Since:
5.0

PTP
Release 5.0

Copyright (c) 2011 IBM Corporation and others. All Rights Reserved.