mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
Refactoring to use "BreakpointEvent" instead of "Catchpoint" to be consistent with how we refer to the feature at the UI level.
This commit is contained in:
parent
21bce066fd
commit
a602cd1826
29 changed files with 175 additions and 172 deletions
|
@ -19,13 +19,13 @@ import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
||||||
* A breakpoint is capable of suspending the execution of a program
|
* A breakpoint is capable of suspending the execution of a program
|
||||||
* whenever a certain point in the program is reached. Provides a
|
* whenever a certain point in the program is reached. Provides a
|
||||||
* basic functionality for the location breakpoints, watchpoints,
|
* basic functionality for the location breakpoints, watchpoints,
|
||||||
* and catchpoints.
|
* and event breakpoints
|
||||||
*
|
*
|
||||||
* @see ICDILineBreakpoint
|
* @see ICDILineBreakpoint
|
||||||
* @see ICDIFunctionBreakpoint
|
* @see ICDIFunctionBreakpoint
|
||||||
* @see ICDIAddressBreakpoint
|
* @see ICDIAddressBreakpoint
|
||||||
* @see ICDIWatchpoint
|
* @see ICDIWatchpoint
|
||||||
* @see ICDICatchpoint
|
* @see ICDIEventBreakpoint
|
||||||
*
|
*
|
||||||
* @since Jul 9, 2002
|
* @since Jul 9, 2002
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -17,11 +17,11 @@ import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
||||||
|
|
||||||
public interface ICDIBreakpointManagement3 extends ICDIBreakpointManagement2{
|
public interface ICDIBreakpointManagement3 extends ICDIBreakpointManagement2{
|
||||||
/**
|
/**
|
||||||
* Set a catchpoint
|
* Set an event breakpoint
|
||||||
* @param type - catchpoint type, interpreted by backend
|
* @param type - event breakpoint type, interpreted by backend
|
||||||
* @param arg - extra argument, for example signal number
|
* @param arg - extra argument, for example signal number
|
||||||
* @param cdiBreakpointType - cdi breakpoint type, just in case some inferiors support "hardware" catchpoints
|
* @param cdiBreakpointType - cdi breakpoint type, just in case some inferiors support "hardware" event breakpoints
|
||||||
*/
|
*/
|
||||||
ICDICatchpoint setCatchpoint(String type, String arg, int cdiBreakpointType,
|
ICDIEventBreakpoint setEventBreakpoint(String type, String arg, int cdiBreakpointType,
|
||||||
ICDICondition condition, boolean deferred, boolean enabled) throws CDIException;
|
ICDICondition condition, boolean deferred, boolean enabled) throws CDIException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,10 @@ package org.eclipse.cdt.debug.core.cdi.model;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
public interface ICDICatchpoint extends ICDIBreakpoint {
|
public interface ICDIEventBreakpoint extends ICDIBreakpoint {
|
||||||
/**
|
/**
|
||||||
* Get catchpoint type. This is usually id in reverse web notation.
|
* Get event breakpoint type. This is usually id in reverse web notation.
|
||||||
* @return catchpoint type id
|
* @return event breakpoint type id
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
String getEventType() throws CoreException;
|
String getEventType() throws CoreException;
|
|
@ -21,7 +21,7 @@ cLineBreakpoints.name=C/C++ Line Breakpoints
|
||||||
cAddressBreakpoints.name=C/C++ Address Breakpoints
|
cAddressBreakpoints.name=C/C++ Address Breakpoints
|
||||||
cFunctionBreakpoints.name=C/C++ Function Breakpoints
|
cFunctionBreakpoints.name=C/C++ Function Breakpoints
|
||||||
cWatchpoints.name=C/C++ Watchpoints
|
cWatchpoints.name=C/C++ Watchpoints
|
||||||
cCatchpoints.name=C/C++ Event Breakpoints
|
cEventBreakpoints.name=C/C++ Event Breakpoints
|
||||||
breakpointProblem.name=C/C++ Breakpoint Problem
|
breakpointProblem.name=C/C++ Breakpoint Problem
|
||||||
|
|
||||||
containerName.mapping=Path Mapping
|
containerName.mapping=Path Mapping
|
||||||
|
|
|
@ -106,7 +106,7 @@
|
||||||
</attribute>
|
</attribute>
|
||||||
</extension>
|
</extension>
|
||||||
<extension
|
<extension
|
||||||
id="cCatchpointMarker"
|
id="cEventBreakpointMarker"
|
||||||
point="org.eclipse.core.resources.markers">
|
point="org.eclipse.core.resources.markers">
|
||||||
<super
|
<super
|
||||||
type="org.eclipse.cdt.debug.core.cBreakpointMarker">
|
type="org.eclipse.cdt.debug.core.cBreakpointMarker">
|
||||||
|
@ -115,10 +115,10 @@
|
||||||
value="true">
|
value="true">
|
||||||
</persistent>
|
</persistent>
|
||||||
<attribute
|
<attribute
|
||||||
name="org.eclipse.cdt.debug.core.catchpoint_event_id">
|
name="org.eclipse.cdt.debug.core.eventbreakpoint_event_id">
|
||||||
</attribute>
|
</attribute>
|
||||||
<attribute
|
<attribute
|
||||||
name="org.eclipse.cdt.debug.core.catchpoint_event_arg">
|
name="org.eclipse.cdt.debug.core.eventbreakpoint_event_arg">
|
||||||
</attribute>
|
</attribute>
|
||||||
</extension>
|
</extension>
|
||||||
<extension
|
<extension
|
||||||
|
@ -163,10 +163,10 @@
|
||||||
id="cWatchpoint">
|
id="cWatchpoint">
|
||||||
</breakpoint>
|
</breakpoint>
|
||||||
<breakpoint
|
<breakpoint
|
||||||
class="org.eclipse.cdt.debug.internal.core.breakpoints.CCatchpoint"
|
class="org.eclipse.cdt.debug.internal.core.breakpoints.CEventBreakpoint"
|
||||||
name="%cCatchpoint.name"
|
name="%cEventBreakpoint.name"
|
||||||
markerType="org.eclipse.cdt.debug.core.cCatchpointMarker"
|
markerType="org.eclipse.cdt.debug.core.cEventBreakpointMarker"
|
||||||
id="cCatchpoint">
|
id="cEventBreakpoint">
|
||||||
</breakpoint>
|
</breakpoint>
|
||||||
</extension>
|
</extension>
|
||||||
<extension
|
<extension
|
||||||
|
|
|
@ -27,13 +27,13 @@ import org.eclipse.cdt.core.IBinaryParser.IBinaryObject;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDITarget;
|
||||||
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICCatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICWatchpoint2;
|
import org.eclipse.cdt.debug.core.model.ICWatchpoint2;
|
||||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CAddressBreakpoint;
|
import org.eclipse.cdt.debug.internal.core.breakpoints.CAddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CCatchpoint;
|
import org.eclipse.cdt.debug.internal.core.breakpoints.CEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CFunctionBreakpoint;
|
import org.eclipse.cdt.debug.internal.core.breakpoints.CFunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CLineBreakpoint;
|
import org.eclipse.cdt.debug.internal.core.breakpoints.CLineBreakpoint;
|
||||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CWatchpoint;
|
import org.eclipse.cdt.debug.internal.core.breakpoints.CWatchpoint;
|
||||||
|
@ -589,16 +589,16 @@ public class CDIDebugModel {
|
||||||
return handle1.equals( handle2 );
|
return handle1.equals( handle2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ICCatchpoint catchpointExists(String type, String arg ) throws CoreException {
|
public static ICEventBreakpoint eventBreakpointExists(String type, String arg ) throws CoreException {
|
||||||
String modelId = getPluginIdentifier();
|
String modelId = getPluginIdentifier();
|
||||||
|
|
||||||
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
|
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
|
||||||
IBreakpoint[] breakpoints = manager.getBreakpoints(modelId);
|
IBreakpoint[] breakpoints = manager.getBreakpoints(modelId);
|
||||||
for (int i = 0; i < breakpoints.length; i++) {
|
for (int i = 0; i < breakpoints.length; i++) {
|
||||||
if (!(breakpoints[i] instanceof ICCatchpoint)) {
|
if (!(breakpoints[i] instanceof ICEventBreakpoint)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ICCatchpoint breakpoint = (ICCatchpoint) breakpoints[i];
|
ICEventBreakpoint breakpoint = (ICEventBreakpoint) breakpoints[i];
|
||||||
|
|
||||||
if (breakpoint.getEventType().equals(type)) {
|
if (breakpoint.getEventType().equals(type)) {
|
||||||
String arg1 = breakpoint.getEventArgument();
|
String arg1 = breakpoint.getEventArgument();
|
||||||
|
@ -612,7 +612,7 @@ public class CDIDebugModel {
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public static ICCatchpoint createCatchpoint(String type, String arg, boolean register)
|
public static ICEventBreakpoint createEventBreakpoint(String type, String arg, boolean register)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
final IResource resource = ResourcesPlugin.getWorkspace().getRoot();
|
final IResource resource = ResourcesPlugin.getWorkspace().getRoot();
|
||||||
final Map<String,Object> attributes = new HashMap<String,Object>();
|
final Map<String,Object> attributes = new HashMap<String,Object>();
|
||||||
|
@ -620,9 +620,9 @@ public class CDIDebugModel {
|
||||||
attributes.put(IBreakpoint.ENABLED, true);
|
attributes.put(IBreakpoint.ENABLED, true);
|
||||||
attributes.put(ICBreakpoint.IGNORE_COUNT, 0);
|
attributes.put(ICBreakpoint.IGNORE_COUNT, 0);
|
||||||
attributes.put(ICBreakpoint.CONDITION, "");
|
attributes.put(ICBreakpoint.CONDITION, "");
|
||||||
attributes.put(ICCatchpoint.EVENT_TYPE_ID, type);
|
attributes.put(ICEventBreakpoint.EVENT_TYPE_ID, type);
|
||||||
attributes.put(ICCatchpoint.EVENT_ARG, arg);
|
attributes.put(ICEventBreakpoint.EVENT_ARG, arg);
|
||||||
return new CCatchpoint(resource, attributes, register);
|
return new CEventBreakpoint(resource, attributes, register);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,32 +15,30 @@ package org.eclipse.cdt.debug.core.model;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for debugger catchpoints (event breakpoints). Example of catchpoint
|
* Interface for debugger event breakpoints. Example of event breakpoint
|
||||||
* is break on raising exception in C++, or break on receiving signal.
|
* is break on raising exception in C++, or break on receiving signal.
|
||||||
*
|
*
|
||||||
* @sinse 5.0
|
* @sinse 5.0
|
||||||
*/
|
*/
|
||||||
public interface ICCatchpoint extends ICBreakpoint {
|
public interface ICEventBreakpoint extends ICBreakpoint {
|
||||||
/**
|
/**
|
||||||
* Breakpoint attribute storing the catchpoint event id
|
* Breakpoint attribute storing the event breakpoint event id
|
||||||
* is set in (value <code>"org.eclipse.cdt.debug.core.catchpoint.event_id"</code>).
|
|
||||||
* This attribute is a <code>String</code>.
|
* This attribute is a <code>String</code>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static final String EVENT_TYPE_ID = "org.eclipse.cdt.debug.core.catchpoint_event_id"; //$NON-NLS-1$
|
public static final String EVENT_TYPE_ID = "org.eclipse.cdt.debug.core.eventbreakpoint_event_id"; //$NON-NLS-1$
|
||||||
/**
|
/**
|
||||||
* Breakpoint attribute storing the catchpoint event argument
|
* Breakpoint attribute storing the event breakpoint argument
|
||||||
* is set in (value <code>"org.eclipse.cdt.debug.core.catchpoint.event_arg"</code>).
|
|
||||||
* This attribute is a <code>String</code>.
|
* This attribute is a <code>String</code>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static final String EVENT_ARG = "org.eclipse.cdt.debug.core.catchpoint_event_arg"; //$NON-NLS-1$
|
public static final String EVENT_ARG = "org.eclipse.cdt.debug.core.eventbreakpoint_event_arg"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get catchpoint type. This is usually id in reverse web notation.
|
* Get event breakpoint type. This is usually id in reverse web notation.
|
||||||
* This type is interpreted by underlying debugger implementation.
|
* This type is interpreted by underlying debugger implementation.
|
||||||
* Use extension point <code>org.eclipse.cdt.debug.ui.breakpointContribution</code> to define user visible label for this event type.
|
* Use extension point <code>org.eclipse.cdt.debug.ui.breakpointContribution</code> to define user visible label for this event type.
|
||||||
* @return catchpoint type id (not null)
|
* @return event breakpoint type id (not null)
|
||||||
* @throws CoreException
|
* @throws CoreException
|
||||||
*/
|
*/
|
||||||
String getEventType() throws CoreException;
|
String getEventType() throws CoreException;
|
|
@ -51,7 +51,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement2;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement2;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement3;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement3;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint;
|
||||||
|
@ -64,7 +64,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIWatchpoint2;
|
||||||
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpointFilterExtension;
|
import org.eclipse.cdt.debug.core.model.ICBreakpointFilterExtension;
|
||||||
import org.eclipse.cdt.debug.core.model.ICCatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
import org.eclipse.cdt.debug.core.model.ICDebugTarget;
|
||||||
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
||||||
|
@ -255,11 +255,11 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( breakpoint instanceof ICCatchpoint && cdiBreakpoint instanceof ICDICatchpoint) {
|
if ( breakpoint instanceof ICEventBreakpoint && cdiBreakpoint instanceof ICDIEventBreakpoint) {
|
||||||
ICCatchpoint mcatchpoint = (ICCatchpoint) breakpoint;
|
ICEventBreakpoint mevtbkpt = (ICEventBreakpoint) breakpoint;
|
||||||
ICDICatchpoint cdicatchpoint = (ICDICatchpoint) cdiBreakpoint;
|
ICDIEventBreakpoint cdievtbkpt = (ICDIEventBreakpoint) cdiBreakpoint;
|
||||||
if (!mcatchpoint.getEventType().equals(cdicatchpoint.getEventType())) return false;
|
if (!mevtbkpt.getEventType().equals(cdievtbkpt.getEventType())) return false;
|
||||||
return (mcatchpoint.getEventArgument().equals(cdicatchpoint.getExtraArgument()));
|
return (mevtbkpt.getEventArgument().equals(cdievtbkpt.getExtraArgument()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
|
@ -461,8 +461,8 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
private void handleBreakpointCreatedEvent( ICDIBreakpoint cdiBreakpoint ) {
|
private void handleBreakpointCreatedEvent( ICDIBreakpoint cdiBreakpoint ) {
|
||||||
if ( cdiBreakpoint instanceof ICDIWatchpoint )
|
if ( cdiBreakpoint instanceof ICDIWatchpoint )
|
||||||
doHandleWatchpointCreatedEvent( (ICDIWatchpoint)cdiBreakpoint );
|
doHandleWatchpointCreatedEvent( (ICDIWatchpoint)cdiBreakpoint );
|
||||||
if ( cdiBreakpoint instanceof ICDICatchpoint )
|
if ( cdiBreakpoint instanceof ICDIEventBreakpoint )
|
||||||
doHandleCatachpointCreatedEvent( (ICDICatchpoint)cdiBreakpoint );
|
doHandleCatachpointCreatedEvent( (ICDIEventBreakpoint)cdiBreakpoint );
|
||||||
else if ( cdiBreakpoint instanceof ICDILocationBreakpoint )
|
else if ( cdiBreakpoint instanceof ICDILocationBreakpoint )
|
||||||
doHandleLocationBreakpointCreatedEvent( (ICDILocationBreakpoint)cdiBreakpoint );
|
doHandleLocationBreakpointCreatedEvent( (ICDILocationBreakpoint)cdiBreakpoint );
|
||||||
if ( !cdiBreakpoint.isTemporary() && !DebugPlugin.getDefault().getBreakpointManager().isEnabled() ) {
|
if ( !cdiBreakpoint.isTemporary() && !DebugPlugin.getDefault().getBreakpointManager().isEnabled() ) {
|
||||||
|
@ -470,13 +470,13 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doHandleCatachpointCreatedEvent(ICDICatchpoint cdiCatchpoint) {
|
private void doHandleCatachpointCreatedEvent(ICDIEventBreakpoint cdiEventBkpt) {
|
||||||
ICBreakpoint breakpoint = null;
|
ICBreakpoint breakpoint = null;
|
||||||
synchronized( getBreakpointMap() ) {
|
synchronized( getBreakpointMap() ) {
|
||||||
breakpoint = getBreakpointMap().getCBreakpoint( cdiCatchpoint );
|
breakpoint = getBreakpointMap().getCBreakpoint( cdiEventBkpt );
|
||||||
if ( breakpoint == null ) {
|
if ( breakpoint == null ) {
|
||||||
try {
|
try {
|
||||||
breakpoint = createCatchpoint( cdiCatchpoint );
|
breakpoint = createEventBreakpoint( cdiEventBkpt );
|
||||||
}
|
}
|
||||||
catch( CDIException e ) {
|
catch( CDIException e ) {
|
||||||
}
|
}
|
||||||
|
@ -484,7 +484,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( breakpoint != null )
|
if ( breakpoint != null )
|
||||||
getBreakpointMap().put( breakpoint, cdiCatchpoint );
|
getBreakpointMap().put( breakpoint, cdiEventBkpt );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( breakpoint != null ) {
|
if ( breakpoint != null ) {
|
||||||
|
@ -496,7 +496,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
catch( CoreException e ) {
|
catch( CoreException e ) {
|
||||||
}
|
}
|
||||||
getBreakpointNotifier().breakpointInstalled( getDebugTarget(), breakpoint );
|
getBreakpointNotifier().breakpointInstalled( getDebugTarget(), breakpoint );
|
||||||
changeBreakpointProperties( breakpoint, cdiCatchpoint );
|
changeBreakpointProperties( breakpoint, cdiEventBkpt );
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -821,12 +821,12 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
} else {
|
} else {
|
||||||
b = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
b = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
||||||
}
|
}
|
||||||
} else if (breakpoints[i] instanceof ICCatchpoint) {
|
} else if (breakpoints[i] instanceof ICEventBreakpoint) {
|
||||||
ICCatchpoint catchpoint = (ICCatchpoint) breakpoints[i];
|
ICEventBreakpoint eventbkpt = (ICEventBreakpoint) breakpoints[i];
|
||||||
ICDICondition condition = createCondition(catchpoint);
|
ICDICondition condition = createCondition(eventbkpt);
|
||||||
if (cdiTarget instanceof ICDIBreakpointManagement3) {
|
if (cdiTarget instanceof ICDIBreakpointManagement3) {
|
||||||
ICDIBreakpointManagement3 bpManager3 = (ICDIBreakpointManagement3) cdiTarget;
|
ICDIBreakpointManagement3 bpManager3 = (ICDIBreakpointManagement3) cdiTarget;
|
||||||
b = bpManager3.setCatchpoint(catchpoint.getEventType(), catchpoint
|
b = bpManager3.setEventBreakpoint(eventbkpt.getEventType(), eventbkpt
|
||||||
.getEventArgument(), ICDIBreakpoint.REGULAR, condition, true, breakpoints[i].isEnabled());
|
.getEventArgument(), ICDIBreakpoint.REGULAR, condition, true, breakpoints[i].isEnabled());
|
||||||
} else {
|
} else {
|
||||||
throw new UnsupportedOperationException("BreakpointManager does not support this type of breapoints");
|
throw new UnsupportedOperationException("BreakpointManager does not support this type of breapoints");
|
||||||
|
@ -1008,17 +1008,17 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
||||||
return watchpoint;
|
return watchpoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
private ICCatchpoint createCatchpoint(ICDICatchpoint cdiCatchpoint) throws CDIException,
|
private ICEventBreakpoint createEventBreakpoint(ICDIEventBreakpoint cdiEventBkpt) throws CDIException,
|
||||||
CoreException {
|
CoreException {
|
||||||
|
|
||||||
ICCatchpoint catchpoint;
|
ICEventBreakpoint eventBkpt;
|
||||||
catchpoint = CDIDebugModel.catchpointExists(cdiCatchpoint.getEventType(), cdiCatchpoint
|
eventBkpt = CDIDebugModel.eventBreakpointExists(cdiEventBkpt.getEventType(), cdiEventBkpt
|
||||||
.getExtraArgument());
|
.getExtraArgument());
|
||||||
if (catchpoint != null)
|
if (eventBkpt != null)
|
||||||
return catchpoint;
|
return eventBkpt;
|
||||||
catchpoint = CDIDebugModel.createCatchpoint(cdiCatchpoint.getEventType(), cdiCatchpoint
|
eventBkpt = CDIDebugModel.createEventBreakpoint(cdiEventBkpt.getEventType(), cdiEventBkpt
|
||||||
.getExtraArgument(), false);
|
.getExtraArgument(), false);
|
||||||
return catchpoint;
|
return eventBkpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void changeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) {
|
private void changeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.debug.internal.core.breakpoints;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.model.ICCatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
import org.eclipse.core.resources.IMarker;
|
import org.eclipse.core.resources.IMarker;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IWorkspaceRunnable;
|
import org.eclipse.core.resources.IWorkspaceRunnable;
|
||||||
|
@ -22,21 +22,21 @@ import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.debug.core.DebugException;
|
import org.eclipse.debug.core.DebugException;
|
||||||
|
|
||||||
public class CCatchpoint extends CBreakpoint implements ICCatchpoint {
|
public class CEventBreakpoint extends CBreakpoint implements ICEventBreakpoint {
|
||||||
|
|
||||||
private static final String C_CATCHPOINT_MARKER_TYPE = "org.eclipse.cdt.debug.core.cCatchpointMarker"; //$NON-NLS-1$;
|
private static final String C_EVENTBREAKPOINT_MARKER_TYPE = "org.eclipse.cdt.debug.core.cEventBreakpointMarker"; //$NON-NLS-1$;
|
||||||
|
|
||||||
public CCatchpoint() {
|
public CEventBreakpoint() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getMarkerType() {
|
public static String getMarkerType() {
|
||||||
return C_CATCHPOINT_MARKER_TYPE;
|
return C_EVENTBREAKPOINT_MARKER_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CCatchpoint(IResource resource, Map attributes, boolean add) throws CoreException {
|
public CEventBreakpoint(IResource resource, Map<String, Object> attributes, boolean add) throws CoreException {
|
||||||
this();
|
this();
|
||||||
// catchpoint must set non null EVENT_TYPE_ID property to be valid
|
// event breakpoint must set non null EVENT_TYPE_ID property to be valid
|
||||||
if (attributes.get(EVENT_TYPE_ID) == null)
|
if (attributes.get(EVENT_TYPE_ID) == null)
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
setBreakpointMarker(resource, getMarkerType(), attributes, add);
|
setBreakpointMarker(resource, getMarkerType(), attributes, add);
|
||||||
|
@ -44,7 +44,7 @@ public class CCatchpoint extends CBreakpoint implements ICCatchpoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setBreakpointMarker(final IResource resource, final String markerType,
|
private void setBreakpointMarker(final IResource resource, final String markerType,
|
||||||
final Map attributes, final boolean add) throws DebugException {
|
final Map<String, Object> attributes, final boolean add) throws DebugException {
|
||||||
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
|
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
|
||||||
|
|
||||||
public void run(IProgressMonitor monitor) throws CoreException {
|
public void run(IProgressMonitor monitor) throws CoreException {
|
||||||
|
@ -68,17 +68,17 @@ public class CCatchpoint extends CBreakpoint implements ICCatchpoint {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ICCatchpoint#getEventType()
|
* @see ICEventBreakpoint#getEventType()
|
||||||
*/
|
*/
|
||||||
public String getEventType() throws DebugException {
|
public String getEventType() throws DebugException {
|
||||||
return ensureMarker().getAttribute(EVENT_TYPE_ID, ""); //$NON-NLS-1$
|
return ensureMarker().getAttribute(EVENT_TYPE_ID, ""); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ICCatchpoint#getEventArgument()
|
* @see ICEventBreakpoint#getEventArgument()
|
||||||
*/
|
*/
|
||||||
public String getEventArgument() throws CoreException {
|
public String getEventArgument() throws CoreException {
|
||||||
return (String) ensureMarker().getAttribute(EVENT_ARG, "");
|
return ensureMarker().getAttribute(EVENT_ARG, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -28,7 +28,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILineLocation;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDILocator;
|
import org.eclipse.cdt.debug.core.cdi.ICDILocator;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint;
|
||||||
|
@ -40,7 +40,7 @@ import org.eclipse.cdt.debug.mi.core.MISession;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.AddressBreakpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.AddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.AddressLocation;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.AddressLocation;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Catchpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.EventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Exceptionpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.Exceptionpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.FunctionBreakpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.FunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.FunctionLocation;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.FunctionLocation;
|
||||||
|
@ -469,13 +469,13 @@ public class BreakpointManager extends Manager {
|
||||||
hint == MIBreakpointChangedEvent.HINT_NONE) && function != null && function.length() > 0) {
|
hint == MIBreakpointChangedEvent.HINT_NONE) && function != null && function.length() > 0) {
|
||||||
FunctionLocation location = createFunctionLocation(file, function);
|
FunctionLocation location = createFunctionLocation(file, function);
|
||||||
newBreakpoint = new FunctionBreakpoint(target, type, location, condition, enabled);
|
newBreakpoint = new FunctionBreakpoint(target, type, location, condition, enabled);
|
||||||
} else if (hint == MIBreakpointChangedEvent.HINT_NEW_CATCHPOINT || Catchpoint.getEventArgumentFromMI(miBreakpoint)!=null) {
|
} else if (hint == MIBreakpointChangedEvent.HINT_NEW_EVENTBREAKPOINT || EventBreakpoint.getEventArgumentFromMI(miBreakpoint)!=null) {
|
||||||
String ctype = Catchpoint.getEventTypeFromMI(miBreakpoint);
|
String ctype = EventBreakpoint.getEventTypeFromMI(miBreakpoint);
|
||||||
if (ctype != null) {
|
if (ctype != null) {
|
||||||
newBreakpoint = new Catchpoint(target, ctype, Catchpoint
|
newBreakpoint = new EventBreakpoint(target, ctype, EventBreakpoint
|
||||||
.getEventArgumentFromMI(miBreakpoint), condition, enabled);
|
.getEventArgumentFromMI(miBreakpoint), condition, enabled);
|
||||||
} else {
|
} else {
|
||||||
MIPlugin.log("Unsupported catchpoint: "+miBreakpoint.getWhat()); //$NON-NLS-1$ log entry not for users
|
MIPlugin.log("Unsupported event breakpoint: "+miBreakpoint.getWhat()); //$NON-NLS-1$ log entry not for users
|
||||||
}
|
}
|
||||||
} else if (addr != null && addr.length() > 0) {
|
} else if (addr != null && addr.length() > 0) {
|
||||||
BigInteger big = MIFormat.getBigInteger(addr);
|
BigInteger big = MIFormat.getBigInteger(addr);
|
||||||
|
@ -1042,20 +1042,20 @@ public class BreakpointManager extends Manager {
|
||||||
}
|
}
|
||||||
return miBreakInserts;
|
return miBreakInserts;
|
||||||
}
|
}
|
||||||
public ICDICatchpoint setCatchpoint(Target target, String type, String arg, ICDICondition condition, boolean enabled) throws CDIException {
|
public ICDIEventBreakpoint setEventBreakpoint(Target target, String type, String arg, ICDICondition condition, boolean enabled) throws CDIException {
|
||||||
Catchpoint catchpoint = new Catchpoint(target,type,arg,condition,enabled);
|
EventBreakpoint eventBkpt = new EventBreakpoint(target,type,arg,condition,enabled);
|
||||||
setCatchpoint(catchpoint);
|
setEventBreakpoint(eventBkpt);
|
||||||
return catchpoint;
|
return eventBkpt;
|
||||||
}
|
}
|
||||||
public void setCatchpoint(Catchpoint catchpoint) throws CDIException {
|
public void setEventBreakpoint(EventBreakpoint eventBkpt) throws CDIException {
|
||||||
Target target = (Target) catchpoint.getTarget();
|
Target target = (Target) eventBkpt.getTarget();
|
||||||
|
|
||||||
MISession miSession = target.getMISession();
|
MISession miSession = target.getMISession();
|
||||||
CommandFactory factory = miSession.getCommandFactory();
|
CommandFactory factory = miSession.getCommandFactory();
|
||||||
CLICatch breakCatch = factory.createCLICatch(catchpoint.getGdbEvent(), catchpoint
|
CLICatch breakCatch = factory.createCLICatch(eventBkpt.getGdbEvent(), eventBkpt
|
||||||
.getGdbArg());
|
.getGdbArg());
|
||||||
|
|
||||||
catchpoint.setMIBreakpoints(new MIBreakpoint[0]); // initialize
|
eventBkpt.setMIBreakpoints(new MIBreakpoint[0]); // initialize
|
||||||
boolean restart = false;
|
boolean restart = false;
|
||||||
try {
|
try {
|
||||||
restart = suspendInferior(target);
|
restart = suspendInferior(target);
|
||||||
|
@ -1072,12 +1072,12 @@ public class BreakpointManager extends Manager {
|
||||||
.getString("cdi.BreakpointManager.Parsing_Error")); //$NON-NLS-1$
|
.getString("cdi.BreakpointManager.Parsing_Error")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
no = points[0].getNumber();
|
no = points[0].getNumber();
|
||||||
catchpoint.setMIBreakpoints(points);
|
eventBkpt.setMIBreakpoints(points);
|
||||||
} catch (MIException e) {
|
} catch (MIException e) {
|
||||||
if (!catchpoint.isDeferred()) {
|
if (!eventBkpt.isDeferred()) {
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
addDeferredBreakpoint(catchpoint);
|
addDeferredBreakpoint(eventBkpt);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1085,7 +1085,7 @@ public class BreakpointManager extends Manager {
|
||||||
String exprCond = null;
|
String exprCond = null;
|
||||||
int ignoreCount = 0;
|
int ignoreCount = 0;
|
||||||
|
|
||||||
ICDICondition condition = catchpoint.getCondition();
|
ICDICondition condition = eventBkpt.getCondition();
|
||||||
if (condition != null) {
|
if (condition != null) {
|
||||||
exprCond = condition.getExpression();
|
exprCond = condition.getExpression();
|
||||||
ignoreCount = condition.getIgnoreCount();
|
ignoreCount = condition.getIgnoreCount();
|
||||||
|
@ -1116,10 +1116,10 @@ public class BreakpointManager extends Manager {
|
||||||
|
|
||||||
|
|
||||||
List bList = getBreakpointsList(target);
|
List bList = getBreakpointsList(target);
|
||||||
bList.add(catchpoint);
|
bList.add(eventBkpt);
|
||||||
|
|
||||||
// Fire a created Event.
|
// Fire a created Event.
|
||||||
MIBreakpoint[] miBreakpoints = catchpoint.getMIBreakpoints();
|
MIBreakpoint[] miBreakpoints = eventBkpt.getMIBreakpoints();
|
||||||
if (miBreakpoints != null && miBreakpoints.length > 0) {
|
if (miBreakpoints != null && miBreakpoints.length > 0) {
|
||||||
miSession.fireEvent(new MIBreakpointCreatedEvent(miSession, miBreakpoints[0]
|
miSession.fireEvent(new MIBreakpointCreatedEvent(miSession, miBreakpoints[0]
|
||||||
.getNumber()));
|
.getNumber()));
|
||||||
|
|
|
@ -31,7 +31,7 @@ import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
||||||
import org.eclipse.cdt.debug.mi.core.MISession;
|
import org.eclipse.cdt.debug.mi.core.MISession;
|
||||||
import org.eclipse.cdt.debug.mi.core.RxThread;
|
import org.eclipse.cdt.debug.mi.core.RxThread;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.Breakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Catchpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.EventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.LocationBreakpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.LocationBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.SharedLibrary;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
||||||
|
@ -152,8 +152,8 @@ public class SharedLibraryManager extends Manager {
|
||||||
bpMgr.setLocationBreakpoint((LocationBreakpoint)bkpt);
|
bpMgr.setLocationBreakpoint((LocationBreakpoint)bkpt);
|
||||||
} else if (bkpt instanceof Watchpoint) {
|
} else if (bkpt instanceof Watchpoint) {
|
||||||
bpMgr.setWatchpoint((Watchpoint)bkpt);
|
bpMgr.setWatchpoint((Watchpoint)bkpt);
|
||||||
} else if (bkpt instanceof Catchpoint) {
|
} else if (bkpt instanceof EventBreakpoint) {
|
||||||
bpMgr.setCatchpoint((Catchpoint)bkpt);
|
bpMgr.setEventBreakpoint((EventBreakpoint)bkpt);
|
||||||
} else {
|
} else {
|
||||||
throw new CDIException();
|
throw new CDIException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,10 @@ import java.util.Arrays;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
|
import org.eclipse.cdt.debug.mi.core.output.MIBreakpoint;
|
||||||
|
|
||||||
public class Catchpoint extends Breakpoint implements ICDICatchpoint {
|
public class EventBreakpoint extends Breakpoint implements ICDIEventBreakpoint {
|
||||||
|
|
||||||
public static final String CATCH = "org.eclipse.cdt.debug.gdb.catch";
|
public static final String CATCH = "org.eclipse.cdt.debug.gdb.catch";
|
||||||
public static final String THROW = "org.eclipse.cdt.debug.gdb.throw";
|
public static final String THROW = "org.eclipse.cdt.debug.gdb.throw";
|
||||||
|
@ -25,7 +25,7 @@ public class Catchpoint extends Breakpoint implements ICDICatchpoint {
|
||||||
private String eventType;
|
private String eventType;
|
||||||
private String arg;
|
private String arg;
|
||||||
|
|
||||||
public Catchpoint(Target target, String event, String arg, ICDICondition cond, boolean enabled) {
|
public EventBreakpoint(Target target, String event, String arg, ICDICondition cond, boolean enabled) {
|
||||||
super(target, ICDIBreakpoint.REGULAR, cond, enabled);
|
super(target, ICDIBreakpoint.REGULAR, cond, enabled);
|
||||||
this.eventType = event;
|
this.eventType = event;
|
||||||
this.arg = arg==null?"":arg;
|
this.arg = arg==null?"":arg;
|
||||||
|
@ -58,24 +58,24 @@ public class Catchpoint extends Breakpoint implements ICDICatchpoint {
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object arg0) {
|
public boolean equals(Object arg0) {
|
||||||
if (this == arg0) return true;
|
if (this == arg0) return true;
|
||||||
if (!(arg0 instanceof Catchpoint)) return false;
|
if (!(arg0 instanceof EventBreakpoint)) return false;
|
||||||
MIBreakpoint[] breakpoints = getMIBreakpoints();
|
MIBreakpoint[] breakpoints = getMIBreakpoints();
|
||||||
if (breakpoints==null || breakpoints.length==0) {
|
if (breakpoints==null || breakpoints.length==0) {
|
||||||
return super.equals(arg0);
|
return super.equals(arg0);
|
||||||
}
|
}
|
||||||
return Arrays.equals(breakpoints, ((Catchpoint)arg0).getMIBreakpoints());
|
return Arrays.equals(breakpoints, ((EventBreakpoint)arg0).getMIBreakpoints());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Returns event type by using miBreakpoint parameters
|
* Returns event type by using miBreakpoint parameters
|
||||||
* @param miBreakpoint
|
* @param miBreakpoint
|
||||||
* @return null if unknown type, null cannot be used to create valid Catchpoint
|
* @return null if unknown type, null cannot be used to create valid EventBreakpoint
|
||||||
*/
|
*/
|
||||||
public static String getEventTypeFromMI(MIBreakpoint miBreakpoint) {
|
public static String getEventTypeFromMI(MIBreakpoint miBreakpoint) {
|
||||||
if (miBreakpoint.getWhat().equals("exception catch")) {
|
if (miBreakpoint.getWhat().equals("exception catch")) {
|
||||||
return
|
return
|
||||||
Catchpoint.CATCH;
|
EventBreakpoint.CATCH;
|
||||||
} else if (miBreakpoint.getWhat().equals("exception throw")) {
|
} else if (miBreakpoint.getWhat().equals("exception throw")) {
|
||||||
return Catchpoint.THROW;
|
return EventBreakpoint.THROW;
|
||||||
}
|
}
|
||||||
return null; // not known/supported
|
return null; // not known/supported
|
||||||
}
|
}
|
|
@ -29,7 +29,7 @@ import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressToSource;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressToSource;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement3;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement3;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIExceptionpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIExpression;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIFunctionBreakpoint;
|
||||||
|
@ -1284,9 +1284,9 @@ public class Target extends SessionObject implements ICDITarget, ICDIBreakpointM
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICDICatchpoint setCatchpoint(String type, String arg, int cdiType, ICDICondition condition, boolean deferred,
|
public ICDIEventBreakpoint setEventBreakpoint(String type, String arg, int cdiType, ICDICondition condition, boolean deferred,
|
||||||
boolean enabled) throws CDIException {
|
boolean enabled) throws CDIException {
|
||||||
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
BreakpointManager bMgr = ((Session)getSession()).getBreakpointManager();
|
||||||
return bMgr.setCatchpoint(this,type,arg,condition,enabled);
|
return bMgr.setEventBreakpoint(this,type,arg,condition,enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -224,7 +224,7 @@ public class CLIProcessor {
|
||||||
return MIBreakpointChangedEvent.HINT_NEW_FUNCTION_BREAKPOINT;
|
return MIBreakpointChangedEvent.HINT_NEW_FUNCTION_BREAKPOINT;
|
||||||
}
|
}
|
||||||
if (op.equals("catch")) {
|
if (op.equals("catch")) {
|
||||||
return MIBreakpointChangedEvent.HINT_NEW_CATCHPOINT;
|
return MIBreakpointChangedEvent.HINT_NEW_EVENTBREAKPOINT;
|
||||||
}
|
}
|
||||||
if ( !st.hasMoreTokens() ) {
|
if ( !st.hasMoreTokens() ) {
|
||||||
// "break" with no arguments
|
// "break" with no arguments
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class MIBreakpointChangedEvent extends MIChangedEvent {
|
||||||
public static final int HINT_NEW_LINE_BREAKPOINT = 1;
|
public static final int HINT_NEW_LINE_BREAKPOINT = 1;
|
||||||
public static final int HINT_NEW_FUNCTION_BREAKPOINT = 2;
|
public static final int HINT_NEW_FUNCTION_BREAKPOINT = 2;
|
||||||
public static final int HINT_NEW_ADDRESS_BREAKPOINT = 3;
|
public static final int HINT_NEW_ADDRESS_BREAKPOINT = 3;
|
||||||
public static final int HINT_NEW_CATCHPOINT = 4;
|
public static final int HINT_NEW_EVENTBREAKPOINT = 4;
|
||||||
|
|
||||||
int no = 0;
|
int no = 0;
|
||||||
int hint = HINT_NONE;
|
int hint = HINT_NONE;
|
||||||
|
|
|
@ -86,13 +86,13 @@
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
<extension point="org.eclipse.cdt.debug.ui.breakpointContribution">
|
<extension point="org.eclipse.cdt.debug.ui.breakpointContribution">
|
||||||
<breakpointLabels markerType="org.eclipse.cdt.debug.core.cCatchpointMarker">
|
<breakpointLabels markerType="org.eclipse.cdt.debug.core.cEventBreakpointMarker">
|
||||||
<attribute name="org.eclipse.cdt.debug.core.catchpoint_event_id" label="%catchType.label" type="string">
|
<attribute name="org.eclipse.cdt.debug.core.eventbreakpoint_event_id" label="%catchType.label" type="string">
|
||||||
<value value="org.eclipse.cdt.debug.gdb.catch" label="%catchCatch.label">
|
<value value="org.eclipse.cdt.debug.gdb.catch" label="%catchCatch.label">
|
||||||
</value>
|
</value>
|
||||||
<value value="org.eclipse.cdt.debug.gdb.throw" label="%catchThrow.label"/>
|
<value value="org.eclipse.cdt.debug.gdb.throw" label="%catchThrow.label"/>
|
||||||
<value value="org.eclipse.cdt.debug.gdb.signal" label="%catchSignal.label">
|
<value value="org.eclipse.cdt.debug.gdb.signal" label="%catchSignal.label">
|
||||||
<attribute name="org.eclipse.cdt.debug.core.catchpoint_event_arg" label="%catchSignal.arg.label"
|
<attribute name="org.eclipse.cdt.debug.core.eventbreakpoint_event_arg" label="%catchSignal.arg.label"
|
||||||
type="integer" fieldEditor="org.eclipse.jface.preference.IntegerFieldEditor">
|
type="integer" fieldEditor="org.eclipse.jface.preference.IntegerFieldEditor">
|
||||||
</attribute>
|
</attribute>
|
||||||
</value>
|
</value>
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class AllDebugTests {
|
||||||
suite.addTest(DebugTests.suite());
|
suite.addTest(DebugTests.suite());
|
||||||
suite.addTest(BreakpointTests.suite());
|
suite.addTest(BreakpointTests.suite());
|
||||||
suite.addTest(LocationTests.suite());
|
suite.addTest(LocationTests.suite());
|
||||||
suite.addTest(CatchpointTests.suite());
|
suite.addTest(EventBreakpointTests.suite());
|
||||||
return suite;
|
return suite;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,13 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocation;
|
||||||
import org.eclipse.cdt.debug.core.cdi.ICDILocator;
|
import org.eclipse.cdt.debug.core.cdi.ICDILocator;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement3;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpointManagement3;
|
||||||
import org.eclipse.cdt.debug.core.cdi.model.ICDICatchpoint;
|
import org.eclipse.cdt.debug.core.cdi.model.ICDIEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Catchpoint;
|
import org.eclipse.cdt.debug.mi.core.cdi.model.EventBreakpoint;
|
||||||
|
|
||||||
public class CatchpointTests extends AbstractDebugTest {
|
public class EventBreakpointTests extends AbstractDebugTest {
|
||||||
public static Test suite() {
|
public static Test suite() {
|
||||||
return new DebugTestWrapper(CatchpointTests.class){};
|
return new DebugTestWrapper(EventBreakpointTests.class){};
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getProjectName() {
|
protected String getProjectName() {
|
||||||
|
@ -39,7 +39,7 @@ public class CatchpointTests extends AbstractDebugTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String getProjectBinary() {
|
protected String getProjectBinary() {
|
||||||
return "catchpoints";
|
return "catchpoints.exe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -59,16 +59,16 @@ public class CatchpointTests extends AbstractDebugTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testCatch() throws CModelException, IOException, MIException, CDIException {
|
public void testCatch() throws CModelException, IOException, MIException, CDIException {
|
||||||
catchpoints(Catchpoint.CATCH, "");
|
eventbreakpoints(EventBreakpoint.CATCH, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testThrow() throws CModelException, IOException, MIException, CDIException {
|
public void testThrow() throws CModelException, IOException, MIException, CDIException {
|
||||||
catchpoints(Catchpoint.THROW, "");
|
eventbreakpoints(EventBreakpoint.THROW, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void catchpoints(String type, String arg) throws CModelException, IOException, MIException, CDIException {
|
private void eventbreakpoints(String type, String arg) throws CModelException, IOException, MIException, CDIException {
|
||||||
ICDIBreakpoint[] breakpoints;
|
ICDIBreakpoint[] breakpoints;
|
||||||
ICDICatchpoint curbreak;
|
ICDIEventBreakpoint curbreak;
|
||||||
|
|
||||||
setBreakOnMain();
|
setBreakOnMain();
|
||||||
currentTarget.restart();
|
currentTarget.restart();
|
||||||
|
@ -80,13 +80,13 @@ public class CatchpointTests extends AbstractDebugTest {
|
||||||
currentTarget.deleteAllBreakpoints();
|
currentTarget.deleteAllBreakpoints();
|
||||||
pause();
|
pause();
|
||||||
assertTrue(currentTarget instanceof ICDIBreakpointManagement3);
|
assertTrue(currentTarget instanceof ICDIBreakpointManagement3);
|
||||||
((ICDIBreakpointManagement3) currentTarget).setCatchpoint(type, arg, ICDIBreakpoint.REGULAR, null, false, true);
|
((ICDIBreakpointManagement3) currentTarget).setEventBreakpoint(type, arg, ICDIBreakpoint.REGULAR, null, false, true);
|
||||||
pause();
|
pause();
|
||||||
breakpoints = currentTarget.getBreakpoints();
|
breakpoints = currentTarget.getBreakpoints();
|
||||||
assertNotNull(breakpoints);
|
assertNotNull(breakpoints);
|
||||||
assertTrue(breakpoints.length == 1);
|
assertTrue(breakpoints.length == 1);
|
||||||
if (breakpoints[0] instanceof ICDICatchpoint) {
|
if (breakpoints[0] instanceof ICDIEventBreakpoint) {
|
||||||
curbreak = (ICDICatchpoint) breakpoints[0];
|
curbreak = (ICDIEventBreakpoint) breakpoints[0];
|
||||||
} else
|
} else
|
||||||
curbreak = null;
|
curbreak = null;
|
||||||
assertNotNull(curbreak);
|
assertNotNull(curbreak);
|
|
@ -20,8 +20,10 @@ import org.eclipse.cdt.debug.core.cdi.ICDISession;
|
||||||
import org.eclipse.cdt.debug.mi.core.MIException;
|
import org.eclipse.cdt.debug.mi.core.MIException;
|
||||||
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
import org.eclipse.cdt.debug.mi.core.MIPlugin;
|
||||||
import org.eclipse.cdt.debug.mi.core.command.MIVersion;
|
import org.eclipse.cdt.debug.mi.core.command.MIVersion;
|
||||||
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
|
import org.eclipse.swt.widgets.Display;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,6 +70,9 @@ public class CDebugHelper {
|
||||||
ICDISession session;
|
ICDISession session;
|
||||||
mi=MIPlugin.getDefault();
|
mi=MIPlugin.getDefault();
|
||||||
|
|
||||||
|
try {
|
||||||
|
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
|
||||||
|
} catch (Exception exc) {}
|
||||||
IBinary bins[] = project.getBinaryContainer().getBinaries();
|
IBinary bins[] = project.getBinaryContainer().getBinaries();
|
||||||
if (bins.length!=1) {
|
if (bins.length!=1) {
|
||||||
//SHOULD NOT HAPPEN
|
//SHOULD NOT HAPPEN
|
||||||
|
|
Before Width: | Height: | Size: 203 B After Width: | Height: | Size: 203 B |
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 226 B |
|
@ -51,8 +51,8 @@ ShowFullPathsAction.label=Show Full &Paths
|
||||||
ShowFullPathsAction.tooltip=Show Full Paths
|
ShowFullPathsAction.tooltip=Show Full Paths
|
||||||
AddWatchpoint.label=Add Watchpoint (C/C++)...
|
AddWatchpoint.label=Add Watchpoint (C/C++)...
|
||||||
AddWatchpoint.tooltip=Add Watchpoint (C/C++)
|
AddWatchpoint.tooltip=Add Watchpoint (C/C++)
|
||||||
AddCatchpoint.label=Add Event Breakpoint (C/C++)...
|
AddEventBreakpoint.label=Add Event Breakpoint (C/C++)...
|
||||||
AddCatchpoint.tooltip=Add Event Breakpoint (C/C++)
|
AddEventBreakpoint.tooltip=Add Event Breakpoint (C/C++)
|
||||||
|
|
||||||
AddGlobalsAction.label=Add Global Variables...
|
AddGlobalsAction.label=Add Global Variables...
|
||||||
AddGlobalsAction.tooltip=Add Global Variables
|
AddGlobalsAction.tooltip=Add Global Variables
|
||||||
|
|
|
@ -887,13 +887,13 @@
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction">
|
id="org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction">
|
||||||
</action>
|
</action>
|
||||||
<action
|
<action
|
||||||
class="org.eclipse.cdt.debug.internal.ui.actions.AddCatchpointActionDelegate"
|
class="org.eclipse.cdt.debug.internal.ui.actions.AddEventBreakpointActionDelegate"
|
||||||
icon="icons/obj16/catchpoint_obj.gif"
|
icon="icons/obj16/eventbreakoint_obj.gif"
|
||||||
id="org.eclipse.cdt.debug.internal.ui.actions.AddCatchpointActionDelegate"
|
id="org.eclipse.cdt.debug.internal.ui.actions.AddEventBreakpointActionDelegate"
|
||||||
label="%AddCatchpoint.label"
|
label="%AddEventBreakpoint.label"
|
||||||
menubarPath="cDebugActions"
|
menubarPath="cDebugActions"
|
||||||
style="push"
|
style="push"
|
||||||
tooltip="%AddCatchpoint.tooltip">
|
tooltip="%AddEventBreakpoint.tooltip">
|
||||||
</action>
|
</action>
|
||||||
</viewContribution>
|
</viewContribution>
|
||||||
<viewContribution
|
<viewContribution
|
||||||
|
@ -1667,8 +1667,8 @@
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.core.runtime.adapters">
|
point="org.eclipse.core.runtime.adapters">
|
||||||
<factory
|
<factory
|
||||||
adaptableType="org.eclipse.cdt.debug.core.model.ICCatchpoint"
|
adaptableType="org.eclipse.cdt.debug.core.model.ICEventBreakpoint"
|
||||||
class="org.eclipse.cdt.debug.ui.breakpoints.CCatchpointsLabelProviderFactory">
|
class="org.eclipse.cdt.debug.ui.breakpoints.CEventBreakpointsLabelProviderFactory">
|
||||||
<adapter
|
<adapter
|
||||||
type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider">
|
type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider">
|
||||||
</adapter>
|
</adapter>
|
||||||
|
|
|
@ -121,5 +121,5 @@ ToggleDetailPaneAction.7=Hide the Detail Pane so that only the Main Tree View is
|
||||||
AddRegisterGroupActionDelegate.0=Error
|
AddRegisterGroupActionDelegate.0=Error
|
||||||
AddRegisterGroupActionDelegate.1=Error(s) occurred adding register group.
|
AddRegisterGroupActionDelegate.1=Error(s) occurred adding register group.
|
||||||
EditRegisterGroupActionDelegate.0=Unable to edit register group.
|
EditRegisterGroupActionDelegate.0=Unable to edit register group.
|
||||||
AddCatchpointActionDelegate.0=Error adding Event Breakpoint
|
AddEventBreakpointActionDelegate.0=Error adding Event Breakpoint
|
||||||
AddCatchpointActionDelegate.2=Action is not supported by installed debuggers
|
AddEventBreakpointActionDelegate.2=Action is not supported by installed debuggers
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.internal.ui.dialogs.AddCatchpointDialog;
|
import org.eclipse.cdt.debug.internal.ui.dialogs.AddEventBreakpointDialog;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.cdt.debug.ui.UIMessages;
|
import org.eclipse.cdt.debug.ui.UIMessages;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
|
@ -29,7 +29,7 @@ import org.eclipse.ui.actions.ActionDelegate;
|
||||||
/**
|
/**
|
||||||
* A delegate for the "Add Event Breakpoint" action.
|
* A delegate for the "Add Event Breakpoint" action.
|
||||||
*/
|
*/
|
||||||
public class AddCatchpointActionDelegate extends ActionDelegate implements IViewActionDelegate {
|
public class AddEventBreakpointActionDelegate extends ActionDelegate implements IViewActionDelegate {
|
||||||
|
|
||||||
private IViewPart fView;
|
private IViewPart fView;
|
||||||
|
|
||||||
|
@ -52,24 +52,24 @@ public class AddCatchpointActionDelegate extends ActionDelegate implements IView
|
||||||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||||
*/
|
*/
|
||||||
public void run(IAction action) {
|
public void run(IAction action) {
|
||||||
AddCatchpointDialog dlg = new AddCatchpointDialog(CDebugUIPlugin.getActiveWorkbenchShell());
|
AddEventBreakpointDialog dlg = new AddEventBreakpointDialog(CDebugUIPlugin.getActiveWorkbenchShell());
|
||||||
if (dlg.isActive() == false) {
|
if (dlg.isActive() == false) {
|
||||||
String message = ActionMessages.getString("AddCatchpointActionDelegate.2");
|
String message = ActionMessages.getString("AddEventBreakpointActionDelegate.2");
|
||||||
MessageDialog.openError( getView().getSite().getShell(), UIMessages.getString( "CDebugUIPlugin.0" ), message);
|
MessageDialog.openError( getView().getSite().getShell(), UIMessages.getString( "CDebugUIPlugin.0" ), message);
|
||||||
} else {
|
} else {
|
||||||
if (dlg.open() == Window.OK) {
|
if (dlg.open() == Window.OK) {
|
||||||
addCatchpoint(dlg.getEventTypeId(), dlg.getEventArgument());
|
addEventBreakpoint(dlg.getEventTypeId(), dlg.getEventArgument());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addCatchpoint(String id, String arg) {
|
protected void addEventBreakpoint(String id, String arg) {
|
||||||
if (getResource() == null)
|
if (getResource() == null)
|
||||||
return;
|
return;
|
||||||
try {
|
try {
|
||||||
CDIDebugModel.createCatchpoint(id, arg, true); //$NON-NLS-1$
|
CDIDebugModel.createEventBreakpoint(id, arg, true); //$NON-NLS-1$
|
||||||
} catch (CoreException ce) {
|
} catch (CoreException ce) {
|
||||||
CDebugUIPlugin.errorDialog(ActionMessages.getString("AddCatchpointActionDelegate.0"), ce); //$NON-NLS-1$
|
CDebugUIPlugin.errorDialog(ActionMessages.getString("AddEventBreakpointActionDelegate.0"), ce); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@ import java.util.LinkedHashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
import org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||||
import org.eclipse.cdt.debug.core.model.ICCatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CCatchpoint;
|
import org.eclipse.cdt.debug.internal.core.breakpoints.CEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.internal.ui.propertypages.CBreakpointPreferenceStore;
|
import org.eclipse.cdt.debug.internal.ui.propertypages.CBreakpointPreferenceStore;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.cdt.debug.ui.breakpoints.CBreakpointUIContributionFactory;
|
import org.eclipse.cdt.debug.ui.breakpoints.CBreakpointUIContributionFactory;
|
||||||
|
@ -43,7 +43,7 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
/**
|
/**
|
||||||
* The "Add Catchpoint" dialog of the "Add catchpoint" action.
|
* The "Add Catchpoint" dialog of the "Add catchpoint" action.
|
||||||
*/
|
*/
|
||||||
public class AddCatchpointDialog extends Dialog implements ModifyListener, SelectionListener {
|
public class AddEventBreakpointDialog extends Dialog implements ModifyListener, SelectionListener {
|
||||||
|
|
||||||
private Combo fEventTypeInput;
|
private Combo fEventTypeInput;
|
||||||
private String fEventType;
|
private String fEventType;
|
||||||
|
@ -75,12 +75,12 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
||||||
Composite parent = getFieldEditorParent();
|
Composite parent = getFieldEditorParent();
|
||||||
try {
|
try {
|
||||||
Map map = new HashMap();
|
Map map = new HashMap();
|
||||||
map.put(ICCatchpoint.EVENT_TYPE_ID, eventType);
|
map.put(ICEventBreakpoint.EVENT_TYPE_ID, eventType);
|
||||||
ICBreakpointsUIContribution cons[] = CBreakpointUIContributionFactory.getInstance()
|
ICBreakpointsUIContribution cons[] = CBreakpointUIContributionFactory.getInstance()
|
||||||
.getBreakpointUIContributions(modelId, CCatchpoint.getMarkerType(), map);
|
.getBreakpointUIContributions(modelId, CEventBreakpoint.getMarkerType(), map);
|
||||||
for (ICBreakpointsUIContribution con : cons) {
|
for (ICBreakpointsUIContribution con : cons) {
|
||||||
|
|
||||||
if (con.getId().equals(ICCatchpoint.EVENT_TYPE_ID)) continue;
|
if (con.getId().equals(ICEventBreakpoint.EVENT_TYPE_ID)) continue;
|
||||||
FieldEditor fieldEditor = con.getFieldEditor(con.getId(), con.getLabel(),
|
FieldEditor fieldEditor = con.getFieldEditor(con.getId(), con.getLabel(),
|
||||||
parent);
|
parent);
|
||||||
getPreferenceStore().setValue(con.getId(),"");
|
getPreferenceStore().setValue(con.getId(),"");
|
||||||
|
@ -100,7 +100,7 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
||||||
*
|
*
|
||||||
* @param parentShell
|
* @param parentShell
|
||||||
*/
|
*/
|
||||||
public AddCatchpointDialog(Shell parentShell) {
|
public AddEventBreakpointDialog(Shell parentShell) {
|
||||||
super(parentShell);
|
super(parentShell);
|
||||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||||
factory = CBreakpointUIContributionFactory.getInstance();
|
factory = CBreakpointUIContributionFactory.getInstance();
|
||||||
|
@ -115,10 +115,10 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
||||||
|
|
||||||
private void loadEventTypes() {
|
private void loadEventTypes() {
|
||||||
ICBreakpointsUIContribution[] cons = factory.getBreakpointUIContributions(debugModelId,
|
ICBreakpointsUIContribution[] cons = factory.getBreakpointUIContributions(debugModelId,
|
||||||
CCatchpoint.getMarkerType(), null);
|
CEventBreakpoint.getMarkerType(), null);
|
||||||
for (int i = 0; i < cons.length; i++) {
|
for (int i = 0; i < cons.length; i++) {
|
||||||
ICBreakpointsUIContribution con = cons[i];
|
ICBreakpointsUIContribution con = cons[i];
|
||||||
if (con.getId().equals(ICCatchpoint.EVENT_TYPE_ID)) {
|
if (con.getId().equals(ICEventBreakpoint.EVENT_TYPE_ID)) {
|
||||||
String[] possibleValues = con.getPossibleValues();
|
String[] possibleValues = con.getPossibleValues();
|
||||||
for (String value : possibleValues) {
|
for (String value : possibleValues) {
|
||||||
fIdLabelMap.put(value, con.getLabelForValue(value));
|
fIdLabelMap.put(value, con.getLabelForValue(value));
|
||||||
|
@ -228,7 +228,7 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
||||||
*/
|
*/
|
||||||
protected void configureShell(Shell newShell) {
|
protected void configureShell(Shell newShell) {
|
||||||
super.configureShell(newShell);
|
super.configureShell(newShell);
|
||||||
newShell.setText(DialogMessages.getString("AddCatchpointDialog.2")); //$NON-NLS-1$
|
newShell.setText(DialogMessages.getString("AddEventBreakpointDialog.2")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -244,7 +244,7 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
||||||
page.performOk();
|
page.performOk();
|
||||||
IPreferenceStore preferenceStore = page.getPreferenceStore();
|
IPreferenceStore preferenceStore = page.getPreferenceStore();
|
||||||
if (preferenceStore != null) {
|
if (preferenceStore != null) {
|
||||||
fEventArgument = preferenceStore.getString(ICCatchpoint.EVENT_ARG);
|
fEventArgument = preferenceStore.getString(ICEventBreakpoint.EVENT_ARG);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
fEventArgument = null;
|
fEventArgument = null;
|
|
@ -1 +1 @@
|
||||||
AddCatchpointDialog.2=Add Event Breakpoint...
|
AddEventBreakpointDialog.2=Add Event Breakpoint...
|
||||||
|
|
|
@ -17,7 +17,7 @@ import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICCatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICFunctionBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
|
||||||
|
@ -372,7 +372,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement
|
||||||
return PropertyPageMessages.getString("CBreakpointPropertyPage.4");
|
return PropertyPageMessages.getString("CBreakpointPropertyPage.4");
|
||||||
if (breakpoint instanceof ICLineBreakpoint)
|
if (breakpoint instanceof ICLineBreakpoint)
|
||||||
return PropertyPageMessages.getString("CBreakpointPropertyPage.8");
|
return PropertyPageMessages.getString("CBreakpointPropertyPage.8");
|
||||||
if (breakpoint instanceof ICCatchpoint)
|
if (breakpoint instanceof ICEventBreakpoint)
|
||||||
return PropertyPageMessages.getString("CBreakpointPropertyPage.21");
|
return PropertyPageMessages.getString("CBreakpointPropertyPage.21");
|
||||||
if (breakpoint instanceof ICWatchpoint) {
|
if (breakpoint instanceof ICWatchpoint) {
|
||||||
ICWatchpoint watchpoint = (ICWatchpoint) breakpoint;
|
ICWatchpoint watchpoint = (ICWatchpoint) breakpoint;
|
||||||
|
|
|
@ -16,7 +16,7 @@ import java.text.MessageFormat;
|
||||||
|
|
||||||
import org.eclipse.cdt.debug.core.DebugCoreMessages;
|
import org.eclipse.cdt.debug.core.DebugCoreMessages;
|
||||||
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
import org.eclipse.cdt.debug.core.model.ICBreakpoint;
|
||||||
import org.eclipse.cdt.debug.core.model.ICCatchpoint;
|
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IAdapterFactory;
|
import org.eclipse.core.runtime.IAdapterFactory;
|
||||||
|
@ -31,15 +31,15 @@ import org.eclipse.swt.graphics.Image;
|
||||||
/**
|
/**
|
||||||
* Factory for event breakpoint label provider
|
* Factory for event breakpoint label provider
|
||||||
*/
|
*/
|
||||||
public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
public class CEventBreakpointsLabelProviderFactory implements IAdapterFactory {
|
||||||
public static final String IMG_OBJS_CATCHPOINT_ENABLED = "icons/obj16/catchpoint_obj.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_EVENTBREAKPOINT_ENABLED = "icons/obj16/eventbreakpoint_obj.gif"; //$NON-NLS-1$
|
||||||
public static final String IMG_OBJS_CATCHPOINT_DISABLED = "icons/obj16/catchpointd_obj.gif"; //$NON-NLS-1$
|
public static final String IMG_OBJS_EVENTBREAKPOINT_DISABLED = "icons/obj16/eventbreakpointd_obj.gif"; //$NON-NLS-1$
|
||||||
private static ILabelProvider fLabelProvider = new LabelProvider() {
|
private static ILabelProvider fLabelProvider = new LabelProvider() {
|
||||||
@Override
|
@Override
|
||||||
public String getText(Object element) {
|
public String getText(Object element) {
|
||||||
if (element instanceof ICCatchpoint) {
|
if (element instanceof ICEventBreakpoint) {
|
||||||
try {
|
try {
|
||||||
ICCatchpoint breakpoint = (ICCatchpoint) element;
|
ICEventBreakpoint breakpoint = (ICEventBreakpoint) element;
|
||||||
|
|
||||||
ICBreakpointsUIContribution bscs[] = CBreakpointUIContributionFactory.getInstance()
|
ICBreakpointsUIContribution bscs[] = CBreakpointUIContributionFactory.getInstance()
|
||||||
.getBreakpointUIContributions(breakpoint);
|
.getBreakpointUIContributions(breakpoint);
|
||||||
|
@ -51,7 +51,7 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
||||||
for (ICBreakpointsUIContribution con : bscs) {
|
for (ICBreakpointsUIContribution con : bscs) {
|
||||||
Object attValue = breakpoint.getMarker().getAttribute(con.getId());
|
Object attValue = breakpoint.getMarker().getAttribute(con.getId());
|
||||||
|
|
||||||
if (con.getId().equals(ICCatchpoint.EVENT_TYPE_ID)) {
|
if (con.getId().equals(ICEventBreakpoint.EVENT_TYPE_ID)) {
|
||||||
buffer.append(con.getLabelForValue((String) attValue));
|
buffer.append(con.getLabelForValue((String) attValue));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -80,12 +80,12 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
||||||
@Override
|
@Override
|
||||||
public Image getImage(Object element) {
|
public Image getImage(Object element) {
|
||||||
try {
|
try {
|
||||||
if (element instanceof ICCatchpoint) {
|
if (element instanceof ICEventBreakpoint) {
|
||||||
ICCatchpoint catchpoint = (ICCatchpoint) element;
|
ICEventBreakpoint eventBkpt = (ICEventBreakpoint) element;
|
||||||
if (catchpoint.isEnabled())
|
if (eventBkpt.isEnabled())
|
||||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_CATCHPOINT_ENABLED);
|
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_ENABLED);
|
||||||
else
|
else
|
||||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_CATCHPOINT_DISABLED);
|
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_DISABLED);
|
||||||
}
|
}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
CDebugUIPlugin.log(e);
|
CDebugUIPlugin.log(e);
|
||||||
|
@ -118,7 +118,7 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
||||||
protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId)
|
protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId)
|
||||||
throws CoreException {
|
throws CoreException {
|
||||||
|
|
||||||
ICCatchpoint cp = (ICCatchpoint) elementPath.getLastSegment();
|
ICEventBreakpoint cp = (ICEventBreakpoint) elementPath.getLastSegment();
|
||||||
return fLabelProvider.getText(cp);
|
return fLabelProvider.getText(cp);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -133,12 +133,12 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
||||||
*/
|
*/
|
||||||
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
||||||
if (adapterType.equals(IElementLabelProvider.class)) {
|
if (adapterType.equals(IElementLabelProvider.class)) {
|
||||||
if (adaptableObject instanceof ICCatchpoint) {
|
if (adaptableObject instanceof ICEventBreakpoint) {
|
||||||
return fElementLabelProvider;
|
return fElementLabelProvider;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (adapterType.equals(ILabelProvider.class)) {
|
if (adapterType.equals(ILabelProvider.class)) {
|
||||||
if (adaptableObject instanceof ICCatchpoint) {
|
if (adaptableObject instanceof ICEventBreakpoint) {
|
||||||
return fLabelProvider;
|
return fLabelProvider;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue