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

Always set the condition and the ignore count, it may be

away to reset some values.
This commit is contained in:
Alain Magloire 2002-09-04 16:07:14 +00:00
parent 3496b65bc6
commit 73bf2abf5a

View file

@ -208,43 +208,39 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
throw new CDIException("Not a CDT breakpoint"); 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(); String exprCond = condition.getExpression();
if (exprCond != null) { if (exprCond == null) {
boolean state = suspendInferior(); exprCond = "";
CSession s = getCSession(); }
CommandFactory factory = s.getMISession().getCommandFactory(); int ignoreCount = condition.getIgnoreCount();
if (ignoreCount < 0) {
ignoreCount = 0;
}
try {
MIBreakCondition breakCondition = MIBreakCondition breakCondition =
factory.createMIBreakCondition(number, exprCond); factory.createMIBreakCondition(number, exprCond);
try { s.getMISession().postCommand(breakCondition);
s.getMISession().postCommand(breakCondition); MIInfo info = breakCondition.getMIInfo();
MIInfo info = breakCondition.getMIInfo(); if (info == null) {
if (info == null) { throw new CDIException("No answer");
throw new CDIException("No answer");
}
} catch (MIException e) {
throw new CDIException(e.getMessage());
} finally {
resumeInferior(state);
} }
} else {
int ignoreCount = condition.getIgnoreCount();
boolean state = suspendInferior();
CSession s = getCSession();
CommandFactory factory = s.getMISession().getCommandFactory();
MIBreakAfter breakAfter = MIBreakAfter breakAfter =
factory.createMIBreakAfter(number, ignoreCount); factory.createMIBreakAfter(number, ignoreCount);
try { s.getMISession().postCommand(breakAfter);
s.getMISession().postCommand(breakAfter); info = breakAfter.getMIInfo();
MIInfo info = breakAfter.getMIInfo(); if (info == null) {
if (info == null) { throw new CDIException("No answer");
throw new CDIException("No answer");
}
} catch (MIException e) {
throw new CDIException(e.getMessage());
} finally {
resumeInferior(state);
} }
} catch (MIException e) {
throw new CDIException(e.getMessage());
} finally {
resumeInferior(state);
} }
} }