1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-12 18:55:38 +02:00

Use the asynchronous implementation for resume, suspend, step etc provided by eclipse 3.1.

This commit is contained in:
Mikhail Khodjaiants 2005-01-10 22:52:06 +00:00
parent 0f2803f134
commit c796aad342
4 changed files with 83 additions and 148 deletions

View file

@ -1,3 +1,9 @@
2005-01-10 Mikhail Khodjaiants
Use the asynchronous implementation for resume, suspend, step etc provided by eclipse 3.1.
* CDebugTarget.java
* CThread.java
* CoreModelMessages.properties
2005-01-10 Mikhail Khodjaiants 2005-01-10 Mikhail Khodjaiants
Bug 73168: Use memory view provided by Eclipse platform in CDT. Bug 73168: Use memory view provided by Eclipse platform in CDT.
* ICType.java * ICType.java

View file

@ -449,23 +449,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return; return;
} }
changeState( CDebugElementState.TERMINATING ); changeState( CDebugElementState.TERMINATING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
getCDITarget().terminate();
public void run() { }
try { catch( CDIException e ) {
getCDITarget().terminate(); restoreOldState();
} targetRequestFailed( e.getMessage(), null );
catch( CDIException e ) { }
restoreOldState();
try {
targetRequestFailed( e.getMessage(), e );
}
catch( DebugException e1 ) {
failed( CoreModelMessages.getString( "CDebugTarget.2" ), e1 ); //$NON-NLS-1$
}
}
}
} );
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -508,23 +498,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
if ( !canResume() ) if ( !canResume() )
return; return;
changeState( CDebugElementState.RESUMING ); changeState( CDebugElementState.RESUMING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
getCDITarget().resume( false );
public void run() { }
try { catch( CDIException e ) {
getCDITarget().resume( false ); restoreOldState();
} targetRequestFailed( e.getMessage(), null );
catch( CDIException e ) { }
restoreOldState();
try {
targetRequestFailed( e.getMessage(), e );
}
catch( DebugException e1 ) {
failed( CoreModelMessages.getString( "CDebugTarget.3" ), e1 ); //$NON-NLS-1$
}
}
}
} );
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -534,23 +514,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
if ( !canSuspend() ) if ( !canSuspend() )
return; return;
changeState( CDebugElementState.SUSPENDING ); changeState( CDebugElementState.SUSPENDING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
getCDITarget().suspend();
public void run() { }
try { catch( CDIException e ) {
getCDITarget().suspend(); restoreOldState();
} targetRequestFailed( e.getMessage(), null );
catch( CDIException e ) { }
restoreOldState();
try {
targetRequestFailed( e.getMessage(), e );
}
catch( DebugException e1 ) {
failed( CoreModelMessages.getString( "CDebugTarget.4" ), e1 ); //$NON-NLS-1$
}
}
}
} );
} }
protected boolean isSuspending() { protected boolean isSuspending() {
@ -736,23 +706,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv
return; return;
} }
changeState( CDebugElementState.DISCONNECTING ); changeState( CDebugElementState.DISCONNECTING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
getCDITarget().disconnect();
public void run() { }
try { catch( CDIException e ) {
getCDITarget().disconnect(); restoreOldState();
} targetRequestFailed( e.getMessage(), null );
catch( CDIException e ) { }
restoreOldState();
try {
targetRequestFailed( e.getMessage(), e );
}
catch( DebugException e1 ) {
failed( CoreModelMessages.getString( "CDebugTarget.5" ), e1 ); //$NON-NLS-1$
}
}
}
} );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -50,7 +50,6 @@ import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.DebugEvent; import org.eclipse.debug.core.DebugEvent;
import org.eclipse.debug.core.DebugException; import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.model.IBreakpoint; import org.eclipse.debug.core.model.IBreakpoint;
import org.eclipse.debug.core.model.IMemoryBlockRetrieval; import org.eclipse.debug.core.model.IMemoryBlockRetrieval;
import org.eclipse.debug.core.model.IStackFrame; import org.eclipse.debug.core.model.IStackFrame;
@ -405,20 +404,15 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void resume() throws DebugException { public void resume() throws DebugException {
if ( !canResume() ) if ( !canResume() )
return; return;
final CDebugElementState oldState = getState(); CDebugElementState oldState = getState();
setState( CDebugElementState.RESUMING ); setState( CDebugElementState.RESUMING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
getCDIThread().resume( false );
public void run() { }
try { catch( CDIException e ) {
getCDIThread().resume( false ); setState( oldState );
} targetRequestFailed( e.getMessage(), null );
catch( CDIException e ) { }
setState( oldState );
failed( CoreModelMessages.getString( "CThread.2" ), e ); //$NON-NLS-1$
}
}
} );
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -427,20 +421,15 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void suspend() throws DebugException { public void suspend() throws DebugException {
if ( !canSuspend() ) if ( !canSuspend() )
return; return;
final CDebugElementState oldState = getState(); CDebugElementState oldState = getState();
setState( CDebugElementState.SUSPENDING ); setState( CDebugElementState.SUSPENDING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
getCDITarget().suspend();
public void run() { }
try { catch( CDIException e ) {
getCDITarget().suspend(); setState( oldState );
} targetRequestFailed( e.getMessage(), null );
catch( CDIException e ) { }
setState( oldState );
failed( CoreModelMessages.getString( "CThread.3" ), e ); //$NON-NLS-1$
}
}
} );
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -492,25 +481,20 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void stepInto() throws DebugException { public void stepInto() throws DebugException {
if ( !canStepInto() ) if ( !canStepInto() )
return; return;
final CDebugElementState oldState = getState(); CDebugElementState oldState = getState();
setState( CDebugElementState.STEPPING ); setState( CDebugElementState.STEPPING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
if ( !isInstructionsteppingEnabled() ) {
public void run() { getCDIThread().stepInto( 1 );
try {
if ( !isInstructionsteppingEnabled() ) {
getCDIThread().stepInto( 1 );
}
else {
getCDIThread().stepIntoInstruction( 1 );
}
}
catch( CDIException e ) {
setState( oldState );
failed( CoreModelMessages.getString( "CThread.4" ), e ); //$NON-NLS-1$
}
} }
} ); else {
getCDIThread().stepIntoInstruction( 1 );
}
}
catch( CDIException e ) {
setState( oldState );
targetRequestFailed( e.getMessage(), null );
}
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -519,25 +503,20 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
public void stepOver() throws DebugException { public void stepOver() throws DebugException {
if ( !canStepOver() ) if ( !canStepOver() )
return; return;
final CDebugElementState oldState = getState(); CDebugElementState oldState = getState();
setState( CDebugElementState.STEPPING ); setState( CDebugElementState.STEPPING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
if ( !isInstructionsteppingEnabled() ) {
public void run() { getCDIThread().stepOver( 1 );
try {
if ( !isInstructionsteppingEnabled() ) {
getCDIThread().stepOver( 1 );
}
else {
getCDIThread().stepOverInstruction( 1 );
}
}
catch( CDIException e ) {
setState( oldState );
failed( CoreModelMessages.getString( "CThread.5" ), e ); //$NON-NLS-1$
}
} }
} ); else {
getCDIThread().stepOverInstruction( 1 );
}
}
catch( CDIException e ) {
setState( oldState );
targetRequestFailed( e.getMessage(), null );
}
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -549,21 +528,16 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum
IStackFrame[] frames = getStackFrames(); IStackFrame[] frames = getStackFrames();
if ( frames.length == 0 ) if ( frames.length == 0 )
return; return;
final CStackFrame f = (CStackFrame)frames[0]; CStackFrame f = (CStackFrame)frames[0];
final CDebugElementState oldState = getState(); CDebugElementState oldState = getState();
setState( CDebugElementState.STEPPING ); setState( CDebugElementState.STEPPING );
DebugPlugin.getDefault().asyncExec( new Runnable() { try {
f.doStepReturn();
public void run() { }
try { catch( DebugException e ) {
f.doStepReturn(); setState( oldState );
} throw e;
catch( DebugException e ) { }
setState( oldState );
failed( CoreModelMessages.getString( "CThread.6" ), e ); //$NON-NLS-1$
}
}
} );
} }
/* (non-Javadoc) /* (non-Javadoc)

View file

@ -23,11 +23,6 @@ CModificationVariable.1=Unable to set value.
CStackFrame.0={0} at {1}: {2} CStackFrame.0={0} at {1}: {2}
CThread.0=Stack is not available: {0}. CThread.0=Stack is not available: {0}.
CThread.1=Stack is not available: {0}. CThread.1=Stack is not available: {0}.
CThread.2=Resume failed.
CThread.3=Suspend failed.
CThread.4=Step failed.
CThread.5=Step failed.
CThread.6=Step failed.
CValue.0=not available: {0} CValue.0=not available: {0}
CVariable.0=not available: {0} CVariable.0=not available: {0}
CVariable.1=not available: {0} CVariable.1=not available: {0}