|
From: <mba...@us...> - 2007-02-25 15:43:44
|
Revision: 2026
http://svn.sourceforge.net/rubyeclipse/?rev=2026&view=rev
Author: mbarchfe
Date: 2007-02-25 07:43:09 -0800 (Sun, 25 Feb 2007)
Log Message:
-----------
fix adding/removing breakpoints, thread suspension
Modified Paths:
--------------
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java
trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ClassicDebuggerCommandFactory.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -68,4 +68,8 @@
public String createCatchOn(IBreakpoint breakpoint) throws CoreException {
return "catch " + ((RubyExceptionBreakpoint) breakpoint).getException();
}
+
+ public String createThreadStop(RubyThread thread) {
+ return "th stop " +thread.getId() ;
+ }
}
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/ICommandFactory.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -21,6 +21,8 @@
public String createStepInto(RubyStackFrame stackFrame);
public String createReadThreads();
+
+ public String createThreadStop(RubyThread thread);
public String createInspect(RubyStackFrame frame, String expression);
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebugCommandFactory.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -68,4 +68,8 @@
public String createCatchOn(IBreakpoint breakpoint) throws CoreException {
return "catch " + ((RubyExceptionBreakpoint) breakpoint).getException();
}
+
+ public String createThreadStop(RubyThread thread) {
+ return "thread stop " + thread.getId();
+ }
}
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyDebuggerProxy.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -115,7 +115,7 @@
public void updateBreakpoint(IBreakpoint breakpoint, IMarkerDelta markerDelta) {
int currentline = markerDelta.getAttribute(IMarker.LINE_NUMBER, -1);
try {
- if (currentline == ((RubyLineBreakpoint) breakpoint).getLineNumber()) {
+ if (breakpoint instanceof RubyLineBreakpoint && currentline == ((RubyLineBreakpoint) breakpoint).getLineNumber()) {
return;
}
this.removeBreakpoint(breakpoint);
@@ -224,6 +224,15 @@
RdtDebugCorePlugin.log(e);
}
}
+
+ public void sendThreadStop(RubyThread thread) {
+ try {
+ String command = commandFactory.createThreadStop(thread) ;
+ new GenericCommand(command, true /* isControl */).execute(debuggerConnection);
+ } catch (Exception e) {
+ RdtDebugCorePlugin.log(e);
+ }
+ }
public RubyStackFrame[] readFrames(RubyThread thread) {
try {
Modified: trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java
===================================================================
--- trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java 2007-02-24 20:54:22 UTC (rev 2025)
+++ trunk/org.rubypeople.rdt.debug.core/src/org/rubypeople/rdt/internal/debug/core/RubyExceptionBreakpoint.java 2007-02-25 15:43:09 UTC (rev 2026)
@@ -24,7 +24,8 @@
public RubyExceptionBreakpoint(final String exception) throws CoreException {
// we need to have a resource, because the marker needs it (BTW: why the hell do
- // we need a marker for?)
+ // we need a marker for?) Possible Answer: so that changes can be detected and
+ // propagated to the DebugTarget in the same manner as for Line Breakpoints?
// The workspace root is chosen because JavaExceptionsBreakpoints do so as well
final IResource resource = ResourcesPlugin.getWorkspace().getRoot() ;
IWorkspaceRunnable wr = new IWorkspaceRunnable() {
@@ -32,10 +33,11 @@
public void run(IProgressMonitor monitor) throws CoreException {
setMarker(resource.createMarker(RubyLineBreakpoint.RUBY_BREAKPOINT_MARKER));
getMarker().setAttribute(RUBY_EXCEPTION_ATTR, exception);
- // REGISTERED ?
+ setEnabled(true);
+ // not yet registered with the BreakpointManager ..
getMarker().setAttribute(REGISTERED, false);
+ // .. but now please do so and add the breakpoint to the breakpoint manager
setRegistered(true);
- setEnabled(true);
}
};
try {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|