diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java index 454272a7de8..059b177f822 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor.java @@ -218,18 +218,25 @@ public class CLIEventProcessor { // We know something change, we just do not know what. // So the easiest way is to let the top layer handle it. - MIEvent event = new MIBreakpointChangedEvent( - DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class), 0); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class); + if (bpTargetDmc != null) { + MIEvent event = new MIBreakpointChangedEvent(bpTargetDmc, 0); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isSettingSignal(operation)) { - // We do no know which signal let the upper layer find it. - MIEvent event = new MISignalChangedEvent( - DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class), ""); //$NON-NLS-1$ - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + // We do no know which signal let the upper layer find it. + ISignalsDMContext signalDmc = DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class); + if (signalDmc != null) { + MIEvent event = new MISignalChangedEvent(signalDmc, ""); //$NON-NLS-1$ + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isDetach(operation)) { // if it was a "detach" command change the state. - MIEvent event = new MIDetachedEvent(DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class), token); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); + if (controlDmc != null) { + MIEvent event = new MIDetachedEvent(controlDmc, token); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } } diff --git a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java index 681d26ba0ee..b91401806dd 100644 --- a/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java +++ b/dsf-gdb/org.eclipse.cdt.dsf.gdb/src/org/eclipse/cdt/dsf/mi/service/command/CLIEventProcessor_7_0.java @@ -169,18 +169,25 @@ public class CLIEventProcessor_7_0 { // We know something change, we just do not know what. // So the easiest way is to let the top layer handle it. - MIEvent event = new MIBreakpointChangedEvent( - DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class), 0); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class); + if (bpTargetDmc != null) { + MIEvent event = new MIBreakpointChangedEvent(bpTargetDmc, 0); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isSettingSignal(operation)) { - // We do no know which signal let the upper layer find it. - MIEvent event = new MISignalChangedEvent( - DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class), ""); //$NON-NLS-1$ - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + // We do no know which signal let the upper layer find it. + ISignalsDMContext signalDmc = DMContexts.getAncestorOfType(dmc, ISignalsDMContext.class); + if (signalDmc != null) { + MIEvent event = new MISignalChangedEvent(signalDmc, ""); //$NON-NLS-1$ + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } else if (isDetach(operation)) { // if it was a "detach" command change the state. - MIEvent event = new MIDetachedEvent(DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class), token); - fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + ICommandControlDMContext controlDmc = DMContexts.getAncestorOfType(dmc, ICommandControlDMContext.class); + if (controlDmc != null) { + MIEvent event = new MIDetachedEvent(controlDmc, token); + fCommandControl.getSession().dispatchEvent(event, fCommandControl.getProperties()); + } } }