mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-22 08:25:25 +02:00
Bug 456959-Breakpoint Enable does not work after restarting the application
Change-Id: I97e1256a3c718ed653ad255bffe1fa67ae5368c2
This commit is contained in:
parent
1e441c619d
commit
6dda632d25
2 changed files with 52 additions and 35 deletions
|
@ -9,6 +9,7 @@
|
||||||
* Onur Akdemir (TUBITAK BILGEM-ITI) - Multi-process debugging (Bug 237306)
|
* Onur Akdemir (TUBITAK BILGEM-ITI) - Multi-process debugging (Bug 237306)
|
||||||
* Marc Khouzam (Ericsson) - Workaround for Bug 352998
|
* Marc Khouzam (Ericsson) - Workaround for Bug 352998
|
||||||
* Marc Khouzam (Ericsson) - Update breakpoint handling for GDB >= 7.4 (Bug 389945)
|
* Marc Khouzam (Ericsson) - Update breakpoint handling for GDB >= 7.4 (Bug 389945)
|
||||||
|
* Alvaro Sanchez-Leon (Ericsson) - Breakpoint Enable does not work after restarting the application (Bug 456959)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.dsf.gdb.service;
|
package org.eclipse.cdt.dsf.gdb.service;
|
||||||
|
|
||||||
|
@ -628,16 +629,25 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 implements IMultiTerminat
|
||||||
@Override
|
@Override
|
||||||
public void eventDispatched(IExitedDMEvent e) {
|
public void eventDispatched(IExitedDMEvent e) {
|
||||||
IDMContext dmc = e.getDMContext();
|
IDMContext dmc = e.getDMContext();
|
||||||
|
|
||||||
|
if (dmc instanceof IContainerDMContext) {
|
||||||
|
MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class);
|
||||||
|
|
||||||
|
// Time to remove the tracking of a restarting process
|
||||||
|
boolean restarting = fProcRestarting.remove(dmc);
|
||||||
|
|
||||||
|
if (bpmService != null) {
|
||||||
|
if (!restarting) {
|
||||||
|
// Process exited, remove it from the thread break point filtering
|
||||||
|
bpmService.removeTargetFilter((IContainerDMContext) dmc);
|
||||||
|
|
||||||
if (dmc instanceof IBreakpointsTargetDMContext) {
|
if (dmc instanceof IBreakpointsTargetDMContext) {
|
||||||
// A process has died, we should stop tracking its breakpoints, but only if it is not restarting
|
// A process has died, we should stop tracking its breakpoints, but only if it is not restarting
|
||||||
// We only do this when the process is a breakpointTargetDMC itself (GDB < 7.4);
|
// We only do this when the process is a breakpointTargetDMC itself (GDB < 7.4);
|
||||||
// we don't want to stop tracking breakpoints when breakpoints are only set once
|
// we don't want to stop tracking breakpoints when breakpoints are only set once
|
||||||
// for all processes (GDB >= 7.4)
|
// for all processes (GDB >= 7.4)
|
||||||
if (!fProcRestarting.remove(dmc)) {
|
|
||||||
if (fBackend.getSessionType() != SessionType.CORE) {
|
if (fBackend.getSessionType() != SessionType.CORE) {
|
||||||
IBreakpointsTargetDMContext bpTargetDmc = (IBreakpointsTargetDMContext) dmc;
|
IBreakpointsTargetDMContext bpTargetDmc = (IBreakpointsTargetDMContext) dmc;
|
||||||
MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class);
|
|
||||||
if (bpmService != null) {
|
|
||||||
bpmService.stopTrackingBreakpoints(bpTargetDmc, new ImmediateRequestMonitor() {
|
bpmService.stopTrackingBreakpoints(bpTargetDmc, new ImmediateRequestMonitor() {
|
||||||
@Override
|
@Override
|
||||||
protected void handleCompleted() {
|
protected void handleCompleted() {
|
||||||
|
@ -649,6 +659,7 @@ public class GDBProcesses_7_2 extends GDBProcesses_7_1 implements IMultiTerminat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
super.eventDispatched(e);
|
super.eventDispatched(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,8 @@
|
||||||
* Marc Khouzam (Ericsson) - Generalize thread filtering logic (Bug 431986)
|
* Marc Khouzam (Ericsson) - Generalize thread filtering logic (Bug 431986)
|
||||||
* Marc Khouzam (Ericsson) - Accept multiple calls to startTrackingBreakpoints (Bug 389945)
|
* Marc Khouzam (Ericsson) - Accept multiple calls to startTrackingBreakpoints (Bug 389945)
|
||||||
* Marc Khouzam (Ericsson) - Support for dynamic printf (Bug 400628)
|
* Marc Khouzam (Ericsson) - Support for dynamic printf (Bug 400628)
|
||||||
* Alvaro Sanchez-Leon (Ericcson) - Sometimes breakpoints set and immediately deleted when debugging with GDB (Bug 442394)
|
* Alvaro Sanchez-Leon (Ericsson) - Sometimes breakpoints set and immediately deleted when debugging with GDB (Bug 442394)
|
||||||
|
* Alvaro Sanchez-Leon (Ericsson) - Breakpoint Enable does not work after restarting the application (Bug 456959)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.dsf.mi.service;
|
package org.eclipse.cdt.dsf.mi.service;
|
||||||
|
@ -1529,15 +1530,20 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
|
||||||
*/
|
*/
|
||||||
@DsfServiceEventHandler
|
@DsfServiceEventHandler
|
||||||
public void eventDispatched(IExitedDMEvent e) {
|
public void eventDispatched(IExitedDMEvent e) {
|
||||||
if (e.getDMContext() instanceof IContainerDMContext) {
|
// original code moved to API removeTargetFilter (Bug 456959)
|
||||||
// Process exited, remove it from the thread filtering of all breakpoints
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove process from the thread filtering of all breakpoints
|
||||||
|
* @since 4.6
|
||||||
|
*/
|
||||||
|
public void removeTargetFilter(IContainerDMContext containerDMC) {
|
||||||
// We must get the list of breakpoints from the platform because our different
|
// We must get the list of breakpoints from the platform because our different
|
||||||
// maps might already have been cleaned up
|
// maps might already have been cleaned up
|
||||||
IBreakpoint[] allBreakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(fDebugModelId);
|
IBreakpoint[] allBreakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(fDebugModelId);
|
||||||
for (IBreakpoint bp : allBreakpoints) {
|
for (IBreakpoint bp : allBreakpoints) {
|
||||||
if (supportsBreakpoint(bp)) {
|
if (supportsBreakpoint(bp)) {
|
||||||
removeTargetFilter((ICBreakpoint)bp, (IContainerDMContext)e.getDMContext());
|
removeTargetFilter((ICBreakpoint) bp, containerDMC);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue