1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-22 22:22:11 +02:00

Bug 433044 - Deleting a bp from gdb console causes it to be re-installed

Change-Id: I3e7b26bc31104fc8ef12c1330c0a0ff2125da8ae
Signed-off-by: Marc Khouzam <marc.khouzam@ericsson.com>
Reviewed-on: https://git.eclipse.org/r/25266
Tested-by: Hudson CI
Reviewed-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
Tested-by: Mikhail Khodjaiants <mikhailkhod@googlemail.com>
This commit is contained in:
Marc Khouzam 2014-04-17 16:20:09 -04:00
parent fe24fd0570
commit b985a7fc54
2 changed files with 26 additions and 0 deletions

View file

@ -764,6 +764,11 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
final Map<ICBreakpoint, Set<String>> threadsIDs = fBreakpointThreads.get(dmc);
assert threadsIDs != null;
// Remove all relevant target filters
// Note that this call is important if a breakpoint is removed directly
// from the gdb console, or else we will try to re-install it (bug 433044)
removeAllTargetFilters(dmc, breakpoint);
// Remove breakpoint problem marker (if any)
removeBreakpointProblemMarker(breakpoint);
@ -1506,6 +1511,19 @@ public class MIBreakpointsManager extends AbstractDsfService implements IBreakpo
}
}
private void removeAllTargetFilters(IBreakpointsTargetDMContext bpTargetDmc, ICBreakpoint breakpoint) {
try {
IDsfBreakpointExtension filterExt = getFilterExtension(breakpoint);
IContainerDMContext[] targets = filterExt.getTargetFilters();
for (IContainerDMContext target : targets) {
if (bpTargetDmc.equals(target) || DMContexts.isAncestorOf(target, bpTargetDmc)) {
filterExt.removeTargetFilter(target);
}
}
} catch (CoreException e) {
}
}
//-------------------------------------------------------------------------
// Session exit
//-------------------------------------------------------------------------

View file

@ -289,6 +289,14 @@ public class GDBConsoleBreakpointsTest extends BaseTestCase {
Assert.assertTrue(plBpt instanceof CBreakpoint);
waitForInstallCountChange((CBreakpoint)plBpt, 0);
// Make sure the breakpoint does not get re-installed
// once it gets a notification that the platform bp changed
// (through its install count changing) Bug 433044
// Give it some time and verify that it is still 0.
Thread.sleep(3000); // One second was not enough
Assert.assertTrue("Install count no longer 0",
((CBreakpoint)plBpt).getInstallCount() == 0);
// Set the console breakpoint again and verify that
// the install count of the platform breakpoint is 1
// for installed breakpoints and 0 for pending breakpoints.