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

More implementation of breakpoints.

This commit is contained in:
Mikhail Khodjaiants 2002-09-04 15:43:56 +00:00
parent 0b134d6140
commit 3496b65bc6
4 changed files with 76 additions and 41 deletions

View file

@ -29,16 +29,16 @@
value="true">
</persistent>
<attribute
name="condition">
name="org.eclipse.cdt.debug.core.condition">
</attribute>
<attribute
name="ignoreCount">
name="org.eclipse.cdt.debug.core.ignoreCount">
</attribute>
<attribute
name="threadId">
name="org.eclipse.cdt.debug.core.threadId">
</attribute>
<attribute
name="installCount">
name="org.eclipse.cdt.debug.core.installCount">
</attribute>
</extension>
<extension
@ -74,7 +74,7 @@
value="true">
</persistent>
<attribute
name="address">
name="org.eclipse.cdt.debug.core.address">
</attribute>
</extension>
<extension
@ -87,7 +87,7 @@
value="true">
</persistent>
<attribute
name="function">
name="org.eclipse.cdt.debug.core.function">
</attribute>
</extension>
<extension
@ -100,7 +100,7 @@
value="true">
</persistent>
<attribute
name="expression">
name="org.eclipse.cdt.debug.core.expression">
</attribute>
</extension>
<extension

View file

@ -24,13 +24,33 @@ import org.eclipse.debug.core.model.IBreakpoint;
*/
public interface ICBreakpoint extends IBreakpoint
{
/*
* C Breakpoint attributes
/**
* Breakpoint attribute storing the number of debug targets a
* breakpoint is installed in (value <code>"org.eclipse.cdt.debug.core.installCount"</code>).
* This attribute is a <code>int</code>.
*/
public static final String CONDITION = "condition"; //$NON-NLS-1$
public static final String IGNORE_COUNT = "ignoreCount"; //$NON-NLS-1$
public static final String THREAD_ID = "threadId"; //$NON-NLS-1$
public static final String INSTALL_COUNT = "installCount"; //$NON-NLS-1$
public static final String INSTALL_COUNT = "org.eclipse.cdt.debug.core.installCount"; //$NON-NLS-1$
/**
* Breakpoint attribute storing the the conditional expression
* associated with this breakpoint (value <code>"org.eclipse.cdt.debug.core.condition"</code>).
* This attribute is a <code>String</code>.
*/
public static final String CONDITION = "org.eclipse.cdt.debug.core.condition"; //$NON-NLS-1$
/**
* Breakpoint attribute storing a breakpoint's ignore count value
* (value <code>"org.eclipse.cdt.debug.core.ignoreCount"</code>).
* This attribute is a <code>int</code>.
*/
public static final String IGNORE_COUNT = "org.eclipse.cdt.debug.core.ignoreCount"; //$NON-NLS-1$
/**
* Breakpoint attribute storing an identifier of the thread this
* breakpoint is restricted in (value <code>"org.eclipse.cdt.debug.core.threadId"</code>).
* This attribute is a <code>String</code>.
*/
public static final String THREAD_ID = "org.eclipse.cdt.debug.core.threadId"; //$NON-NLS-1$
/**
* Returns whether this breakpoint is installed in at least

View file

@ -33,34 +33,6 @@ public abstract class CBreakpoint extends Breakpoint
implements ICBreakpoint,
IDebugEventSetListener
{
/**
* Breakpoint attribute storing the number of debug targets a
* breakpoint is installed in (value <code>"org.eclipse.cdt.debug.core.installCount"</code>).
* This attribute is a <code>int</code>.
*/
protected static final String INSTALL_COUNT = "org.eclipse.cdt.debug.core.installCount"; //$NON-NLS-1$
/**
* Breakpoint attribute storing the the conditional expression
* associated with this breakpoint (value <code>"org.eclipse.cdt.debug.core.condition"</code>).
* This attribute is a <code>String</code>.
*/
protected static final String CONDITION = "org.eclipse.cdt.debug.core.condition"; //$NON-NLS-1$
/**
* Breakpoint attribute storing a breakpoint's ignore count value
* (value <code>"org.eclipse.cdt.debug.core.ignoreCount"</code>).
* This attribute is a <code>int</code>.
*/
protected static final String IGNORE_COUNT = "org.eclipse.cdt.debug.core.ignoreCount"; //$NON-NLS-1$
/**
* Breakpoint attribute storing an identifier of the thread this
* breakpoint is restricted in (value <code>"org.eclipse.cdt.debug.core.threadId"</code>).
* This attribute is a <code>String</code>.
*/
protected static final String THREAD_ID = "org.eclipse.cdt.debug.core.threadId"; //$NON-NLS-1$
/**
* Constructor for CBreakpoint.
*/

View file

@ -573,6 +573,15 @@ public class CDebugTarget extends CDebugElement
*/
public void breakpointChanged( IBreakpoint breakpoint, IMarkerDelta delta )
{
try
{
if ( breakpoint instanceof CBreakpoint )
changeBreakpointProperties( (CBreakpoint)breakpoint, delta );
}
catch( DebugException e )
{
CDebugCorePlugin.log( e );
}
}
/**
@ -1031,6 +1040,40 @@ public class CDebugTarget extends CDebugElement
}
}
protected void changeBreakpointProperties( CBreakpoint breakpoint, IMarkerDelta delta ) throws DebugException
{
ICDIBreakpoint cdiBreakpoint = findCDIBreakpoint( breakpoint );
if ( cdiBreakpoint == null )
return;
ICDIBreakpointManager bm = getCDISession().getBreakpointManager();
try
{
boolean enabled = breakpoint.isEnabled();
boolean oldEnabled = delta.getAttribute( IBreakpoint.ENABLED, true );
int ignoreCount = breakpoint.getIgnoreCount();
int oldIgnoreCount = delta.getAttribute( ICBreakpoint.IGNORE_COUNT, 0 );
String condition = breakpoint.getCondition();
String oldCondition = delta.getAttribute( ICBreakpoint.CONDITION, "" );
if ( enabled != oldEnabled )
{
cdiBreakpoint.setEnabled( enabled );
}
if ( ignoreCount != oldIgnoreCount || !condition.equals( oldCondition ) )
{
ICDICondition cdiCondition = bm.createCondition( ignoreCount, condition );
cdiBreakpoint.setCondition( cdiCondition );
}
}
catch( CoreException ce )
{
requestFailed( "Operation failed. Reason: ", ce );
}
catch( CDIException e )
{
requestFailed( "Operation failed. Reason: ", e );
}
}
/**
* Creates, adds and returns a thread for the given underlying
* CDI thread. A creation event is fired for the thread.