mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
Applied patch in bug 199584. Run-to-Line was not setting the thread state.
This commit is contained in:
parent
2250bfc3d6
commit
e1478e3c72
3 changed files with 55 additions and 17 deletions
|
@ -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 {
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue