FLEX-34296: Disable and Remove Breakpoint should now respect the Worker logic


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/85d2f5ea
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/85d2f5ea
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/85d2f5ea

Branch: refs/heads/develop
Commit: 85d2f5eac9c3b62224550c8712f7965d89233119
Parents: 2759e05
Author: Fr�d�ric THMOAS <ftho...@apache.org>
Authored: Sat May 3 16:43:44 2014 +0100
Committer: Fr�d�ric THMOAS <ftho...@apache.org>
Committed: Sat May 3 16:43:44 2014 +0100

----------------------------------------------------------------------
 .../flex/tools/debugger/cli/BreakAction.java    |  4 +--
 .../java/flex/tools/debugger/cli/DebugCLI.java  | 31 ++++++++------------
 2 files changed, 15 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/85d2f5ea/modules/debugger/src/java/flex/tools/debugger/cli/BreakAction.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flex/tools/debugger/cli/BreakAction.java 
b/modules/debugger/src/java/flex/tools/debugger/cli/BreakAction.java
index ddf7c08..92b6779 100644
--- a/modules/debugger/src/java/flex/tools/debugger/cli/BreakAction.java
+++ b/modules/debugger/src/java/flex/tools/debugger/cli/BreakAction.java
@@ -131,7 +131,7 @@ public class BreakAction
        /*
         * Check to see if our location matches the requested one
         */
-       public boolean locationMatches(int fileId, int line)
+       public boolean locationMatches(int fileId, int line, int isolateId)
        {
                boolean match = false;
                LocationCollection col = getLocations();
@@ -143,7 +143,7 @@ public class BreakAction
                        while(!match && itr.hasNext())
                        {
                                Location l = (Location)itr.next();
-                               if (l != null && l.getFile().getId() == fileId 
&& l.getLine() == line)
+                               if (l != null && l.getFile().getId() == fileId 
&& l.getLine() == line && l.getIsolateId() == isolateId)
                                        match = true;
                        }
                }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/85d2f5ea/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java 
b/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java
index 072b927..50eba1f 100644
--- a/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java
+++ b/modules/debugger/src/java/flex/tools/debugger/cli/DebugCLI.java
@@ -2970,12 +2970,14 @@ public class DebugCLI implements Runnable, 
SourceLocator {
     BreakAction removeBreakpointAt(int at) throws 
ArrayIndexOutOfBoundsException, NotConnectedException {
         BreakAction a = breakpointAt(at);
 //             if (isolateId == Isolate.DEFAULT_ID)
-        m_breakpoints.removeElementAt(at);
 //             else
 //                     
getIsolateState(isolateId).m_breakpoints.removeElementAt(at);
 
-        if (a.getStatus() == BreakAction.RESOLVED)
+        if (a.getStatus() == BreakAction.RESOLVED) {
             breakDisableRequest(a.getLocations());
+            m_breakpoints.removeElementAt(at);
+        }
+
         return a;
     }
 
@@ -3262,25 +3264,18 @@ public class DebugCLI implements Runnable, 
SourceLocator {
         do {
             at = breakpointIndexOf(l, at);
             if (at > -1) {
-                if (breakpointAt(at).isEnabled())
+                if (breakpointAt(at).isEnabled()) {
                     hit = true;
+                    try {
+                        m_session.clearBreakpoint(l);
+                    } catch (NoResponseException nre) {
+                    }
+                }
                 else
                     at++; // our location match is not enabled but let's 
continue after the hit
             }
         }
         while (at > -1 && !hit);
-
-        // no one matches, so let's remove it at the session level
-        if (!hit) {
-            Iterator<Location> itr = col.iterator();
-            while (itr.hasNext()) {
-                l = itr.next();
-                try {
-                    m_session.clearBreakpoint(l);
-                } catch (NoResponseException nre) {
-                }
-            }
-        }
     }
 
     BreakAction breakpointAt(int at) {
@@ -3316,7 +3311,7 @@ public class DebugCLI implements Runnable, SourceLocator {
         int hit = -1;
         for (int i = start; (hit < 0) && (i < size); i++) {
             BreakAction b = breakpointAt(i);
-            if (b.locationMatches(fileId, line) && (includeDisabled || 
b.isEnabled()))
+            if (b.locationMatches(fileId, line, m_activeIsolate) && 
(includeDisabled || b.isEnabled()))
                 hit = i;
         }
         return hit;
@@ -3329,7 +3324,7 @@ public class DebugCLI implements Runnable, SourceLocator {
 
         for (int i = 0; (hit < 0) && (i < size); i++) {
             BreakAction b = breakpointAt(i);
-            if (b.getId() == id)
+            if (b.getId() == id && b.getLocation().getIsolateId() == 
m_activeIsolate)
                 hit = i;
         }
         return hit;
@@ -5591,7 +5586,7 @@ public class DebugCLI implements Runnable, SourceLocator {
         IsolateSession workerSession = m_session.getWorkerSession(isolateId);
         for (int i = 0; i < count; i++) {
             BreakAction a = breakpointAt(i);
-            if (a.locationMatches(fileId, line)) {
+            if (a.locationMatches(fileId, line, isolateId)) {
                 /**
                  * Note that it appears that we stopped due to hitting a hard 
breakpoint
                  * Now if the breakpoint is conditional it may eval to false, 
meaning we

Reply via email to