1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-11 10:15:39 +02:00

Use -break-after.

This commit is contained in:
Alain Magloire 2002-08-26 20:22:09 +00:00
parent 1983087aaf
commit a07093fbe2

View file

@ -19,6 +19,7 @@ import org.eclipse.cdt.debug.core.cdi.ICDILocationBreakpoint;
import org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint; import org.eclipse.cdt.debug.core.cdi.ICDIWatchpoint;
import org.eclipse.cdt.debug.mi.core.MIException; import org.eclipse.cdt.debug.mi.core.MIException;
import org.eclipse.cdt.debug.mi.core.command.CommandFactory; import org.eclipse.cdt.debug.mi.core.command.CommandFactory;
import org.eclipse.cdt.debug.mi.core.command.MIBreakAfter;
import org.eclipse.cdt.debug.mi.core.command.MIBreakCondition; import org.eclipse.cdt.debug.mi.core.command.MIBreakCondition;
import org.eclipse.cdt.debug.mi.core.command.MIBreakDelete; import org.eclipse.cdt.debug.mi.core.command.MIBreakDelete;
import org.eclipse.cdt.debug.mi.core.command.MIBreakDisable; import org.eclipse.cdt.debug.mi.core.command.MIBreakDisable;
@ -172,23 +173,38 @@ public class BreakpointManager extends SessionObject implements ICDIBreakpointMa
// We only suppor expression not ignore count reset. // We only suppor expression not ignore count reset.
String exprCond = condition.getExpression(); String exprCond = condition.getExpression();
if (exprCond == null) { if (exprCond != null) {
throw new CDIException("ignore count not supported"); CSession s = getCSession();
} CommandFactory factory = s.getMISession().getCommandFactory();
CSession s = getCSession(); MIBreakCondition breakCondition =
CommandFactory factory = s.getMISession().getCommandFactory(); factory.createMIBreakCondition(number, exprCond);
MIBreakCondition breakCondition = try {
factory.createMIBreakCondition(number, exprCond); s.getMISession().postCommand(breakCondition);
try { MIInfo info = breakCondition.getMIInfo();
s.getMISession().postCommand(breakCondition); if (info == null) {
MIInfo info = breakCondition.getMIInfo(); throw new CDIException("No answer");
if (info == null) { }
throw new CDIException("No answer"); } catch (MIException e) {
throw new CDIException(e.toString());
}
} else {
int ignoreCount = condition.getIgnoreCount();
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.toString());
} }
} catch (MIException e) {
throw new CDIException(e.toString());
} }
} }
/** /**
* @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#getBreakpoints() * @see org.eclipse.cdt.debug.core.cdi.ICDIBreakpointManager#getBreakpoints()
*/ */