mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 344636: Breakpoints disappear when restarting the inferior
This commit is contained in:
parent
a9a60065f6
commit
9995c38ddb
2 changed files with 40 additions and 10 deletions
|
@ -1248,10 +1248,12 @@ public class GDBProcesses_7_0 extends AbstractDsfService
|
||||||
fProcRestarting = true;
|
fProcRestarting = true;
|
||||||
startOrRestart(containerDmc, attributes, true, new DataRequestMonitor<IContainerDMContext>(ImmediateExecutor.getInstance(), rm) {
|
startOrRestart(containerDmc, attributes, true, new DataRequestMonitor<IContainerDMContext>(ImmediateExecutor.getInstance(), rm) {
|
||||||
@Override
|
@Override
|
||||||
protected void handleFailure() {
|
protected void handleCompleted() {
|
||||||
fProcRestarting = false;
|
if (!isSuccess()) {
|
||||||
|
fProcRestarting = false;
|
||||||
|
}
|
||||||
setData(getData());
|
setData(getData());
|
||||||
super.handleFailure();
|
super.handleCompleted();
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.service;
|
package org.eclipse.cdt.dsf.gdb.service;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
|
||||||
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
|
import org.eclipse.cdt.dsf.concurrent.DsfExecutor;
|
||||||
|
@ -54,6 +56,13 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 {
|
||||||
private IGDBControl fCommandControl;
|
private IGDBControl fCommandControl;
|
||||||
private IGDBBackend fBackend;
|
private IGDBBackend fBackend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set of processes that are currently being restarted.
|
||||||
|
* We use this set for such things as not removing breakpoints
|
||||||
|
* because we know the process will be restarted.
|
||||||
|
*/
|
||||||
|
private Set<IContainerDMContext> fProcRestarting = new HashSet<IContainerDMContext>();
|
||||||
|
|
||||||
public GDBProcesses_7_2(DsfSession session) {
|
public GDBProcesses_7_2(DsfSession session) {
|
||||||
super(session);
|
super(session);
|
||||||
}
|
}
|
||||||
|
@ -318,6 +327,23 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 {
|
||||||
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm);
|
return new DebugNewProcessSequence_7_2(executor, isInitial, dmc, file, attributes, rm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void restart(final IContainerDMContext containerDmc, Map<String, Object> attributes,
|
||||||
|
DataRequestMonitor<IContainerDMContext> rm) {
|
||||||
|
fProcRestarting.add(containerDmc);
|
||||||
|
super.restart(containerDmc, attributes, new DataRequestMonitor<IContainerDMContext>(ImmediateExecutor.getInstance(), rm) {
|
||||||
|
@Override
|
||||||
|
protected void handleCompleted() {
|
||||||
|
if (!isSuccess()) {
|
||||||
|
fProcRestarting.remove(containerDmc);
|
||||||
|
}
|
||||||
|
setData(getData());
|
||||||
|
super.handleCompleted();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
|
@ -326,13 +352,15 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 {
|
||||||
public void eventDispatched(IExitedDMEvent e) {
|
public void eventDispatched(IExitedDMEvent e) {
|
||||||
IDMContext dmc = e.getDMContext();
|
IDMContext dmc = e.getDMContext();
|
||||||
if (dmc instanceof IContainerDMContext) {
|
if (dmc instanceof IContainerDMContext) {
|
||||||
// A process has died, we should stop tracking its breakpoints
|
// A process has died, we should stop tracking its breakpoints, but only if it is not restarting
|
||||||
if (fBackend.getSessionType() != SessionType.CORE) {
|
if (!fProcRestarting.remove(dmc)) {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class);
|
if (fBackend.getSessionType() != SessionType.CORE) {
|
||||||
MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class);
|
IBreakpointsTargetDMContext bpTargetDmc = DMContexts.getAncestorOfType(dmc, IBreakpointsTargetDMContext.class);
|
||||||
if (bpmService != null) {
|
MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class);
|
||||||
bpmService.stopTrackingBreakpoints(bpTargetDmc, new RequestMonitor(ImmediateExecutor.getInstance(), null));
|
if (bpmService != null) {
|
||||||
}
|
bpmService.stopTrackingBreakpoints(bpTargetDmc, new RequestMonitor(ImmediateExecutor.getInstance(), null));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue