diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java index 28adaff6fb0..6e60d37118c 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/CDebugModel.java @@ -6,8 +6,13 @@ package org.eclipse.cdt.debug.core; +import java.text.MessageFormat; + import org.eclipse.cdt.debug.core.cdi.CDIException; +import org.eclipse.cdt.debug.core.cdi.ICDIBreakpoint; +import org.eclipse.cdt.debug.core.cdi.ICDILocation; import org.eclipse.cdt.debug.core.cdi.model.ICDITarget; +import org.eclipse.cdt.debug.internal.core.CDebugElement; import org.eclipse.cdt.debug.internal.core.CDebugTarget; import org.eclipse.core.resources.IWorkspaceRunnable; import org.eclipse.core.resources.ResourcesPlugin; @@ -18,8 +23,6 @@ import org.eclipse.debug.core.ILaunch; import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IProcess; - - /** * * Provides utility methods for creating debug sessions, targets and @@ -99,15 +102,25 @@ public class CDebugModel { CDebugCorePlugin.log( e ); } - + // Temporary if ( stopInMain ) - breakInMain( cdiTarget ); + { + ICDILocation location = cdiTarget.getSession().getSourceManager().createLocation( "", "main", 0 ); + try + { + ICDIBreakpoint bkpt = cdiTarget.getSession().getBreakpointManager(). + setLocationBreakpoint( ICDIBreakpoint.TEMPORARY, + location, + null, + null ); + } + catch( CDIException e ) + { + ((CDebugElement)target[0]).targetRequestFailed( MessageFormat.format( "{0} occurred setting temporary breakpoint.", new String[] { e.toString() } ), e ); + } + } target[0].resume(); return target[0]; } - - private static void breakInMain( ICDITarget cdiTarget ) throws DebugException - { - } }