Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Cortell2008-01-04 14:05:29 +0000
committerJohn Cortell2008-01-04 14:05:29 +0000
commite1478e3c728c3c37d05f72e3c2908b82acf3987f (patch)
treeb79f1271d8a03cbe6e7352179609dda4babb11bf /debug/org.eclipse.cdt.debug.core
parent2250bfc3d6728c3b8585afe641c5ae8468363911 (diff)
downloadorg.eclipse.cdt-e1478e3c728c3c37d05f72e3c2908b82acf3987f.tar.gz
org.eclipse.cdt-e1478e3c728c3c37d05f72e3c2908b82acf3987f.tar.xz
org.eclipse.cdt-e1478e3c728c3c37d05f72e3c2908b82acf3987f.zip
Applied patch in bug 199584. Run-to-Line was not setting the thread state.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.core')
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICThread.java2
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java20
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java50
3 files changed, 55 insertions, 17 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICThread.java
index e4ea58baae3..d69e18b9a32 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICThread.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/model/ICThread.java
@@ -15,5 +15,5 @@ import org.eclipse.debug.core.model.IThread;
/**
* C/C++ extension of <code>IThread</code>.
*/
-public interface ICThread extends IThread, ICDebugElement {
+public interface ICThread extends IThread, IRunToLine, ICDebugElement {
}
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java
index 9d628c6e671..b94388c3ddc 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CStackFrame.java
@@ -782,7 +782,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
* @see org.eclipse.cdt.debug.core.model.IRunToLine#canRunToLine(org.eclipse.core.resources.IFile, int)
*/
public boolean canRunToLine( IFile file, int lineNumber ) {
- return getThread().canResume();
+ return ((CThread)getThread()).canRunToLine( file, lineNumber );
}
/* (non-Javadoc)
@@ -791,14 +791,14 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
public void runToLine( IFile file, int lineNumber, boolean skipBreakpoints ) throws DebugException {
if ( !canRunToLine( file, lineNumber ) )
return;
- runToLine( file.getLocation().lastSegment(), lineNumber, skipBreakpoints );
+ ((CThread)getThread()).runToLine( file, lineNumber, skipBreakpoints );
}
/* (non-Javadoc)
* @see org.eclipse.cdt.debug.core.model.IRunToLine#canRunToLine(java.lang.String, int)
*/
public boolean canRunToLine( String fileName, int lineNumber ) {
- return getThread().canResume();
+ return ((CThread)getThread()).canRunToLine( fileName, lineNumber );
}
/* (non-Javadoc)
@@ -807,19 +807,7 @@ public class CStackFrame extends CDebugElement implements ICStackFrame, IRestart
public void runToLine( String fileName, int lineNumber, boolean skipBreakpoints ) throws DebugException {
if ( !canRunToLine( fileName, lineNumber ) )
return;
- if ( skipBreakpoints ) {
- ((CDebugTarget)getDebugTarget()).skipBreakpoints( true );
- }
- ICDILocation location = getCDITarget().createLineLocation( fileName, lineNumber );
- try {
- getCDIThread().stepUntil( location );
- }
- catch( CDIException e ) {
- if ( skipBreakpoints ) {
- ((CDebugTarget)getDebugTarget()).skipBreakpoints( false );
- }
- targetRequestFailed( e.getMessage(), e );
- }
+ ((CThread)getThread()).runToLine( fileName, lineNumber, skipBreakpoints );
}
/* (non-Javadoc)
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
index 40d17e5d62d..c7a5eab19a5 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CThread.java
@@ -24,6 +24,7 @@ import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.ICDIBreakpointHit;
import org.eclipse.cdt.debug.core.cdi.ICDIEndSteppingRange;
+import org.eclipse.cdt.debug.core.cdi.ICDILocation;
import org.eclipse.cdt.debug.core.cdi.ICDISessionObject;
import org.eclipse.cdt.debug.core.cdi.ICDISignalReceived;
import org.eclipse.cdt.debug.core.cdi.ICDIWatchpointTrigger;
@@ -50,6 +51,7 @@ import org.eclipse.cdt.debug.core.model.IRestart;
import org.eclipse.cdt.debug.core.model.IResumeWithoutSignal;
import org.eclipse.cdt.debug.core.model.IRunToAddress;
import org.eclipse.cdt.debug.core.model.IRunToLine;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException;
@@ -977,4 +979,52 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
}
setCurrent( cdiThread.equals( currentThread ) );
}
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.model.IRunToLine#canRunToLine(org.eclipse.core.resources.IFile, int)
+ */
+ public boolean canRunToLine(IFile file, int lineNumber) {
+ return canRunToLine( file.getLocation().lastSegment(), lineNumber );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.model.IRunToLine#canRunToLine(java.lang.String, int)
+ */
+ public boolean canRunToLine(String fileName, int lineNumber) {
+ return canResume();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.model.IRunToLine#runToLine(org.eclipse.core.resources.IFile, int, boolean)
+ */
+ public void runToLine(IFile file, int lineNumber, boolean skipBreakpoints)
+ throws DebugException {
+ runToLine( file.getLocation().lastSegment(), lineNumber, skipBreakpoints );
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.cdt.debug.core.model.IRunToLine#runToLine(java.lang.String, int, boolean)
+ */
+ public void runToLine(String fileName, int lineNumber,
+ boolean skipBreakpoints) throws DebugException {
+ if ( !canRunToLine( fileName, lineNumber ) )
+ return;
+ if ( skipBreakpoints ) {
+ ((CDebugTarget)getDebugTarget()).skipBreakpoints( true );
+ }
+
+ CDebugElementState oldState = getState();
+ setState( CDebugElementState.RESUMING );
+ ICDILocation location = getCDITarget().createLineLocation( fileName, lineNumber );
+ try {
+ getCDIThread().stepUntil( location );
+ }
+ catch( CDIException e ) {
+ setState( oldState );
+ if ( skipBreakpoints ) {
+ ((CDebugTarget)getDebugTarget()).skipBreakpoints( false );
+ }
+ targetRequestFailed( e.getMessage(), e );
+ }
+ }
}

Back to the top