use of com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.Condition in project binnavi by google.
the class CBreakpointTableModel method getBreakpointCondition.
/**
* Returns the breakpoint condition for the breakpoint in the given row.
*
* @param row Row index of the breakpoint.
*
* @return Formula string of the breakpoint condition.
*/
private String getBreakpointCondition(final int row) {
final Pair<IDebugger, Integer> breakpoint = CBreakpointTableHelpers.findBreakpoint(m_debuggerProvider, row);
final BreakpointManager manager = breakpoint.first().getBreakpointManager();
final int breakpointIndex = breakpoint.second();
final Condition condition = manager.getBreakpoint(BreakpointType.REGULAR, breakpointIndex).getCondition();
return condition == null ? "" : condition.toString();
}
use of com.google.security.zynamics.binnavi.debug.models.breakpoints.interfaces.Condition in project binnavi by google.
the class BreakpointManager method setBreakpointCondition.
public void setBreakpointCondition(final int breakpointIndex, final String formula) {
Preconditions.checkNotNull(formula, "Error: formula argument can not be null.");
final Breakpoint breakpoint = getBreakpoint(BreakpointType.REGULAR, breakpointIndex);
final Set<Breakpoint> conditinalBreakPoints = Sets.newHashSet();
Condition condition = null;
try {
condition = BreakpointConditionParser.evaluate(formula);
} catch (final InvalidFormulaException exception) {
CUtilityFunctions.logException(exception);
}
breakpoint.setCondition(condition);
conditinalBreakPoints.add(breakpoint);
for (final BreakpointManagerListener listener : listeners) {
try {
listener.breakpointsConditionChanged(conditinalBreakPoints);
} catch (final Exception exception) {
CUtilityFunctions.logException(exception);
}
}
}
Aggregations