/** * Disables a line breakpoint * * @param file * @param line */ @Override public void disableBreakpoint(File file, int line) { BumpBreakpoint bp = findBreakpoint(file, line); if (bp != null) { bump_client.editBreakpoint(bp.getBreakId(), "ENABLE", "FALSE"); } }
/** * Add an exception breakpoint for the given class which should be a subclass of Throwable. The * emode parameters indicates when the breakpoint should be triggered (i.e. when the caught or * uncaught exceptions). */ @Override public void addExceptionBreakpoint( String proj, String cls, BumpExceptionMode emode, BumpBreakMode mode) { if (mode == BumpBreakMode.DEFAULT) mode = break_mode; if (emode == BumpExceptionMode.DEFAULT) emode = exception_mode; bump_client.addExceptionBreakpoint( proj, cls, emode.isCaught(), emode.isUncaught(), mode.isSuspendVm()); }
/** * Disables all breakpoints in the given file * * @param file */ @Override public void disableAllBreakpoints(File file) { Iterator<BumpBreakpoint> it = bump_client.getAllBreakpoints().iterator(); while (it.hasNext()) { BumpBreakpoint bp = it.next(); if (file == null || (bp.getFile() != null && bp.getFile().equals(file))) disableBreakpoint(bp.getFile(), bp.getLineNumber()); } }
/** * Finds the breakpoint at the given file and line * * @param file * @param line * @return the breakpoint */ @Override public BumpBreakpoint findBreakpoint(File file, int line) { for (BumpBreakpoint bb : bump_client.getBreakpoints(file)) { int lno = bb.getIntProperty("LINE"); if (lno == line) { return bb; } } return null; }
/** * Toggle a line breakpoint for the given file. If a line breakpoint already exists at this line * it is removed; otherwise a new breakpoint is created with the current default settings. */ @Override public void toggleBreakpoint(String proj, File file, int line, BumpBreakMode mode) { if (line == 0 || file == null) return; String cls = null; boolean fnd = false; for (BumpBreakpoint bb : bump_client.getBreakpoints(file)) { int lno = bb.getIntProperty("LINE"); if (lno == line) { cls = bb.getProperty("CLASS"); fnd = true; } } if (fnd) clearLineBreakpoint(proj, file, cls, line); else addLineBreakpoint(proj, file, cls, line, mode); }
/** Clear all breakpoints at the given line of the given file. The cls parameter is optional. */ @Override public void clearLineBreakpoint(String proj, File file, String cls, int line) { bump_client.clearLineBreakpoint(proj, file, cls, line); }
/** Add a breakpoint at the give line of the given file. The class is optional. */ @Override public void addLineBreakpoint(String proj, File file, String cls, int line, BumpBreakMode mode) { if (mode == BumpBreakMode.DEFAULT) mode = break_mode; bump_client.addLineBreakpoint(proj, file, cls, line, mode.isSuspendVm(), mode.isTrace()); }
/** Remove breakpoint */ @Override public boolean removeBreakpoint(String id) { return bump_client.editBreakpoint(id, "CLEAR"); }