Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] Support of the 'Resume At C/C++ Line' action

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/ChangeLog,v
retrieving revision 1.123
diff -u -r1.123 ChangeLog
--- ChangeLog 4 Feb 2003 23:47:54 -0000 1.123
+++ ChangeLog 5 Feb 2003 22:27:43 -0000
@@ -1,3 +1,10 @@
+2003-02-05 Mikhail Khodjaiants
+ Support of the 'Resume At C/C++ Line' action.
+ * IJumpToLine.java: new
+ * IJumpToAddress.java: new
+ * ICDebugTarget.java
+ * CDebugTarget.java

 2003-02-04 Mikhail Khodjaiants
  Support of the 'Resume Without Signal' action.
  * IResumeWithoutSignal.java: new
Index: src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java,v
retrieving revision 1.4
diff -u -r1.4 ICDebugTarget.java
--- src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java 4 Feb 2003 23:47:54 -0000 1.4
+++ src/org/eclipse/cdt/debug/core/model/ICDebugTarget.java 5 Feb 2003 22:27:44 -0000
@@ -21,6 +21,8 @@
             IRestart,
             IRunToLine,
             IRunToAddress,
+            IJumpToLine,
+            IJumpToAddress,
             IResumeWithoutSignal,
             IState,
             ISwitchToThread,
Index: src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java
===================================================================
RCS file: src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java
diff -N src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/debug/core/model/IJumpToAddress.java 5 Feb 2003 22:27:43 -0000
@@ -0,0 +1,30 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.core.model;
+
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * Provides the ability to resume a debug target at the given address.
+ *
+ * @since: Feb 5, 2003
+ */
+public interface IJumpToAddress
+{
+ /**
+  * Returns whether this operation is currently available for this element.
+  *
+  * @return whether this operation is currently available
+  */
+ public boolean canJumpToAddress( long address );
+
+ /**
+  * Causes this element to resume the execution at the specified address.
+  *
+  * @exception DebugException on failure. Reasons include:
+  */
+ public void jumpToAddress( long address ) throws DebugException;
+}
Index: src/org/eclipse/cdt/debug/core/model/IJumpToLine.java
===================================================================
RCS file: src/org/eclipse/cdt/debug/core/model/IJumpToLine.java
diff -N src/org/eclipse/cdt/debug/core/model/IJumpToLine.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/cdt/debug/core/model/IJumpToLine.java 5 Feb 2003 22:27:44 -0000
@@ -0,0 +1,31 @@
+/*
+ *(c) Copyright QNX Software Systems Ltd. 2002.
+ * All Rights Reserved.
+ *
+ */
+package org.eclipse.cdt.debug.core.model;
+
+import org.eclipse.core.resources.IResource;
+import org.eclipse.debug.core.DebugException;
+
+/**
+ * Provides the ability to resume a debug target at the given line.
+ *
+ * @since: Feb 5, 2003
+ */
+public interface IJumpToLine
+{
+ /**
+  * Returns whether this operation is currently available for this element.
+  *
+  * @return whether this operation is currently available
+  */
+ public boolean canJumpToLine( IResource resource, int lineNumber );
+
+ /**
+  * Causes this element to resume the execution at the specified line.
+  *
+  * @exception DebugException on failure. Reasons include:
+  */
+ public void jumpToLine( IResource resource, int lineNumber ) throws DebugException;
+}
Index: src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java,v
retrieving revision 1.82
diff -u -r1.82 CDebugTarget.java
--- src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 4 Feb 2003 23:47:54 -0000 1.82
+++ src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java 5 Feb 2003 22:27:45 -0000
@@ -66,6 +66,8 @@
 import org.eclipse.cdt.debug.core.model.IDebuggerProcessSupport;
 import org.eclipse.cdt.debug.core.model.IExecFileInfo;
 import org.eclipse.cdt.debug.core.model.IGlobalVariable;
+import org.eclipse.cdt.debug.core.model.IJumpToAddress;
+import org.eclipse.cdt.debug.core.model.IJumpToLine;
 import org.eclipse.cdt.debug.core.model.IRunToAddress;
 import org.eclipse.cdt.debug.core.model.IRunToLine;
 import org.eclipse.cdt.debug.core.model.IState;
@@ -907,6 +909,10 @@
    return this;
   if ( adapter.equals( IRunToAddress.class ) )
    return this;
+  if ( adapter.equals( IJumpToLine.class ) )
+   return this;
+  if ( adapter.equals( IJumpToAddress.class ) )
+   return this;
   if ( adapter.equals( ICBreakpointManager.class ) )
    return this;
   if ( adapter.equals( DisassemblyManager.class ) )
@@ -2461,6 +2467,62 @@
   try
   {
    getCDITarget().signal();
+  }
+  catch( CDIException e )
+  {
+   targetRequestFailed( e.toString(), e );
+  }
+ }
+
+ /* (non-Javadoc)
+  * @see org.eclipse.cdt.debug.core.model.IJumpToLine#canJumpToLine(IResource, int)
+  */
+ public boolean canJumpToLine( IResource resource, int lineNumber )
+ {
+  // check if supports jump to line
+  return canResume();
+ }
+
+ /* (non-Javadoc)
+  * @see org.eclipse.cdt.debug.core.model.IJumpToLine#jumpToLine(IResource, int)
+  */
+ public void jumpToLine( IResource resource, int lineNumber ) throws DebugException
+ {
+  if ( !canJumpToLine( resource, lineNumber ) )
+   return;
+  setBreakpoints();
+  ICDILocation location = getCDISession().getBreakpointManager().createLocation( resource.getLocation().lastSegment(), null, lineNumber );
+  try
+  {
+   getCDITarget().jump( location );
+  }
+  catch( CDIException e )
+  {
+   targetRequestFailed( e.toString(), e );
+  }
+ }
+
+ /* (non-Javadoc)
+  * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#canJumpToAddress(long)
+  */
+ public boolean canJumpToAddress( long address )
+ {
+  // check if supports jump to address
+  return canResume();
+ }
+
+ /* (non-Javadoc)
+  * @see org.eclipse.cdt.debug.core.model.IJumpToAddress#jumpToAddress(long)
+  */
+ public void jumpToAddress( long address ) throws DebugException
+ {
+  if ( !canJumpToAddress( address ) )
+   return;
+  setBreakpoints();
+  ICDILocation location = getCDISession().getBreakpointManager().createLocation( address );
+  try
+  {
+   getCDITarget().jump( location );
   }
   catch( CDIException e )
   {

Back to the top