diff options
Diffstat (limited to 'debug')
5 files changed, 140 insertions, 15 deletions
diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIAddressFactoryManagement.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIAddressFactoryManagement.java new file mode 100644 index 00000000000..44b68a4f14b --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIAddressFactoryManagement.java @@ -0,0 +1,24 @@ +/******************************************************************************* + * Copyright (c) 2007 Nokia and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nokia - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +import org.eclipse.cdt.core.IAddressFactory; + +/** + */ +public interface ICDIAddressFactoryManagement { + /** + * Returns an AddressFactory. + * @return a IAddressFactory. + */ + IAddressFactory getAddressFactory(); +} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpointManagement2.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpointManagement2.java new file mode 100644 index 00000000000..e12e252f566 --- /dev/null +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDIBreakpointManagement2.java @@ -0,0 +1,91 @@ +/******************************************************************************* + * Copyright (c) 2007 Nokia and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Nokia - Initial API and implementation + *******************************************************************************/ + +package org.eclipse.cdt.debug.core.cdi.model; + +import org.eclipse.cdt.debug.core.cdi.CDIException; +import org.eclipse.cdt.debug.core.cdi.ICDIAddressLocation; +import org.eclipse.cdt.debug.core.cdi.ICDICondition; +import org.eclipse.cdt.debug.core.cdi.ICDIFunctionLocation; +import org.eclipse.cdt.debug.core.cdi.ICDILineLocation; + +public interface ICDIBreakpointManagement2 { + + /** + * Set a line breakpoint. + * + * @param type + * @param location + * @param condition + * @param deferred + * @param enabled + * @return + * @throws CDIException + */ + ICDILineBreakpoint setLineBreakpoint(int type, ICDILineLocation location, + ICDICondition condition, boolean deferred, boolean enabled) throws CDIException; + + /** + * Set a function breakpoint. + * + * @param type + * @param location + * @param condition + * @param deferred + * @param enabled + * @return + * @throws CDIException + */ + ICDIFunctionBreakpoint setFunctionBreakpoint(int type, ICDIFunctionLocation location, + ICDICondition condition, boolean deferred, boolean enabled) throws CDIException; + + /** + * Set an address Breakpoint + * + * @param type + * @param location + * @param condition + * @param deferred + * @param enabled + * @return + * @throws CDIException + */ + ICDIAddressBreakpoint setAddressBreakpoint(int type, ICDIAddressLocation location, + ICDICondition condition, boolean deferred, boolean enabled) throws CDIException; + + /** + * Set a watchpoint. + * + * @param type + * @param watchType + * @param expression + * @param condition + * @param enabled + * @return + * @throws CDIException + */ + ICDIWatchpoint setWatchpoint(int type, int watchType, String expression, + ICDICondition condition, boolean enabled) throws CDIException; + + /** + * Set an exception point. + * + * @param clazz + * @param stopOnThrow + * @param stopOnCatch + * @param enabled + * @return + * @throws CDIException + */ + ICDIExceptionpoint setExceptionBreakpoint(String clazz, boolean stopOnThrow, + boolean stopOnCatch, boolean enabled) throws CDIException; + +} diff --git a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget2.java b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget2.java index 1c9772e6722..df1ba61b163 100644 --- a/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget2.java +++ b/debug/org.eclipse.cdt.debug.core/cdi/org/eclipse/cdt/debug/core/cdi/model/ICDITarget2.java @@ -11,7 +11,6 @@ package org.eclipse.cdt.debug.core.cdi.model; -import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.debug.core.model.IGlobalVariableDescriptor; public interface ICDITarget2 extends ICDITarget { @@ -22,10 +21,4 @@ public interface ICDITarget2 extends ICDITarget { */ IGlobalVariableDescriptor[] getGlobalVariables(); - /** - * Returns an AddressFactory for use with this target. - * @return an IAddressFactory. - */ - IAddressFactory getAddressFactory(); - } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java index 6d8c6ea6ef2..ad71f8e1d50 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/CBreakpointManager.java @@ -8,7 +8,7 @@ * Contributors: * QNX Software Systems - Initial API and implementation * Matthias Spycher (matthias@coware.com) - patch for bug #112008 - * Ken Ryall (Nokia) - bug 170027 + * Ken Ryall (Nokia) - bugs 170027, 105196 *******************************************************************************/ package org.eclipse.cdt.debug.internal.core; @@ -41,6 +41,7 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDIEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIEventListener; 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.ICDIFunctionBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDILineBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDILocationBreakpoint; @@ -644,6 +645,9 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana protected void setBreakpointsOnTarget0( ICBreakpoint[] breakpoints ) { ICDITarget cdiTarget = getCDITarget(); + ICDIBreakpointManagement2 bpManager2 = null; + if (cdiTarget instanceof ICDIBreakpointManagement2) + bpManager2 = (ICDIBreakpointManagement2) cdiTarget; for ( int i = 0; i < breakpoints.length; ++i ) { try { ICDIBreakpoint b = null; @@ -654,13 +658,19 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana ICDIFunctionLocation location = cdiTarget.createFunctionLocation( fileName, function ); ICDICondition condition = createCondition( breakpoint ); fBreakpointProblems.add(BreakpointProblems.reportUnresolvedBreakpoint(breakpoint, getDebugTarget().getName(), getDebugTarget().getInternalID())); - b = cdiTarget.setFunctionBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true ); + if (bpManager2 != null) + bpManager2.setFunctionBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true, breakpoints[i].isEnabled() ); + else + b = cdiTarget.setFunctionBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true ); } else if ( breakpoints[i] instanceof ICAddressBreakpoint ) { ICAddressBreakpoint breakpoint = (ICAddressBreakpoint)breakpoints[i]; String address = breakpoint.getAddress(); ICDIAddressLocation location = cdiTarget.createAddressLocation( new BigInteger ( ( address.startsWith( "0x" ) ) ? address.substring( 2 ) : address, 16 ) ); //$NON-NLS-1$ ICDICondition condition = createCondition( breakpoint ); - b = cdiTarget.setAddressBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true ); + if (bpManager2 != null) + bpManager2.setAddressBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true, breakpoints[i].isEnabled() ); + else + b = cdiTarget.setAddressBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true ); } else if ( breakpoints[i] instanceof ICLineBreakpoint ) { ICLineBreakpoint breakpoint = (ICLineBreakpoint)breakpoints[i]; String handle = breakpoint.getSourceHandle(); @@ -668,7 +678,10 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana ICDILineLocation location = cdiTarget.createLineLocation( path.toPortableString(), breakpoint.getLineNumber() ); ICDICondition condition = createCondition( breakpoint ); fBreakpointProblems.add(BreakpointProblems.reportUnresolvedBreakpoint(breakpoint, getDebugTarget().getName(), getDebugTarget().getInternalID())); - b = cdiTarget.setLineBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true ); + if (bpManager2 != null) + bpManager2.setLineBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true, breakpoints[i].isEnabled() ); + else + b = cdiTarget.setLineBreakpoint( ICDIBreakpoint.REGULAR, location, condition, true ); } else if ( breakpoints[i] instanceof ICWatchpoint ) { ICWatchpoint watchpoint = (ICWatchpoint)breakpoints[i]; int accessType = 0; @@ -676,7 +689,10 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana accessType |= (watchpoint.isReadType()) ? ICDIWatchpoint.READ : 0; String expression = watchpoint.getExpression(); ICDICondition condition = createCondition( watchpoint ); - b = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition ); + if (bpManager2 != null) + bpManager2.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition, breakpoints[i].isEnabled() ); + else + b = cdiTarget.setWatchpoint( ICDIBreakpoint.REGULAR, accessType, expression, condition ); } if ( b != null ) { Object obj = getBreakpointMap().get( breakpoints[i] ); @@ -685,7 +701,7 @@ public class CBreakpointManager implements IBreakpointsListener, IBreakpointMana } } // Hack: see bug 105196: [CDI]: Add "enabled" flag to the "set...Breakpoint" methods - if ( b != null && b.isEnabled() != breakpoints[i].isEnabled() ) { + if (bpManager2 == null && b != null && b.isEnabled() != breakpoints[i].isEnabled() ) { b.setEnabled( breakpoints[i].isEnabled() ); } } diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java index 58c8997023e..0a74700d57c 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CDebugTarget.java @@ -54,6 +54,7 @@ import org.eclipse.cdt.debug.core.cdi.event.ICDIExitedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIRestartedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDIResumedEvent; import org.eclipse.cdt.debug.core.cdi.event.ICDISuspendedEvent; +import org.eclipse.cdt.debug.core.cdi.model.ICDIAddressFactoryManagement; import org.eclipse.cdt.debug.core.cdi.model.ICDIBreakpoint; import org.eclipse.cdt.debug.core.cdi.model.ICDIObject; import org.eclipse.cdt.debug.core.cdi.model.ICDISharedLibrary; @@ -1634,8 +1635,8 @@ public class CDebugTarget extends CDebugElement implements ICDebugTarget, ICDIEv // No binary file, possible when we do pure assembly level debug // Without any binary file involved, ask CDI plugin for default // AddressFactory, if any. - if (fCDITarget instanceof ICDITarget2) { - fAddressFactory = ((ICDITarget2) fCDITarget).getAddressFactory(); + if (fCDITarget instanceof ICDIAddressFactoryManagement) { + fAddressFactory = ((ICDIAddressFactoryManagement) fCDITarget).getAddressFactory(); } } } |