diff --git a/debug/org.eclipse.cdt.debug.core/ChangeLog b/debug/org.eclipse.cdt.debug.core/ChangeLog index 2095566def4..b95216d93c1 100644 --- a/debug/org.eclipse.cdt.debug.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.core/ChangeLog @@ -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 Bug 73168: Use memory view provided by Eclipse platform in CDT. * ICType.java diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index 85a07586db0..4f0beafdb77 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -449,23 +449,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv return; } changeState( CDebugElementState.TERMINATING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - getCDITarget().terminate(); - } - catch( CDIException e ) { - restoreOldState(); - try { - targetRequestFailed( e.getMessage(), e ); - } - catch( DebugException e1 ) { - failed( CoreModelMessages.getString( "CDebugTarget.2" ), e1 ); //$NON-NLS-1$ - } - } - } - } ); + try { + getCDITarget().terminate(); + } + catch( CDIException e ) { + restoreOldState(); + targetRequestFailed( e.getMessage(), null ); + } } /* (non-Javadoc) @@ -508,23 +498,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv if ( !canResume() ) return; changeState( CDebugElementState.RESUMING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - getCDITarget().resume( false ); - } - catch( CDIException e ) { - restoreOldState(); - try { - targetRequestFailed( e.getMessage(), e ); - } - catch( DebugException e1 ) { - failed( CoreModelMessages.getString( "CDebugTarget.3" ), e1 ); //$NON-NLS-1$ - } - } - } - } ); + try { + getCDITarget().resume( false ); + } + catch( CDIException e ) { + restoreOldState(); + targetRequestFailed( e.getMessage(), null ); + } } /* (non-Javadoc) @@ -534,23 +514,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv if ( !canSuspend() ) return; changeState( CDebugElementState.SUSPENDING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - getCDITarget().suspend(); - } - catch( CDIException e ) { - restoreOldState(); - try { - targetRequestFailed( e.getMessage(), e ); - } - catch( DebugException e1 ) { - failed( CoreModelMessages.getString( "CDebugTarget.4" ), e1 ); //$NON-NLS-1$ - } - } - } - } ); + try { + getCDITarget().suspend(); + } + catch( CDIException e ) { + restoreOldState(); + targetRequestFailed( e.getMessage(), null ); + } } protected boolean isSuspending() { @@ -736,23 +706,13 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv return; } changeState( CDebugElementState.DISCONNECTING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - getCDITarget().disconnect(); - } - catch( CDIException e ) { - restoreOldState(); - try { - targetRequestFailed( e.getMessage(), e ); - } - catch( DebugException e1 ) { - failed( CoreModelMessages.getString( "CDebugTarget.5" ), e1 ); //$NON-NLS-1$ - } - } - } - } ); + try { + getCDITarget().disconnect(); + } + catch( CDIException e ) { + restoreOldState(); + targetRequestFailed( e.getMessage(), null ); + } } /* (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 9e1f565309b..be49aebe8f7 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 @@ -50,7 +50,6 @@ import org.eclipse.core.runtime.MultiStatus; import org.eclipse.core.runtime.Status; import org.eclipse.debug.core.DebugEvent; 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.IMemoryBlockRetrieval; 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 { if ( !canResume() ) return; - final CDebugElementState oldState = getState(); + CDebugElementState oldState = getState(); setState( CDebugElementState.RESUMING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - getCDIThread().resume( false ); - } - catch( CDIException e ) { - setState( oldState ); - failed( CoreModelMessages.getString( "CThread.2" ), e ); //$NON-NLS-1$ - } - } - } ); + try { + getCDIThread().resume( false ); + } + catch( CDIException e ) { + setState( oldState ); + targetRequestFailed( e.getMessage(), null ); + } } /* (non-Javadoc) @@ -427,20 +421,15 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum public void suspend() throws DebugException { if ( !canSuspend() ) return; - final CDebugElementState oldState = getState(); + CDebugElementState oldState = getState(); setState( CDebugElementState.SUSPENDING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - getCDITarget().suspend(); - } - catch( CDIException e ) { - setState( oldState ); - failed( CoreModelMessages.getString( "CThread.3" ), e ); //$NON-NLS-1$ - } - } - } ); + try { + getCDITarget().suspend(); + } + catch( CDIException e ) { + setState( oldState ); + targetRequestFailed( e.getMessage(), null ); + } } /* (non-Javadoc) @@ -492,25 +481,20 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum public void stepInto() throws DebugException { if ( !canStepInto() ) return; - final CDebugElementState oldState = getState(); + CDebugElementState oldState = getState(); setState( CDebugElementState.STEPPING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - if ( !isInstructionsteppingEnabled() ) { - getCDIThread().stepInto( 1 ); - } - else { - getCDIThread().stepIntoInstruction( 1 ); - } - } - catch( CDIException e ) { - setState( oldState ); - failed( CoreModelMessages.getString( "CThread.4" ), e ); //$NON-NLS-1$ - } + try { + if ( !isInstructionsteppingEnabled() ) { + getCDIThread().stepInto( 1 ); } - } ); + else { + getCDIThread().stepIntoInstruction( 1 ); + } + } + catch( CDIException e ) { + setState( oldState ); + targetRequestFailed( e.getMessage(), null ); + } } /* (non-Javadoc) @@ -519,25 +503,20 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum public void stepOver() throws DebugException { if ( !canStepOver() ) return; - final CDebugElementState oldState = getState(); + CDebugElementState oldState = getState(); setState( CDebugElementState.STEPPING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - if ( !isInstructionsteppingEnabled() ) { - getCDIThread().stepOver( 1 ); - } - else { - getCDIThread().stepOverInstruction( 1 ); - } - } - catch( CDIException e ) { - setState( oldState ); - failed( CoreModelMessages.getString( "CThread.5" ), e ); //$NON-NLS-1$ - } + try { + if ( !isInstructionsteppingEnabled() ) { + getCDIThread().stepOver( 1 ); } - } ); + else { + getCDIThread().stepOverInstruction( 1 ); + } + } + catch( CDIException e ) { + setState( oldState ); + targetRequestFailed( e.getMessage(), null ); + } } /* (non-Javadoc) @@ -549,21 +528,16 @@ public class CThread extends CDebugElement implements ICThread, IRestart, IResum IStackFrame[] frames = getStackFrames(); if ( frames.length == 0 ) return; - final CStackFrame f = (CStackFrame)frames[0]; - final CDebugElementState oldState = getState(); + CStackFrame f = (CStackFrame)frames[0]; + CDebugElementState oldState = getState(); setState( CDebugElementState.STEPPING ); - DebugPlugin.getDefault().asyncExec( new Runnable() { - - public void run() { - try { - f.doStepReturn(); - } - catch( DebugException e ) { - setState( oldState ); - failed( CoreModelMessages.getString( "CThread.6" ), e ); //$NON-NLS-1$ - } - } - } ); + try { + f.doStepReturn(); + } + catch( DebugException e ) { + setState( oldState ); + throw e; + } } /* (non-Javadoc) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CoreModelMessages.properties b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CoreModelMessages.properties index 7b5523c516c..9e8f1157a02 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CoreModelMessages.properties +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CoreModelMessages.properties @@ -23,11 +23,6 @@ CModificationVariable.1=Unable to set value. CStackFrame.0={0} at {1}: {2} CThread.0=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} CVariable.0=not available: {0} CVariable.1=not available: {0}