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:
parent
3496b65bc6
commit
73bf2abf5a
1 changed files with 26 additions and 30 deletions
|
@ -208,35 +208,32 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
|||
throw new CDIException("Not a CDT breakpoint");
|
||||
}
|
||||
|
||||
// We only suppor expression not ignore count reset.
|
||||
String exprCond = condition.getExpression();
|
||||
if (exprCond != null) {
|
||||
boolean state = suspendInferior();
|
||||
CSession s = getCSession();
|
||||
CommandFactory factory = s.getMISession().getCommandFactory();
|
||||
|
||||
// reset the values to sane states.
|
||||
String exprCond = condition.getExpression();
|
||||
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);
|
||||
}
|
||||
} 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();
|
||||
info = breakAfter.getMIInfo();
|
||||
if (info == null) {
|
||||
throw new CDIException("No answer");
|
||||
}
|
||||
|
@ -246,7 +243,6 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
|
|||
resumeInferior(state);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#getBreakpoints()
|
||||
|
|
Loading…
Add table
Reference in a new issue