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
|
||||
* whenever a certain point in the program is reached. Provides a
|
||||
* basic functionality for the location breakpoints, watchpoints,
|
||||
* and catchpoints.
|
||||
* and event breakpoints
|
||||
*
|
||||
* @see ICDILineBreakpoint
|
||||
* @see ICDIFunctionBreakpoint
|
||||
* @see ICDIAddressBreakpoint
|
||||
* @see ICDIWatchpoint
|
||||
* @see ICDICatchpoint
|
||||
* @see ICDIEventBreakpoint
|
||||
*
|
||||
* @since Jul 9, 2002
|
||||
*/
|
||||
|
|
|
@ -17,11 +17,11 @@ import org.eclipse.cdt.debug.core.cdi.ICDICondition;
|
|||
|
||||
public interface ICDIBreakpointManagement3 extends ICDIBreakpointManagement2{
|
||||
/**
|
||||
* Set a catchpoint
|
||||
* @param type - catchpoint type, interpreted by backend
|
||||
* Set an event breakpoint
|
||||
* @param type - event breakpoint type, interpreted by backend
|
||||
* @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;
|
||||
}
|
||||
|
|
|
@ -14,10 +14,10 @@ package org.eclipse.cdt.debug.core.cdi.model;
|
|||
|
||||
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.
|
||||
* @return catchpoint type id
|
||||
* Get event breakpoint type. This is usually id in reverse web notation.
|
||||
* @return event breakpoint type id
|
||||
* @throws CoreException
|
||||
*/
|
||||
String getEventType() throws CoreException;
|
|
@ -21,7 +21,7 @@ cLineBreakpoints.name=C/C++ Line Breakpoints
|
|||
cAddressBreakpoints.name=C/C++ Address Breakpoints
|
||||
cFunctionBreakpoints.name=C/C++ Function Breakpoints
|
||||
cWatchpoints.name=C/C++ Watchpoints
|
||||
cCatchpoints.name=C/C++ Event Breakpoints
|
||||
cEventBreakpoints.name=C/C++ Event Breakpoints
|
||||
breakpointProblem.name=C/C++ Breakpoint Problem
|
||||
|
||||
containerName.mapping=Path Mapping
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
</attribute>
|
||||
</extension>
|
||||
<extension
|
||||
id="cCatchpointMarker"
|
||||
id="cEventBreakpointMarker"
|
||||
point="org.eclipse.core.resources.markers">
|
||||
<super
|
||||
type="org.eclipse.cdt.debug.core.cBreakpointMarker">
|
||||
|
@ -115,10 +115,10 @@
|
|||
value="true">
|
||||
</persistent>
|
||||
<attribute
|
||||
name="org.eclipse.cdt.debug.core.catchpoint_event_id">
|
||||
name="org.eclipse.cdt.debug.core.eventbreakpoint_event_id">
|
||||
</attribute>
|
||||
<attribute
|
||||
name="org.eclipse.cdt.debug.core.catchpoint_event_arg">
|
||||
name="org.eclipse.cdt.debug.core.eventbreakpoint_event_arg">
|
||||
</attribute>
|
||||
</extension>
|
||||
<extension
|
||||
|
@ -163,10 +163,10 @@
|
|||
id="cWatchpoint">
|
||||
</breakpoint>
|
||||
<breakpoint
|
||||
class="org.eclipse.cdt.debug.internal.core.breakpoints.CCatchpoint"
|
||||
name="%cCatchpoint.name"
|
||||
markerType="org.eclipse.cdt.debug.core.cCatchpointMarker"
|
||||
id="cCatchpoint">
|
||||
class="org.eclipse.cdt.debug.internal.core.breakpoints.CEventBreakpoint"
|
||||
name="%cEventBreakpoint.name"
|
||||
markerType="org.eclipse.cdt.debug.core.cEventBreakpointMarker"
|
||||
id="cEventBreakpoint">
|
||||
</breakpoint>
|
||||
</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.model.ICAddressBreakpoint;
|
||||
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.ICLineBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
|
||||
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.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.CLineBreakpoint;
|
||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CWatchpoint;
|
||||
|
@ -589,16 +589,16 @@ public class CDIDebugModel {
|
|||
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();
|
||||
|
||||
IBreakpointManager manager = DebugPlugin.getDefault().getBreakpointManager();
|
||||
IBreakpoint[] breakpoints = manager.getBreakpoints(modelId);
|
||||
for (int i = 0; i < breakpoints.length; i++) {
|
||||
if (!(breakpoints[i] instanceof ICCatchpoint)) {
|
||||
if (!(breakpoints[i] instanceof ICEventBreakpoint)) {
|
||||
continue;
|
||||
}
|
||||
ICCatchpoint breakpoint = (ICCatchpoint) breakpoints[i];
|
||||
ICEventBreakpoint breakpoint = (ICEventBreakpoint) breakpoints[i];
|
||||
|
||||
if (breakpoint.getEventType().equals(type)) {
|
||||
String arg1 = breakpoint.getEventArgument();
|
||||
|
@ -612,7 +612,7 @@ public class CDIDebugModel {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
public static ICCatchpoint createCatchpoint(String type, String arg, boolean register)
|
||||
public static ICEventBreakpoint createEventBreakpoint(String type, String arg, boolean register)
|
||||
throws CoreException {
|
||||
final IResource resource = ResourcesPlugin.getWorkspace().getRoot();
|
||||
final Map<String,Object> attributes = new HashMap<String,Object>();
|
||||
|
@ -620,9 +620,9 @@ public class CDIDebugModel {
|
|||
attributes.put(IBreakpoint.ENABLED, true);
|
||||
attributes.put(ICBreakpoint.IGNORE_COUNT, 0);
|
||||
attributes.put(ICBreakpoint.CONDITION, "");
|
||||
attributes.put(ICCatchpoint.EVENT_TYPE_ID, type);
|
||||
attributes.put(ICCatchpoint.EVENT_ARG, arg);
|
||||
return new CCatchpoint(resource, attributes, register);
|
||||
attributes.put(ICEventBreakpoint.EVENT_TYPE_ID, type);
|
||||
attributes.put(ICEventBreakpoint.EVENT_ARG, arg);
|
||||
return new CEventBreakpoint(resource, attributes, register);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,32 +15,30 @@ package org.eclipse.cdt.debug.core.model;
|
|||
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.
|
||||
*
|
||||
* @sinse 5.0
|
||||
*/
|
||||
public interface ICCatchpoint extends ICBreakpoint {
|
||||
public interface ICEventBreakpoint extends ICBreakpoint {
|
||||
/**
|
||||
* Breakpoint attribute storing the catchpoint event id
|
||||
* is set in (value <code>"org.eclipse.cdt.debug.core.catchpoint.event_id"</code>).
|
||||
* Breakpoint attribute storing the event breakpoint event id
|
||||
* 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
|
||||
* is set in (value <code>"org.eclipse.cdt.debug.core.catchpoint.event_arg"</code>).
|
||||
* Breakpoint attribute storing the event breakpoint argument
|
||||
* 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.
|
||||
* 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
|
||||
*/
|
||||
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.ICDIBreakpointManagement2;
|
||||
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.ICDILineBreakpoint;
|
||||
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.ICBreakpoint;
|
||||
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.ICFunctionBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICLineBreakpoint;
|
||||
|
@ -255,11 +255,11 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
catch( CDIException e ) {
|
||||
}
|
||||
}
|
||||
if ( breakpoint instanceof ICCatchpoint && cdiBreakpoint instanceof ICDICatchpoint) {
|
||||
ICCatchpoint mcatchpoint = (ICCatchpoint) breakpoint;
|
||||
ICDICatchpoint cdicatchpoint = (ICDICatchpoint) cdiBreakpoint;
|
||||
if (!mcatchpoint.getEventType().equals(cdicatchpoint.getEventType())) return false;
|
||||
return (mcatchpoint.getEventArgument().equals(cdicatchpoint.getExtraArgument()));
|
||||
if ( breakpoint instanceof ICEventBreakpoint && cdiBreakpoint instanceof ICDIEventBreakpoint) {
|
||||
ICEventBreakpoint mevtbkpt = (ICEventBreakpoint) breakpoint;
|
||||
ICDIEventBreakpoint cdievtbkpt = (ICDIEventBreakpoint) cdiBreakpoint;
|
||||
if (!mevtbkpt.getEventType().equals(cdievtbkpt.getEventType())) return false;
|
||||
return (mevtbkpt.getEventArgument().equals(cdievtbkpt.getExtraArgument()));
|
||||
}
|
||||
}
|
||||
catch( CoreException e ) {
|
||||
|
@ -461,8 +461,8 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
private void handleBreakpointCreatedEvent( ICDIBreakpoint cdiBreakpoint ) {
|
||||
if ( cdiBreakpoint instanceof ICDIWatchpoint )
|
||||
doHandleWatchpointCreatedEvent( (ICDIWatchpoint)cdiBreakpoint );
|
||||
if ( cdiBreakpoint instanceof ICDICatchpoint )
|
||||
doHandleCatachpointCreatedEvent( (ICDICatchpoint)cdiBreakpoint );
|
||||
if ( cdiBreakpoint instanceof ICDIEventBreakpoint )
|
||||
doHandleCatachpointCreatedEvent( (ICDIEventBreakpoint)cdiBreakpoint );
|
||||
else if ( cdiBreakpoint instanceof ICDILocationBreakpoint )
|
||||
doHandleLocationBreakpointCreatedEvent( (ICDILocationBreakpoint)cdiBreakpoint );
|
||||
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;
|
||||
synchronized( getBreakpointMap() ) {
|
||||
breakpoint = getBreakpointMap().getCBreakpoint( cdiCatchpoint );
|
||||
breakpoint = getBreakpointMap().getCBreakpoint( cdiEventBkpt );
|
||||
if ( breakpoint == null ) {
|
||||
try {
|
||||
breakpoint = createCatchpoint( cdiCatchpoint );
|
||||
breakpoint = createEventBreakpoint( cdiEventBkpt );
|
||||
}
|
||||
catch( CDIException e ) {
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
}
|
||||
}
|
||||
if ( breakpoint != null )
|
||||
getBreakpointMap().put( breakpoint, cdiCatchpoint );
|
||||
getBreakpointMap().put( breakpoint, cdiEventBkpt );
|
||||
}
|
||||
|
||||
if ( breakpoint != null ) {
|
||||
|
@ -496,7 +496,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
catch( CoreException e ) {
|
||||
}
|
||||
getBreakpointNotifier().breakpointInstalled( getDebugTarget(), breakpoint );
|
||||
changeBreakpointProperties( breakpoint, cdiCatchpoint );
|
||||
changeBreakpointProperties( breakpoint, cdiEventBkpt );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -821,12 +821,12 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
} else {
|
||||
b = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition );
|
||||
}
|
||||
} else if (breakpoints[i] instanceof ICCatchpoint) {
|
||||
ICCatchpoint catchpoint = (ICCatchpoint) breakpoints[i];
|
||||
ICDICondition condition = createCondition(catchpoint);
|
||||
} else if (breakpoints[i] instanceof ICEventBreakpoint) {
|
||||
ICEventBreakpoint eventbkpt = (ICEventBreakpoint) breakpoints[i];
|
||||
ICDICondition condition = createCondition(eventbkpt);
|
||||
if (cdiTarget instanceof ICDIBreakpointManagement3) {
|
||||
ICDIBreakpointManagement3 bpManager3 = (ICDIBreakpointManagement3) cdiTarget;
|
||||
b = bpManager3.setCatchpoint(catchpoint.getEventType(), catchpoint
|
||||
b = bpManager3.setEventBreakpoint(eventbkpt.getEventType(), eventbkpt
|
||||
.getEventArgument(), ICDIBreakpoint.REGULAR, condition, true, breakpoints[i].isEnabled());
|
||||
} else {
|
||||
throw new UnsupportedOperationException("BreakpointManager does not support this type of breapoints");
|
||||
|
@ -1008,17 +1008,17 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana
|
|||
return watchpoint;
|
||||
}
|
||||
|
||||
private ICCatchpoint createCatchpoint(ICDICatchpoint cdiCatchpoint) throws CDIException,
|
||||
private ICEventBreakpoint createEventBreakpoint(ICDIEventBreakpoint cdiEventBkpt) throws CDIException,
|
||||
CoreException {
|
||||
|
||||
ICCatchpoint catchpoint;
|
||||
catchpoint = CDIDebugModel.catchpointExists(cdiCatchpoint.getEventType(), cdiCatchpoint
|
||||
ICEventBreakpoint eventBkpt;
|
||||
eventBkpt = CDIDebugModel.eventBreakpointExists(cdiEventBkpt.getEventType(), cdiEventBkpt
|
||||
.getExtraArgument());
|
||||
if (catchpoint != null)
|
||||
return catchpoint;
|
||||
catchpoint = CDIDebugModel.createCatchpoint(cdiCatchpoint.getEventType(), cdiCatchpoint
|
||||
if (eventBkpt != null)
|
||||
return eventBkpt;
|
||||
eventBkpt = CDIDebugModel.createEventBreakpoint(cdiEventBkpt.getEventType(), cdiEventBkpt
|
||||
.getExtraArgument(), false);
|
||||
return catchpoint;
|
||||
return eventBkpt;
|
||||
}
|
||||
|
||||
private void changeBreakpointProperties( ICBreakpoint breakpoint, IMarkerDelta delta ) {
|
||||
|
|
|
@ -14,7 +14,7 @@ package org.eclipse.cdt.debug.internal.core.breakpoints;
|
|||
|
||||
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.IResource;
|
||||
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.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() {
|
||||
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();
|
||||
// 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)
|
||||
throw new IllegalArgumentException();
|
||||
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,
|
||||
final Map attributes, final boolean add) throws DebugException {
|
||||
final Map<String, Object> attributes, final boolean add) throws DebugException {
|
||||
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
|
||||
|
||||
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 {
|
||||
return ensureMarker().getAttribute(EVENT_TYPE_ID, ""); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ICCatchpoint#getEventArgument()
|
||||
* @see ICEventBreakpoint#getEventArgument()
|
||||
*/
|
||||
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.model.ICDIAddressBreakpoint;
|
||||
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.ICDIFunctionBreakpoint;
|
||||
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.AddressLocation;
|
||||
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.FunctionBreakpoint;
|
||||
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) {
|
||||
FunctionLocation location = createFunctionLocation(file, function);
|
||||
newBreakpoint = new FunctionBreakpoint(target, type, location, condition, enabled);
|
||||
} else if (hint == MIBreakpointChangedEvent.HINT_NEW_CATCHPOINT || Catchpoint.getEventArgumentFromMI(miBreakpoint)!=null) {
|
||||
String ctype = Catchpoint.getEventTypeFromMI(miBreakpoint);
|
||||
} else if (hint == MIBreakpointChangedEvent.HINT_NEW_EVENTBREAKPOINT || EventBreakpoint.getEventArgumentFromMI(miBreakpoint)!=null) {
|
||||
String ctype = EventBreakpoint.getEventTypeFromMI(miBreakpoint);
|
||||
if (ctype != null) {
|
||||
newBreakpoint = new Catchpoint(target, ctype, Catchpoint
|
||||
newBreakpoint = new EventBreakpoint(target, ctype, EventBreakpoint
|
||||
.getEventArgumentFromMI(miBreakpoint), condition, enabled);
|
||||
} 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) {
|
||||
BigInteger big = MIFormat.getBigInteger(addr);
|
||||
|
@ -1042,20 +1042,20 @@ public class BreakpointManager extends Manager {
|
|||
}
|
||||
return miBreakInserts;
|
||||
}
|
||||
public ICDICatchpoint setCatchpoint(Target target, String type, String arg, ICDICondition condition, boolean enabled) throws CDIException {
|
||||
Catchpoint catchpoint = new Catchpoint(target,type,arg,condition,enabled);
|
||||
setCatchpoint(catchpoint);
|
||||
return catchpoint;
|
||||
public ICDIEventBreakpoint setEventBreakpoint(Target target, String type, String arg, ICDICondition condition, boolean enabled) throws CDIException {
|
||||
EventBreakpoint eventBkpt = new EventBreakpoint(target,type,arg,condition,enabled);
|
||||
setEventBreakpoint(eventBkpt);
|
||||
return eventBkpt;
|
||||
}
|
||||
public void setCatchpoint(Catchpoint catchpoint) throws CDIException {
|
||||
Target target = (Target) catchpoint.getTarget();
|
||||
public void setEventBreakpoint(EventBreakpoint eventBkpt) throws CDIException {
|
||||
Target target = (Target) eventBkpt.getTarget();
|
||||
|
||||
MISession miSession = target.getMISession();
|
||||
CommandFactory factory = miSession.getCommandFactory();
|
||||
CLICatch breakCatch = factory.createCLICatch(catchpoint.getGdbEvent(), catchpoint
|
||||
CLICatch breakCatch = factory.createCLICatch(eventBkpt.getGdbEvent(), eventBkpt
|
||||
.getGdbArg());
|
||||
|
||||
catchpoint.setMIBreakpoints(new MIBreakpoint[0]); // initialize
|
||||
eventBkpt.setMIBreakpoints(new MIBreakpoint[0]); // initialize
|
||||
boolean restart = false;
|
||||
try {
|
||||
restart = suspendInferior(target);
|
||||
|
@ -1072,12 +1072,12 @@ public class BreakpointManager extends Manager {
|
|||
.getString("cdi.BreakpointManager.Parsing_Error")); //$NON-NLS-1$
|
||||
}
|
||||
no = points[0].getNumber();
|
||||
catchpoint.setMIBreakpoints(points);
|
||||
eventBkpt.setMIBreakpoints(points);
|
||||
} catch (MIException e) {
|
||||
if (!catchpoint.isDeferred()) {
|
||||
if (!eventBkpt.isDeferred()) {
|
||||
throw e;
|
||||
}
|
||||
addDeferredBreakpoint(catchpoint);
|
||||
addDeferredBreakpoint(eventBkpt);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ public class BreakpointManager extends Manager {
|
|||
String exprCond = null;
|
||||
int ignoreCount = 0;
|
||||
|
||||
ICDICondition condition = catchpoint.getCondition();
|
||||
ICDICondition condition = eventBkpt.getCondition();
|
||||
if (condition != null) {
|
||||
exprCond = condition.getExpression();
|
||||
ignoreCount = condition.getIgnoreCount();
|
||||
|
@ -1116,10 +1116,10 @@ public class BreakpointManager extends Manager {
|
|||
|
||||
|
||||
List bList = getBreakpointsList(target);
|
||||
bList.add(catchpoint);
|
||||
bList.add(eventBkpt);
|
||||
|
||||
// Fire a created Event.
|
||||
MIBreakpoint[] miBreakpoints = catchpoint.getMIBreakpoints();
|
||||
MIBreakpoint[] miBreakpoints = eventBkpt.getMIBreakpoints();
|
||||
if (miBreakpoints != null && miBreakpoints.length > 0) {
|
||||
miSession.fireEvent(new MIBreakpointCreatedEvent(miSession, miBreakpoints[0]
|
||||
.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.RxThread;
|
||||
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.SharedLibrary;
|
||||
import org.eclipse.cdt.debug.mi.core.cdi.model.Target;
|
||||
|
@ -152,8 +152,8 @@ public class SharedLibraryManager extends Manager {
|
|||
bpMgr.setLocationBreakpoint((LocationBreakpoint)bkpt);
|
||||
} else if (bkpt instanceof Watchpoint) {
|
||||
bpMgr.setWatchpoint((Watchpoint)bkpt);
|
||||
} else if (bkpt instanceof Catchpoint) {
|
||||
bpMgr.setCatchpoint((Catchpoint)bkpt);
|
||||
} else if (bkpt instanceof EventBreakpoint) {
|
||||
bpMgr.setEventBreakpoint((EventBreakpoint)bkpt);
|
||||
} else {
|
||||
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.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;
|
||||
|
||||
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 THROW = "org.eclipse.cdt.debug.gdb.throw";
|
||||
|
@ -25,7 +25,7 @@ public class Catchpoint extends Breakpoint implements ICDICatchpoint {
|
|||
private String eventType;
|
||||
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);
|
||||
this.eventType = event;
|
||||
this.arg = arg==null?"":arg;
|
||||
|
@ -58,24 +58,24 @@ public class Catchpoint extends Breakpoint implements ICDICatchpoint {
|
|||
@Override
|
||||
public boolean equals(Object arg0) {
|
||||
if (this == arg0) return true;
|
||||
if (!(arg0 instanceof Catchpoint)) return false;
|
||||
if (!(arg0 instanceof EventBreakpoint)) return false;
|
||||
MIBreakpoint[] breakpoints = getMIBreakpoints();
|
||||
if (breakpoints==null || breakpoints.length==0) {
|
||||
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
|
||||
* @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) {
|
||||
if (miBreakpoint.getWhat().equals("exception catch")) {
|
||||
return
|
||||
Catchpoint.CATCH;
|
||||
EventBreakpoint.CATCH;
|
||||
} else if (miBreakpoint.getWhat().equals("exception throw")) {
|
||||
return Catchpoint.THROW;
|
||||
return EventBreakpoint.THROW;
|
||||
}
|
||||
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.ICDIBreakpoint;
|
||||
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.ICDIExpression;
|
||||
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 {
|
||||
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;
|
||||
}
|
||||
if (op.equals("catch")) {
|
||||
return MIBreakpointChangedEvent.HINT_NEW_CATCHPOINT;
|
||||
return MIBreakpointChangedEvent.HINT_NEW_EVENTBREAKPOINT;
|
||||
}
|
||||
if ( !st.hasMoreTokens() ) {
|
||||
// "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_FUNCTION_BREAKPOINT = 2;
|
||||
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 hint = HINT_NONE;
|
||||
|
|
|
@ -86,13 +86,13 @@
|
|||
</extension>
|
||||
|
||||
<extension point="org.eclipse.cdt.debug.ui.breakpointContribution">
|
||||
<breakpointLabels markerType="org.eclipse.cdt.debug.core.cCatchpointMarker">
|
||||
<attribute name="org.eclipse.cdt.debug.core.catchpoint_event_id" label="%catchType.label" type="string">
|
||||
<breakpointLabels markerType="org.eclipse.cdt.debug.core.cEventBreakpointMarker">
|
||||
<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 value="org.eclipse.cdt.debug.gdb.throw" label="%catchThrow.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">
|
||||
</attribute>
|
||||
</value>
|
||||
|
|
|
@ -38,7 +38,7 @@ public class AllDebugTests {
|
|||
suite.addTest(DebugTests.suite());
|
||||
suite.addTest(BreakpointTests.suite());
|
||||
suite.addTest(LocationTests.suite());
|
||||
suite.addTest(CatchpointTests.suite());
|
||||
suite.addTest(EventBreakpointTests.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.model.ICDIBreakpoint;
|
||||
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.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() {
|
||||
return new DebugTestWrapper(CatchpointTests.class){};
|
||||
return new DebugTestWrapper(EventBreakpointTests.class){};
|
||||
}
|
||||
|
||||
protected String getProjectName() {
|
||||
|
@ -39,7 +39,7 @@ public class CatchpointTests extends AbstractDebugTest {
|
|||
}
|
||||
|
||||
protected String getProjectBinary() {
|
||||
return "catchpoints";
|
||||
return "catchpoints.exe";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -59,16 +59,16 @@ public class CatchpointTests extends AbstractDebugTest {
|
|||
}
|
||||
|
||||
public void testCatch() throws CModelException, IOException, MIException, CDIException {
|
||||
catchpoints(Catchpoint.CATCH, "");
|
||||
eventbreakpoints(EventBreakpoint.CATCH, "");
|
||||
}
|
||||
|
||||
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;
|
||||
ICDICatchpoint curbreak;
|
||||
ICDIEventBreakpoint curbreak;
|
||||
|
||||
setBreakOnMain();
|
||||
currentTarget.restart();
|
||||
|
@ -80,13 +80,13 @@ public class CatchpointTests extends AbstractDebugTest {
|
|||
currentTarget.deleteAllBreakpoints();
|
||||
pause();
|
||||
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();
|
||||
breakpoints = currentTarget.getBreakpoints();
|
||||
assertNotNull(breakpoints);
|
||||
assertTrue(breakpoints.length == 1);
|
||||
if (breakpoints[0] instanceof ICDICatchpoint) {
|
||||
curbreak = (ICDICatchpoint) breakpoints[0];
|
||||
if (breakpoints[0] instanceof ICDIEventBreakpoint) {
|
||||
curbreak = (ICDIEventBreakpoint) breakpoints[0];
|
||||
} else
|
||||
curbreak = null;
|
||||
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.MIPlugin;
|
||||
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.Platform;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -68,6 +70,9 @@ public class CDebugHelper {
|
|||
ICDISession session;
|
||||
mi=MIPlugin.getDefault();
|
||||
|
||||
try {
|
||||
project.getProject().refreshLocal(IResource.DEPTH_INFINITE, null);
|
||||
} catch (Exception exc) {}
|
||||
IBinary bins[] = project.getBinaryContainer().getBinaries();
|
||||
if (bins.length!=1) {
|
||||
//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
|
||||
AddWatchpoint.label=Add Watchpoint (C/C++)...
|
||||
AddWatchpoint.tooltip=Add Watchpoint (C/C++)
|
||||
AddCatchpoint.label=Add Event Breakpoint (C/C++)...
|
||||
AddCatchpoint.tooltip=Add Event Breakpoint (C/C++)
|
||||
AddEventBreakpoint.label=Add Event Breakpoint (C/C++)...
|
||||
AddEventBreakpoint.tooltip=Add Event Breakpoint (C/C++)
|
||||
|
||||
AddGlobalsAction.label=Add Global Variables...
|
||||
AddGlobalsAction.tooltip=Add Global Variables
|
||||
|
|
|
@ -887,13 +887,13 @@
|
|||
id="org.eclipse.cdt.debug.internal.ui.actions.ShowFullPathsAction">
|
||||
</action>
|
||||
<action
|
||||
class="org.eclipse.cdt.debug.internal.ui.actions.AddCatchpointActionDelegate"
|
||||
icon="icons/obj16/catchpoint_obj.gif"
|
||||
id="org.eclipse.cdt.debug.internal.ui.actions.AddCatchpointActionDelegate"
|
||||
label="%AddCatchpoint.label"
|
||||
class="org.eclipse.cdt.debug.internal.ui.actions.AddEventBreakpointActionDelegate"
|
||||
icon="icons/obj16/eventbreakoint_obj.gif"
|
||||
id="org.eclipse.cdt.debug.internal.ui.actions.AddEventBreakpointActionDelegate"
|
||||
label="%AddEventBreakpoint.label"
|
||||
menubarPath="cDebugActions"
|
||||
style="push"
|
||||
tooltip="%AddCatchpoint.tooltip">
|
||||
tooltip="%AddEventBreakpoint.tooltip">
|
||||
</action>
|
||||
</viewContribution>
|
||||
<viewContribution
|
||||
|
@ -1667,8 +1667,8 @@
|
|||
<extension
|
||||
point="org.eclipse.core.runtime.adapters">
|
||||
<factory
|
||||
adaptableType="org.eclipse.cdt.debug.core.model.ICCatchpoint"
|
||||
class="org.eclipse.cdt.debug.ui.breakpoints.CCatchpointsLabelProviderFactory">
|
||||
adaptableType="org.eclipse.cdt.debug.core.model.ICEventBreakpoint"
|
||||
class="org.eclipse.cdt.debug.ui.breakpoints.CEventBreakpointsLabelProviderFactory">
|
||||
<adapter
|
||||
type="org.eclipse.debug.internal.ui.viewers.model.provisional.IElementLabelProvider">
|
||||
</adapter>
|
||||
|
|
|
@ -121,5 +121,5 @@ ToggleDetailPaneAction.7=Hide the Detail Pane so that only the Main Tree View is
|
|||
AddRegisterGroupActionDelegate.0=Error
|
||||
AddRegisterGroupActionDelegate.1=Error(s) occurred adding register group.
|
||||
EditRegisterGroupActionDelegate.0=Unable to edit register group.
|
||||
AddCatchpointActionDelegate.0=Error adding Event Breakpoint
|
||||
AddCatchpointActionDelegate.2=Action is not supported by installed debuggers
|
||||
AddEventBreakpointActionDelegate.0=Error adding Event Breakpoint
|
||||
AddEventBreakpointActionDelegate.2=Action is not supported by installed debuggers
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||
|
||||
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.UIMessages;
|
||||
import org.eclipse.core.resources.IResource;
|
||||
|
@ -29,7 +29,7 @@ import org.eclipse.ui.actions.ActionDelegate;
|
|||
/**
|
||||
* 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;
|
||||
|
||||
|
@ -52,24 +52,24 @@ public class AddCatchpointActionDelegate extends ActionDelegate implements IView
|
|||
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
|
||||
*/
|
||||
public void run(IAction action) {
|
||||
AddCatchpointDialog dlg = new AddCatchpointDialog(CDebugUIPlugin.getActiveWorkbenchShell());
|
||||
AddEventBreakpointDialog dlg = new AddEventBreakpointDialog(CDebugUIPlugin.getActiveWorkbenchShell());
|
||||
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);
|
||||
} else {
|
||||
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)
|
||||
return;
|
||||
try {
|
||||
CDIDebugModel.createCatchpoint(id, arg, true); //$NON-NLS-1$
|
||||
CDIDebugModel.createEventBreakpoint(id, arg, true); //$NON-NLS-1$
|
||||
} 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 org.eclipse.cdt.debug.core.CDIDebugModel;
|
||||
import org.eclipse.cdt.debug.core.model.ICCatchpoint;
|
||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CCatchpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICEventBreakpoint;
|
||||
import org.eclipse.cdt.debug.internal.core.breakpoints.CEventBreakpoint;
|
||||
import org.eclipse.cdt.debug.internal.ui.propertypages.CBreakpointPreferenceStore;
|
||||
import org.eclipse.cdt.debug.ui.CDebugUIPlugin;
|
||||
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.
|
||||
*/
|
||||
public class AddCatchpointDialog extends Dialog implements ModifyListener, SelectionListener {
|
||||
public class AddEventBreakpointDialog extends Dialog implements ModifyListener, SelectionListener {
|
||||
|
||||
private Combo fEventTypeInput;
|
||||
private String fEventType;
|
||||
|
@ -75,12 +75,12 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
|||
Composite parent = getFieldEditorParent();
|
||||
try {
|
||||
Map map = new HashMap();
|
||||
map.put(ICCatchpoint.EVENT_TYPE_ID, eventType);
|
||||
map.put(ICEventBreakpoint.EVENT_TYPE_ID, eventType);
|
||||
ICBreakpointsUIContribution cons[] = CBreakpointUIContributionFactory.getInstance()
|
||||
.getBreakpointUIContributions(modelId, CCatchpoint.getMarkerType(), map);
|
||||
.getBreakpointUIContributions(modelId, CEventBreakpoint.getMarkerType(), map);
|
||||
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(),
|
||||
parent);
|
||||
getPreferenceStore().setValue(con.getId(),"");
|
||||
|
@ -100,7 +100,7 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
|||
*
|
||||
* @param parentShell
|
||||
*/
|
||||
public AddCatchpointDialog(Shell parentShell) {
|
||||
public AddEventBreakpointDialog(Shell parentShell) {
|
||||
super(parentShell);
|
||||
setShellStyle(getShellStyle() | SWT.RESIZE);
|
||||
factory = CBreakpointUIContributionFactory.getInstance();
|
||||
|
@ -115,10 +115,10 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
|||
|
||||
private void loadEventTypes() {
|
||||
ICBreakpointsUIContribution[] cons = factory.getBreakpointUIContributions(debugModelId,
|
||||
CCatchpoint.getMarkerType(), null);
|
||||
CEventBreakpoint.getMarkerType(), null);
|
||||
for (int i = 0; i < cons.length; 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();
|
||||
for (String value : possibleValues) {
|
||||
fIdLabelMap.put(value, con.getLabelForValue(value));
|
||||
|
@ -228,7 +228,7 @@ public class AddCatchpointDialog extends Dialog implements ModifyListener, Selec
|
|||
*/
|
||||
protected void configureShell(Shell 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();
|
||||
IPreferenceStore preferenceStore = page.getPreferenceStore();
|
||||
if (preferenceStore != null) {
|
||||
fEventArgument = preferenceStore.getString(ICCatchpoint.EVENT_ARG);
|
||||
fEventArgument = preferenceStore.getString(ICEventBreakpoint.EVENT_ARG);
|
||||
}
|
||||
else
|
||||
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 org.eclipse.cdt.debug.core.model.ICAddressBreakpoint;
|
||||
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.ICLineBreakpoint;
|
||||
import org.eclipse.cdt.debug.core.model.ICWatchpoint;
|
||||
|
@ -372,7 +372,7 @@ public class CBreakpointPropertyPage extends FieldEditorPreferencePage implement
|
|||
return PropertyPageMessages.getString("CBreakpointPropertyPage.4");
|
||||
if (breakpoint instanceof ICLineBreakpoint)
|
||||
return PropertyPageMessages.getString("CBreakpointPropertyPage.8");
|
||||
if (breakpoint instanceof ICCatchpoint)
|
||||
if (breakpoint instanceof ICEventBreakpoint)
|
||||
return PropertyPageMessages.getString("CBreakpointPropertyPage.21");
|
||||
if (breakpoint instanceof ICWatchpoint) {
|
||||
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.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.core.runtime.CoreException;
|
||||
import org.eclipse.core.runtime.IAdapterFactory;
|
||||
|
@ -31,15 +31,15 @@ import org.eclipse.swt.graphics.Image;
|
|||
/**
|
||||
* Factory for event breakpoint label provider
|
||||
*/
|
||||
public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
||||
public static final String IMG_OBJS_CATCHPOINT_ENABLED = "icons/obj16/catchpoint_obj.gif"; //$NON-NLS-1$
|
||||
public static final String IMG_OBJS_CATCHPOINT_DISABLED = "icons/obj16/catchpointd_obj.gif"; //$NON-NLS-1$
|
||||
public class CEventBreakpointsLabelProviderFactory implements IAdapterFactory {
|
||||
public static final String IMG_OBJS_EVENTBREAKPOINT_ENABLED = "icons/obj16/eventbreakpoint_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() {
|
||||
@Override
|
||||
public String getText(Object element) {
|
||||
if (element instanceof ICCatchpoint) {
|
||||
if (element instanceof ICEventBreakpoint) {
|
||||
try {
|
||||
ICCatchpoint breakpoint = (ICCatchpoint) element;
|
||||
ICEventBreakpoint breakpoint = (ICEventBreakpoint) element;
|
||||
|
||||
ICBreakpointsUIContribution bscs[] = CBreakpointUIContributionFactory.getInstance()
|
||||
.getBreakpointUIContributions(breakpoint);
|
||||
|
@ -51,7 +51,7 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
|||
for (ICBreakpointsUIContribution con : bscs) {
|
||||
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));
|
||||
continue;
|
||||
}
|
||||
|
@ -80,12 +80,12 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
|||
@Override
|
||||
public Image getImage(Object element) {
|
||||
try {
|
||||
if (element instanceof ICCatchpoint) {
|
||||
ICCatchpoint catchpoint = (ICCatchpoint) element;
|
||||
if (catchpoint.isEnabled())
|
||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_CATCHPOINT_ENABLED);
|
||||
if (element instanceof ICEventBreakpoint) {
|
||||
ICEventBreakpoint eventBkpt = (ICEventBreakpoint) element;
|
||||
if (eventBkpt.isEnabled())
|
||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_ENABLED);
|
||||
else
|
||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_CATCHPOINT_DISABLED);
|
||||
return CDebugUIPlugin.getDefault().getImage(IMG_OBJS_EVENTBREAKPOINT_DISABLED);
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
CDebugUIPlugin.log(e);
|
||||
|
@ -118,7 +118,7 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
|||
protected String getLabel(TreePath elementPath, IPresentationContext context, String columnId)
|
||||
throws CoreException {
|
||||
|
||||
ICCatchpoint cp = (ICCatchpoint) elementPath.getLastSegment();
|
||||
ICEventBreakpoint cp = (ICEventBreakpoint) elementPath.getLastSegment();
|
||||
return fLabelProvider.getText(cp);
|
||||
|
||||
}
|
||||
|
@ -133,12 +133,12 @@ public class CCatchpointsLabelProviderFactory implements IAdapterFactory {
|
|||
*/
|
||||
public Object getAdapter(Object adaptableObject, Class adapterType) {
|
||||
if (adapterType.equals(IElementLabelProvider.class)) {
|
||||
if (adaptableObject instanceof ICCatchpoint) {
|
||||
if (adaptableObject instanceof ICEventBreakpoint) {
|
||||
return fElementLabelProvider;
|
||||
}
|
||||
}
|
||||
if (adapterType.equals(ILabelProvider.class)) {
|
||||
if (adaptableObject instanceof ICCatchpoint) {
|
||||
if (adaptableObject instanceof ICEventBreakpoint) {
|
||||
return fLabelProvider;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue