1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +02:00

Changed the creation of debug target.

This commit is contained in:
Mikhail Khodjaiants 2002-08-13 20:34:20 +00:00
parent e1c79c7850
commit f406e39bde
2 changed files with 14 additions and 9 deletions

View file

@ -6,12 +6,14 @@
package org.eclipse.cdt.debug.core;
import org.eclipse.cdt.debug.core.cdi.CDIException;
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
import org.eclipse.cdt.debug.internal.core.CDebugTarget;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.ILaunch;
import org.eclipse.debug.core.model.IDebugTarget;
import org.eclipse.debug.core.model.IProcess;
@ -74,7 +76,7 @@ public class CDebugModel
final IProcess process,
final boolean allowTerminate,
final boolean allowDisconnect,
final boolean resume )
final boolean stopInMain ) throws DebugException
{
final IDebugTarget[] target = new IDebugTarget[1];
IWorkspaceRunnable r = new IWorkspaceRunnable()
@ -86,8 +88,7 @@ public class CDebugModel
name,
process,
allowTerminate,
allowDisconnect,
resume );
allowDisconnect );
}
};
try
@ -98,6 +99,15 @@ public class CDebugModel
{
CDebugCorePlugin.log( e );
}
if ( stopInMain )
breakInMain( cdiTarget );
target[0].resume();
return target[0];
}
private static void breakInMain( ICDITarget cdiTarget ) throws DebugException
{
}
}

View file

@ -154,8 +154,7 @@ public class CDebugTarget extends CDebugElement
String name,
IProcess process,
boolean allowsTerminate,
boolean allowsDisconnect,
boolean resume )
boolean allowsDisconnect )
{
super( null );
setLaunch( launch );
@ -402,12 +401,10 @@ public class CDebugTarget extends CDebugElement
setSuspended( false );
getCDITarget().resume();
resumeThreads();
fireResumeEvent( DebugEvent.CLIENT_REQUEST );
}
catch( CDIException e )
{
setSuspended( true );
fireSuspendEvent( DebugEvent.CLIENT_REQUEST );
targetRequestFailed( MessageFormat.format( "{0} occurred resuming target.", new String[] { e.toString() } ), e );
}
}
@ -424,14 +421,12 @@ public class CDebugTarget extends CDebugElement
try
{
setSuspended( true );
fireSuspendEvent( DebugEvent.CLIENT_REQUEST );
getCDITarget().suspend();
suspendThreads();
}
catch( CDIException e )
{
setSuspended( false );
fireResumeEvent( DebugEvent.CLIENT_REQUEST );
targetRequestFailed( MessageFormat.format( "{0} occurred suspending target.", new String[] { e.toString()} ), e );
}
}