From 73bf2abf5ad1f662719c69a78b9643245ee451ed Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Wed, 4 Sep 2002 16:07:14 +0000 Subject: [PATCH] Always set the condition and the ignore count, it may be away to reset some values. --- .../debug/mi/core/cdi/BreakpointManager.java | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java index b72baddd528..1218c6eda0a 100644 --- a/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java +++ b/debug/org.eclipse.cdt.debug.mi.core/src/org/eclipse/cdt/debug/mi/core/cdi/BreakpointManager.java @@ -208,43 +208,39 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa throw new CDIException("Not a CDT breakpoint"); } - // We only suppor expression not ignore count reset. + boolean state = suspendInferior(); + CSession s = getCSession(); + CommandFactory factory = s.getMISession().getCommandFactory(); + + // reset the values to sane states. String exprCond = condition.getExpression(); - if (exprCond != null) { - boolean state = suspendInferior(); - CSession s = getCSession(); - CommandFactory factory = s.getMISession().getCommandFactory(); + if (exprCond == null) { + exprCond = ""; + } + int ignoreCount = condition.getIgnoreCount(); + if (ignoreCount < 0) { + ignoreCount = 0; + } + + try { MIBreakCondition breakCondition = factory.createMIBreakCondition(number, exprCond); - try { - s.getMISession().postCommand(breakCondition); - MIInfo info = breakCondition.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new CDIException(e.getMessage()); - } finally { - resumeInferior(state); + s.getMISession().postCommand(breakCondition); + MIInfo info = breakCondition.getMIInfo(); + if (info == null) { + throw new CDIException("No answer"); } - } else { - int ignoreCount = condition.getIgnoreCount(); - boolean state = suspendInferior(); - CSession s = getCSession(); - CommandFactory factory = s.getMISession().getCommandFactory(); MIBreakAfter breakAfter = factory.createMIBreakAfter(number, ignoreCount); - try { - s.getMISession().postCommand(breakAfter); - MIInfo info = breakAfter.getMIInfo(); - if (info == null) { - throw new CDIException("No answer"); - } - } catch (MIException e) { - throw new CDIException(e.getMessage()); - } finally { - resumeInferior(state); + s.getMISession().postCommand(breakAfter); + info = breakAfter.getMIInfo(); + if (info == null) { + throw new CDIException("No answer"); } + } catch (MIException e) { + throw new CDIException(e.getMessage()); + } finally { + resumeInferior(state); } }