From 331061538a10ca16a08dce9c26cbe59a1b624a79 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Mon, 16 May 2005 20:32:30 +0000 Subject: [PATCH] 2005-05-16 Alain Magloire Fix PR 91975 * cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java --- debug/org.eclipse.cdt.debug.mi.core/ChangeLog | 4 ++ .../debug/mi/core/cdi/BreakpointManager.java | 47 +++++++++++++++---- 2 files changed, 42 insertions(+), 9 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog index be1c081b184..019c1b73c33 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.core/ChangeLog @@ -1,3 +1,7 @@ +2005-05-16 Alain Magloire + Fix PR 91975 + * cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java + 2005-05-12 Alain Magloire Fix PR 94841 * cdi/org/eclipse/cdt/debug/mi/core/cdi/model/Variable.java diff --git a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java index d692662fe85..ad1c37b00fb 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/cdi/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java @@ -196,6 +196,16 @@ public class BreakpointManager extends Manager { */ public void enableBreakpoint(Breakpoint breakpoint) throws CDIException { Target target = (Target)breakpoint.getTarget(); + + // Check if the breakpoint is in the deffered list + List dList = (List)deferredMap.get(target); + if (dList != null) { + if (dList.contains(breakpoint)) { + breakpoint.setEnabled0(true); + return; // bail out here, our work is done. + } + } + List bList = (List)breakMap.get(target); if (bList == null) { throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$ @@ -244,6 +254,16 @@ public class BreakpointManager extends Manager { */ public void disableBreakpoint(Breakpoint breakpoint) throws CDIException { Target target = (Target)breakpoint.getTarget(); + + // Check if the breakpoint is in the deffered list + List dList = (List)deferredMap.get(target); + if (dList != null) { + if (dList.contains(breakpoint)) { + breakpoint.setEnabled0(false); + return; // bail out here, our work is done. + } + } + List bList = (List)breakMap.get(target); if (bList == null) { throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$ @@ -293,8 +313,18 @@ public class BreakpointManager extends Manager { * @param newCondition * @throws CDIException */ - public void setCondition(ICDIBreakpoint breakpoint, ICDICondition newCondition) throws CDIException { + public void setCondition(Breakpoint breakpoint, ICDICondition newCondition) throws CDIException { Target target = (Target)breakpoint.getTarget(); + + // Check if the breakpoint is in the deffered list + List dList = (List)deferredMap.get(target); + if (dList != null) { + if (dList.contains(breakpoint)) { + breakpoint.setCondition0(newCondition); + return; // bail out here, our work is done. + } + } + List bList = (List)breakMap.get(target); if (bList == null) { throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$ @@ -303,15 +333,14 @@ public class BreakpointManager extends Manager { throw new CDIException(CdiResources.getString("cdi.BreakpointManager.Not_a_CDT_breakpoint")); //$NON-NLS-1$ } - Breakpoint bpt = (Breakpoint)breakpoint; - MIBreakpoint[] miBreakpoints = bpt.getMIBreakpoints(); + MIBreakpoint[] miBreakpoints = breakpoint.getMIBreakpoints(); deleteMIBreakpoints(target, miBreakpoints); - ICDICondition oldCondition = bpt.getCondition(); + ICDICondition oldCondition = breakpoint.getCondition(); boolean success = false; try { - bpt.setCondition0(newCondition); + breakpoint.setCondition0(newCondition); if (breakpoint instanceof LocationBreakpoint) { - setLocationBreakpoint((LocationBreakpoint)bpt); + setLocationBreakpoint((LocationBreakpoint)breakpoint); } else if (breakpoint instanceof Watchpoint) { setWatchpoint((Watchpoint)breakpoint); } else { @@ -320,9 +349,9 @@ public class BreakpointManager extends Manager { success = true; } finally { if (!success) { - bpt.setCondition0(oldCondition); + breakpoint.setCondition0(oldCondition); if (breakpoint instanceof LocationBreakpoint) { - setLocationBreakpoint((LocationBreakpoint)bpt); + setLocationBreakpoint((LocationBreakpoint)breakpoint); } else if (breakpoint instanceof Watchpoint) { setWatchpoint((Watchpoint)breakpoint); } @@ -330,7 +359,7 @@ public class BreakpointManager extends Manager { } // Fire a changed Event. - miBreakpoints = bpt.getMIBreakpoints(); + miBreakpoints = breakpoint.getMIBreakpoints(); if (miBreakpoints != null && miBreakpoints.length > 0) { MISession miSession = target.getMISession(); miSession.fireEvent(new MIBreakpointChangedEvent(miSession, miBreakpoints[0].getNumber()));