Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Chouinard2009-01-15 20:10:09 +0000
committerFrancois Chouinard2009-01-15 20:10:09 +0000
commit160d1da8649807e03dc92227e0bf512e9ea86633 (patch)
tree4282290be5e5922cfc5458ce44f2487c0ed94e78 /dsf-gdb
parent0308b568edd6b134c3f10eeeb1343064fbb6491d (diff)
downloadorg.eclipse.cdt-160d1da8649807e03dc92227e0bf512e9ea86633.tar.gz
org.eclipse.cdt-160d1da8649807e03dc92227e0bf512e9ea86633.tar.xz
org.eclipse.cdt-160d1da8649807e03dc92227e0bf512e9ea86633.zip
Fix for Bug261258: ClassCastException on breakpoint action.
Diffstat (limited to 'dsf-gdb')
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java10
-rw-r--r--dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/MILogActionEnabler.java3
2 files changed, 5 insertions, 8 deletions
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
index 58c4586481f..cdebdd9a1ee 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/MIBreakpointsManager.java
@@ -1176,22 +1176,18 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
@DsfServiceEventHandler
public void eventDispatched(MIBreakpointHitEvent e) {
- performBreakpointAction(e.getNumber());
+ performBreakpointAction(e.getDMContext(), e.getNumber());
}
@DsfServiceEventHandler
public void eventDispatched(MIWatchpointTriggerEvent e) {
- performBreakpointAction(e.getNumber());
+ performBreakpointAction(e.getDMContext(), e.getNumber());
}
- private void performBreakpointAction(int number) {
+ private void performBreakpointAction(final IDMContext context, int number) {
// Identify the platform breakpoint
final ICBreakpoint breakpoint = findPlatformBreakpoint(number);
- // FIXME: (Bug228703) Temporary hack to have a context
- Object[] contexts = fTargetBPs.keySet().toArray();
- final IBreakpointsTargetDMContext context = (IBreakpointsTargetDMContext) contexts[0];
-
// Perform the actions asynchronously (otherwise we can have a deadlock...)
new Job("Breakpoint action") { //$NON-NLS-1$
{ setSystem(true); }
diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/MILogActionEnabler.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/MILogActionEnabler.java
index 1caac64543e..989310f65a7 100644
--- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/MILogActionEnabler.java
+++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/breakpoint/actions/MILogActionEnabler.java
@@ -17,6 +17,7 @@ import org.eclipse.cdt.debug.core.breakpointactions.ILogActionEnabler;
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
import org.eclipse.cdt.dsf.concurrent.Query;
+import org.eclipse.cdt.dsf.datamodel.DMContexts;
import org.eclipse.cdt.dsf.datamodel.IDMContext;
import org.eclipse.cdt.dsf.debug.service.IExpressions;
import org.eclipse.cdt.dsf.debug.service.IFormattedValues;
@@ -35,7 +36,7 @@ public class MILogActionEnabler implements ILogActionEnabler {
public MILogActionEnabler(DsfExecutor executor, DsfServicesTracker serviceTracker, IDMContext context) {
fExecutor = executor;
fServiceTracker = serviceTracker;
- fContext = (IBreakpointsTargetDMContext) context;
+ fContext = DMContexts.getAncestorOfType(context, IBreakpointsTargetDMContext.class);
}
public String evaluateExpression(final String expression) throws Exception {

Back to the top