|
From: Markus B. <mba...@us...> - 2005-10-03 07:16:36
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20910/src/org/rubypeople/rdt/internal/debug/core Modified Files: RubyDebuggerProxy.java Log Message: merged from SRB_0-6-1_1 Index: RubyDebuggerProxy.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** RubyDebuggerProxy.java 1 Oct 2005 23:11:09 -0000 1.16 --- RubyDebuggerProxy.java 3 Oct 2005 07:16:25 -0000 1.17 *************** *** 6,10 **** --- 6,13 ---- import java.io.PrintWriter; import java.net.Socket; + import org.eclipse.core.resources.IMarker; + import org.eclipse.core.resources.IMarkerDelta; + import org.eclipse.core.runtime.CoreException; import org.eclipse.debug.core.DebugPlugin; import org.eclipse.debug.core.model.IBreakpoint; *************** *** 138,142 **** IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! printBreakpoint(breakpoints[i], "add"); } } --- 141,145 ---- IBreakpoint[] breakpoints = DebugPlugin.getDefault().getBreakpointManager().getBreakpoints(IRubyDebugTarget.MODEL_IDENTIFIER); for (int i = 0; i < breakpoints.length; i++) { ! this.addBreakpoint(breakpoints[i]) ; } } *************** *** 144,150 **** public void addBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint(breakpoint, "add"); } catch (IOException e) { RdtDebugCorePlugin.log(e); } } --- 147,157 ---- public void addBreakpoint(IBreakpoint breakpoint) { try { ! if (breakpoint.isEnabled()) { ! this.printBreakpoint("add", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); ! } } catch (IOException e) { RdtDebugCorePlugin.log(e); + } catch (CoreException e) { + RdtDebugCorePlugin.log(e); } } *************** *** 152,156 **** public void removeBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint(breakpoint, "remove"); } catch (IOException e) { RdtDebugCorePlugin.log(e); --- 159,163 ---- public void removeBreakpoint(IBreakpoint breakpoint) { try { ! this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1) ); } catch (IOException e) { RdtDebugCorePlugin.log(e); *************** *** 158,170 **** } ! protected void printBreakpoint(IBreakpoint breakpoint, String mode) throws IOException { StringBuffer setBreakPointCommand = new StringBuffer(); setBreakPointCommand.append("b "); setBreakPointCommand.append(mode); setBreakPointCommand.append(" "); ! setBreakPointCommand.append(breakpoint.getMarker().getResource().getName()); setBreakPointCommand.append(":"); ! setBreakPointCommand.append(breakpoint.getMarker().getAttribute(IMarker.LINE_NUMBER, -1)); this.println(setBreakPointCommand.toString()); } --- 165,189 ---- } + + public void updateBreakpoint(IBreakpoint breakpoint, IMarkerDelta markerDelta) { + // line might have changed or enablement/disablement + try { + // remove is called even if it has not been added at program start + // (happens if enablement changed from disabled at program start to enabled) + this.printBreakpoint("remove", breakpoint.getMarker().getResource().getName(), markerDelta.getAttribute(IMarker.LINE_NUMBER, -1)); + this.addBreakpoint(breakpoint) ; + } catch (IOException e) { + RdtDebugCorePlugin.log(e); + } + } ! protected void printBreakpoint(String mode, String file, int line) throws IOException { StringBuffer setBreakPointCommand = new StringBuffer(); setBreakPointCommand.append("b "); setBreakPointCommand.append(mode); setBreakPointCommand.append(" "); ! setBreakPointCommand.append(file); setBreakPointCommand.append(":"); ! setBreakPointCommand.append(line); this.println(setBreakPointCommand.toString()); } |