flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ftho...@apache.org
Subject [12/15] FLEX-34291: Merge the donated FDB with the current one.
Date Wed, 30 Apr 2014 09:59:01 GMT
http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DMessage.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DMessage.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DMessage.java
index e66edb4..a0658a5 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DMessage.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DMessage.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -22,6 +20,7 @@ package flash.tools.debugger.concrete;
 import java.lang.ArrayIndexOutOfBoundsException;
 import java.io.UnsupportedEncodingException;
 
+import flash.tools.debugger.Isolate;
 import flash.util.FieldFormat;
 import flash.util.Trace;
 
@@ -96,9 +95,16 @@ public class DMessage
     public static final int InWatch2					= 55;
     public static final int InPassAllExceptionsToDebugger = 56;
     public static final int InBinaryOp					= 57;
+    public static final int InIsolateCreate				= 58;
+    public static final int InIsolateExit   			= 59;
+    public static final int InIsolateEnumerate			= 60;
+    public static final int InSetActiveIsolate			= 61;
+    public static final int InIsolate			        = 62;
+    public static final int InSetExceptionBreakpoint	= 63;
+    public static final int InRemoveExceptionBreakpoint	= 64;
     // If you add another message here, adjust the following line
     // and add a new case to the inTypeName() method below.
-	public static final int InSIZE						= InBinaryOp + 1;	 /* last ID used +1 */
+	public static final int InSIZE						= InRemoveExceptionBreakpoint + 1;	 /* last ID used +1 */
 
 	/**
 	 * This set of constants defines the message types SENT to the player from our
@@ -152,9 +158,13 @@ public class DMessage
     public static final int OutRemoveWatch2				= 50; // 32-bit id; used for as3
     public static final int OutPassAllExceptionsToDebugger = 51;
     public static final int OutBinaryOp					= 52;
+    public static final int OutIsolateEnumerate			= 53;
+    public static final int OutSetActiveIsolate         = 54;
+    public static final int OutSetExceptionBreakpoint   = 55;
+    public static final int OutRemoveExceptionBreakpoint= 56;
     // If you add another message here, adjust the following line
     // and add a new case to the outTypeName() method below.
-	public static final int OutSIZE						= OutBinaryOp + 1;	 /* last ID used +1 */
+	public static final int OutSIZE						= OutRemoveExceptionBreakpoint + 1;	 /* last ID used +1 */
 
 	/**
 	 * Enums originally extracted from shared_tcserver/tcparser.h; these correspond
@@ -203,12 +213,15 @@ public class DMessage
 	/* Debugging only: The number of bytes from the input that we have formatted into m_debugFormatted */
 	private int m_debugFormattedThroughIndex;
 
+	private int m_targetIsolate;
+	
 	/* used by our cache to create empty DMessages */
 	public DMessage(int size)
 	{
 		m_content = new byte[size];
 		m_debugFormatted = new StringBuilder();
 		m_debugFormattedThroughIndex = 0;
+		m_targetIsolate = Isolate.DEFAULT_ID;
 		clear();
 	}
 
@@ -220,7 +233,9 @@ public class DMessage
 	public int    getSize()				{ return (m_content == null) ? 0 : m_content.length; }
 	public int    getRemaining()		{ return getSize()-m_index; }
 	public int    getPosition()			{ return m_index; }
+	public int getTargetIsolate()      { return m_targetIsolate; }
 	public void   setType(int t)		{ m_type = t; }
+	public void setTargetIsolate(int id) {m_targetIsolate = id;}
 
 	/**
 	 * Gets pointer size (in bytes) expected by the Flash player; either
@@ -256,6 +271,7 @@ public class DMessage
 	public void clear()
 	{
 		setType(-1);
+		setTargetIsolate(Isolate.DEFAULT_ID);
 		m_debugFormatted.setLength(0);
 		m_debugFormattedThroughIndex = 0;
 		reset();
@@ -752,6 +768,34 @@ public class DMessage
             case InBinaryOp:
             	s = "InBinaryOp"; //$NON-NLS-1$
             	break;
+            	
+            case InIsolateCreate:
+            	s = "InIsolateCreate"; //$NON-NLS-1$
+            	break;
+            	
+            case InIsolateExit:
+            	s = "InIsolateExit"; //$NON-NLS-1$
+            	break;
+            	
+            case InIsolateEnumerate:
+            	s = "InIsolateEnumerate"; //$NON-NLS-1$
+            	break;
+            	
+            case InSetActiveIsolate:
+            	s = "InSetActiveIsolate"; //$NON-NLS-1$
+            	break;
+            	
+            case InIsolate:
+            	s = "InIsolate"; //$NON-NLS-1$
+            	break;
+            	
+            case InSetExceptionBreakpoint:
+            	s = "InSetExceptionBreakpoint"; //$NON-NLS-1$
+            	break;
+            	
+            case InRemoveExceptionBreakpoint:
+            	s = "InRemoveExceptionBreakpoint"; //$NON-NLS-1$
+            	break;
 		}
 		return s;
 	}
@@ -949,6 +993,23 @@ public class DMessage
             case OutBinaryOp:
             	s = "OutBinaryOp"; //$NON-NLS-1$
             	break;
+            	
+            case OutIsolateEnumerate:
+            	s = "OutIsolateEnumerate"; //$NON-NLS-1$
+            	break;
+            	
+            case OutSetActiveIsolate:
+            	s = "OutSetActiveIsolate"; //$NON-NLS-1$
+            	break;
+            	
+            case OutSetExceptionBreakpoint:
+            	s = "OutSetExceptionBreakpoint"; //$NON-NLS-1$
+            	break;
+            	
+            case OutRemoveExceptionBreakpoint:
+            	s = "OutRemoveExceptionBreakpoint"; //$NON-NLS-1$
+            	break;
+            	
 		}
    		return s;
 	}

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCache.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCache.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCache.java
index 0bd4012..319235b 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCache.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCache.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCounter.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCounter.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCounter.java
index d9f3587..e13d601 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCounter.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DMessageCounter.java
@@ -1,24 +1,27 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
 
+import java.util.HashMap;
+import java.util.Map;
+
+import flash.tools.debugger.Isolate;
+
 /**
  * This class can be to count the number of messages
  * received during a debug session.
@@ -28,12 +31,19 @@ public class DMessageCounter implements DProtocolNotifierIF
 {
 	long[] m_inCounts;
 	long[] m_outCounts;
+	long m_lastIsolate;
+	Object m_isolateLock;
+	boolean m_isolate;
+	
+	Map<Long, DMessageCounter> m_isolateCounterMap;
 
 	public DMessageCounter()
 	{
 		m_inCounts = new long[DMessage.InSIZE+1];
 		m_outCounts = new long[DMessage.OutSIZE+1];
-
+		m_lastIsolate = 1;
+		m_isolateCounterMap = new HashMap<Long, DMessageCounter>();
+		m_isolateLock = new Object();
 		clearArray(m_inCounts);
 		clearArray(m_outCounts);
 	}
@@ -62,7 +72,7 @@ public class DMessageCounter implements DProtocolNotifierIF
 	 * to block until a message is sent.
 	 */
 	public Object getOutLock() { return m_outCounts; }
-
+	
 	/**
 	 * Collect stats on outgoing messages 
 	 */
@@ -71,13 +81,42 @@ public class DMessageCounter implements DProtocolNotifierIF
 	    int type = msg.getType();
 		if (type < 0 || type >=DMessage.OutSIZE)
 			type = DMessage.OutSIZE;
-
+		long targetIsolate = msg.getTargetIsolate();
 		Object outLock = getOutLock();
+		if (!m_isolate) {
+			synchronized (m_isolateLock) {
+				if (m_lastIsolate != Isolate.DEFAULT_ID) {
+					DMessageCounter counter = m_isolateCounterMap.get(m_lastIsolate);
+					outLock = counter.getOutLock();
+				}
+			}
+		}
 		synchronized (outLock) {
-			m_outCounts[type] += 1;
-			outLock.notifyAll(); // tell anyone who is waiting that a message has been sent
+			
+			if (!m_isolate && targetIsolate != Isolate.DEFAULT_ID) {
+//				if (m_isolateCounterMap.containsKey(targetIsolate)) {
+					DMessageCounter counter = m_isolateCounterMap.get(targetIsolate);				
+					counter.messageSent(msg);
+					m_outCounts[type] += 1;
+					outLock.notifyAll(); // tell anyone who is waiting that a message has been sent
+					//counter.getOutLock().notifyAll();
+//				}
+//				else {
+//					System.out.println("No counter for worker " + targetIsolate);
+//					m_outCounts[type] += 1;
+//					outLock.notifyAll(); // tell anyone who is waiting that a message has been sent
+//				}
+			}
+			else {
+				m_outCounts[type] += 1;
+				outLock.notifyAll(); // tell anyone who is waiting that a message has been sent
+			}
 		}
 	}
+	
+	public void setIsolate(boolean value) {
+		m_isolate = value;
+	}
 
 	/** 
 	 * Collect stats on the messages 
@@ -92,17 +131,67 @@ public class DMessageCounter implements DProtocolNotifierIF
 		/* anything we don't know about goes in a special slot at the end of the array. */
 		if (type < 0 || type >= DMessage.InSIZE)
 			type = DMessage.InSIZE;
-
 		Object inLock = getInLock();
+		if (!m_isolate) {
+			synchronized (m_isolateLock) {
+				if (m_lastIsolate != Isolate.DEFAULT_ID) {
+					DMessageCounter counter = m_isolateCounterMap.get(m_lastIsolate);
+					inLock = counter.getInLock();
+				}
+			}
+		}
+		
 		synchronized (inLock) {
-			m_inCounts[type] += 1;
-			inLock.notifyAll(); // tell anyone who is waiting that a message has been received
+			if (type == DMessage.InIsolate) {
+				long isolate = msg.getDWord();				
+				if (isolate != Isolate.DEFAULT_ID) {
+					/** Check if our map has a counter for this isolate */
+					if (!m_isolateCounterMap.containsKey(isolate)) {
+						DMessageCounter isolateCounter = new DMessageCounter();
+						isolateCounter.setIsolate(true);
+						m_isolateCounterMap.put(isolate, isolateCounter);
+					}
+				}
+				synchronized (m_isolateLock) {
+					m_lastIsolate = isolate;
+				}
+				m_inCounts[type] += 1;
+				inLock.notifyAll(); // tell anyone who is waiting that a message has been received
+			}
+			else if (!m_isolate && m_lastIsolate != Isolate.DEFAULT_ID) {
+				DMessageCounter counter = m_isolateCounterMap.get(m_lastIsolate);
+				counter.messageArrived(msg, which);
+				synchronized (counter.getInLock()) {
+					counter.getInLock().notifyAll();
+				}
+				
+			}
+			else {
+				m_inCounts[type] += 1;
+				inLock.notifyAll(); // tell anyone who is waiting that a message has been received
+			}
 		}
 	}
 
 	/* getters */
 	public long   getInCount(int type)  { synchronized (getInLock()) { return m_inCounts[type]; } }
 	public long   getOutCount(int type) { synchronized (getOutLock()) { return m_outCounts[type]; } }
+	
+	public long   getIsolateInCount(long isolate, int type)  { 
+		DMessageCounter counter = m_isolateCounterMap.get(isolate);
+		return counter.getInCount(type); 
+	}
+
+	public long getIsolateOutCount(long isolate, int type) { 
+		DMessageCounter counter = m_isolateCounterMap.get(isolate);
+		return counter.getOutCount(type); 
+	}
+
+	public Object getIsolateInLock(long isolate)  { 
+		DMessageCounter counter = m_isolateCounterMap.get(isolate);
+		return counter.getInLock(); 
+	}
+
 
 	/* setters */
 	public void clearInCounts()			{ synchronized (getInLock()) { clearArray(m_inCounts); } }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DModule.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DModule.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DModule.java
index c83c134..d2577cb 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DModule.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DModule.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -67,12 +65,13 @@ public class DModule implements SourceFile
 	private int					m_anonymousFunctionCounter = 0;
 	private SourceLocator		m_sourceLocator;
 	private int					m_sourceLocatorChangeCount;
+	private int m_isolateId;
 	private final static String	m_newline = System.getProperty("line.separator"); //$NON-NLS-1$
 
 	/**
 	 * @param name filename in "basepath;package;filename" format
 	 */
-	public DModule(SourceLocator sourceLocator, int id, int bitmap, String name, String script)
+	public DModule(SourceLocator sourceLocator, int id, int bitmap, String name, String script, int isolateId)
 	{
 		// If the caller gave us the script text, then we will create m_script
 		// now.  But if the caller gave us an empty string, then we won't bother
@@ -98,6 +97,7 @@ public class DModule implements SourceFile
 		m_func2LastLine = new HashMap<String, Integer>();
 		m_packageName = nameParser.getPackage();
         m_gotAllFncNames = false;
+        m_isolateId = isolateId;
 	}
 
 	public synchronized ScriptText getScript()
@@ -138,7 +138,7 @@ public class DModule implements SourceFile
 	public int			getId()					{ return m_id; }
 	public int			getBitmap()				{ return m_bitmap; }
 	public int			getLineCount()			{ return getScript().getLineCount(); }
-	public String		getLine(int i)			{ return (i > getLineCount()) ? "// code goes here" : getScript().getLine(i); }
+	public String		getLine(int i)			{ return (i > getLineCount()) ? "// code goes here" : getScript().getLine(i); } //$NON-NLS-1$
 
 	void setPackageName(String name)    { m_packageName = name; }
 
@@ -336,7 +336,7 @@ public class DModule implements SourceFile
         {
             try
             {
-                ps.requestFunctionNames(m_id, -1);
+                ps.requestFunctionNames(m_id, -1, m_isolateId);
             }
             catch (VersionException e)
             {
@@ -726,7 +726,8 @@ public class DModule implements SourceFile
     }
 
     /** for debugging */
-    public String toString()
+    @Override
+	public String toString()
     {
     	return getFullPath();
     }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocol.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocol.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocol.java
index a922428..f611d45 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocol.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocol.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -99,9 +97,10 @@ public class DProtocol implements Runnable
 		m_detectBrokenSocket = detectBrokenSocket;
 	}
 	
+	
 	/**
 	 * Set the base socket options
-	 * @throws SocketException
+	 * @throws java.net.SocketException
 	 */
 	static void applyBaseSocketSettings(Socket s) throws SocketException 
 	{
@@ -281,12 +280,12 @@ public class DProtocol implements Runnable
 					}
 					catch (Exception exc) /* catch unchecked exceptions */
 					{
-						if (Trace.error) 
-						{
+//						if (Trace.error) 
+//						{
 							System.err.println("Error in listener parsing incoming message :"); //$NON-NLS-1$
 							System.err.println(msg.inToString(16));
 							exc.printStackTrace(); 
-						}
+//						}
 					}
 					msg.reset();  /* allow others to reparse the message */
 				}
@@ -425,6 +424,11 @@ public class DProtocol implements Runnable
 		if (size < 0)
 			throw new IOException("socket closed"); //$NON-NLS-1$
 
+//		if (DMessage.inTypeName(command).startsWith("InUnknown")) {
+//			System.out.println("Ignoring unknown message");
+//			size = 0; 
+//		}
+		
 		/** 
 		 * Ask our message cache for a message
 		 */

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocolNotifierIF.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocolNotifierIF.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocolNotifierIF.java
index 870ec01..8144711 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocolNotifierIF.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DProtocolNotifierIF.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DStackContext.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DStackContext.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DStackContext.java
index a0b0519..08f8a77 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DStackContext.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DStackContext.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -48,9 +46,10 @@ public class DStackContext implements Frame
 	private int			m_offset;   /* offset within swf where we halted. (really part of location) */
 	private boolean		m_populated;
 	private DVariable	m_activationObject;
+	private int  m_isolateId;
 
 	public DStackContext(int module, int line, DModule f, long thisId /* bogus */,
-						 String functionSignature, int depth)
+			String functionSignature, int depth, int isolateId)
 	{
 		m_source = f;
 		m_module = module;
@@ -63,7 +62,8 @@ public class DStackContext implements Frame
 		m_locals = new LinkedHashMap<String, DVariable>(); // preserves order
 		m_scopeChain = new ArrayList<DVariable>();
 		m_populated = false;
-		m_location = new DLocation(m_source, line);
+		m_isolateId = isolateId;
+		m_location = new DLocation(m_source, line, isolateId);
 	}
 
 	/*
@@ -128,6 +128,7 @@ public class DStackContext implements Frame
 	void setThis(DVariable v)					{ m_this = v; }
 	void setSwfIndex(int index)					{ m_swfIndex = index; }
 	void setOffset(int offset)					{ m_offset = offset; }
+	void setIsolateId(int id)					{ m_isolateId = id; }
 	void markStale()							{ m_populated = false; } // triggers a reload of variables.
 
 	/**
@@ -153,16 +154,23 @@ public class DStackContext implements Frame
 	/**
 	 * Populate ensures that we have some locals and args. That is
 	 * that we have triggered a InFrame call to the player
-	 * @throws NoResponseException
-	 * @throws NotSuspendedException
-	 * @throws NotConnectedException
+	 * @throws flash.tools.debugger.NoResponseException
+	 * @throws flash.tools.debugger.NotSuspendedException
+	 * @throws flash.tools.debugger.NotConnectedException
 	 */
 	void populate(Session s) throws NoResponseException, NotSuspendedException, NotConnectedException
 	{
 		if (!m_populated)
 		{
-			((PlayerSession)s).requestFrame(m_depth);
+			PlayerSession ses = ((PlayerSession)s);
+			ses.requestFrame(m_depth, m_isolateId);
+			
 			m_populated = true;
 		}
 	}
+
+	public int getIsolateId() 
+	{
+		return m_isolateId;
+	}
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DSuspendInfo.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DSuspendInfo.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DSuspendInfo.java
index bbe2502..e051c21 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DSuspendInfo.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DSuspendInfo.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DSwfInfo.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DSwfInfo.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DSwfInfo.java
index 9f49c10..226dd72 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DSwfInfo.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DSwfInfo.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -25,6 +23,7 @@ import flash.swf.debug.DebugModule;
 import flash.swf.debug.LineRecord;
 import flash.tools.ActionLocation;
 import flash.tools.debugger.InProgressException;
+import flash.tools.debugger.Isolate;
 import flash.tools.debugger.NoResponseException;
 import flash.tools.debugger.Session;
 import flash.tools.debugger.SourceFile;
@@ -61,7 +60,7 @@ public class DSwfInfo implements SwfInfo
 
 	private final static String UNKNOWN = PlayerSessionManager.getLocalizationManager().getLocalizedTextString("unknown"); //$NON-NLS-1$
 
-	public DSwfInfo(int index)	
+	public DSwfInfo(int index, int isolateId)	
 	{	
 		// defaults values of zero
 		m_id = 0;
@@ -73,6 +72,7 @@ public class DSwfInfo implements SwfInfo
 		m_port = 0;
 		m_swdLoading = true;
 		m_scriptsExpected = -1;  // means not yet set by anyone!
+		m_isolateId = isolateId;
 		// rest default to null, 0 or false
 	}
 
@@ -150,7 +150,8 @@ public class DSwfInfo implements SwfInfo
 		if (isSwdLoading() && !isUnloaded())
 		{
 			// make the request 
-			try { ((PlayerSession)s).requestSwfInfo(m_index); } catch(NoResponseException nre) {}
+//			System.out.println("Swdloaded " + m_isolateId);
+			try { ((PlayerSession)s).requestSwfInfo(m_index, m_isolateId); } catch(NoResponseException nre) {}
 
 			// I should now be complete
 			if (!m_swdLoading)
@@ -262,6 +263,7 @@ public class DSwfInfo implements SwfInfo
 
 	// temporary while we parse
 	DManager m_manager;
+	private int m_isolateId = Isolate.DEFAULT_ID;
 
 	/**
 	 * Extracts information out of the SWF/SWD in order to populate
@@ -302,14 +304,20 @@ public class DSwfInfo implements SwfInfo
 			;
 		else if ( (id = local2Global(dm.id)) < 0 )
 			;
-		else if ( (module = m_manager.getSource(id)) == null )
+		else if ( (module = m_manager.getSource(id, Isolate.DEFAULT_ID)) == null )
 			;
 		else
 			module.addLineFunctionInfo(where.actions.getOffset(where.at), line, func);
 	}
 
 	/* for debugging */
+	@Override
 	public String toString() {
 		return m_path;
 	}
+
+	@Override
+	public int getIsolateId() {
+		return m_isolateId;
+	}
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DValue.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DValue.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DValue.java
index a022415..b59954f 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DValue.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DValue.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -27,6 +25,7 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
+import flash.tools.debugger.Isolate;
 import flash.tools.debugger.NoResponseException;
 import flash.tools.debugger.NotConnectedException;
 import flash.tools.debugger.NotSuspendedException;
@@ -42,16 +41,16 @@ import flash.tools.debugger.expression.Context;
  */
 public class DValue implements Value
 {
-	/** @see VariableType */
+	/** @see flash.tools.debugger.VariableType */
 	private int			m_type;
 
-	/** @see Variable#getTypeName() */
+	/** @see flash.tools.debugger.Variable#getTypeName() */
 	private String		m_typeName;
 
-	/** @see Variable#getClassName() */
+	/** @see flash.tools.debugger.Variable#getClassName() */
 	private String		m_className;
 
-	/** @see ValueAttribute */
+	/** @see flash.tools.debugger.ValueAttribute */
 	private int			m_attribs;
 
 	/** Maps "varname" (without its namespace) to a Variable */
@@ -96,6 +95,21 @@ public class DValue implements Value
 	
 	/** Maps duplicate private "varname" to a list of Variable objects */
 	private Map<String, List<DVariable>> m_inheritedPrivates;
+	
+	private int m_isolateId;
+
+
+    /**
+     * Create a top-level variable which has no parent.  This may be used for
+     * _global, _root, stack frames, etc.
+     *
+     * @param id the ID of the variable
+     */
+    public DValue(long id)
+    {
+        init(VariableType.UNKNOWN, null, null, 0, new Long(id));
+        setIsolateId(0);
+    }
 
 
 	/**
@@ -104,9 +118,10 @@ public class DValue implements Value
 	 *
 	 * @param id the ID of the variable
 	 */
-	public DValue(long id)
+	public DValue(long id, int isolateId)
 	{
 		init(VariableType.UNKNOWN, null, null, 0, new Long(id));
+		setIsolateId(isolateId);
 	}
 
 	/**
@@ -121,10 +136,13 @@ public class DValue implements Value
 	 *            for an Object or MovieClip, this should be a Long which contains the
 	 *            ID of this variable.  For a variable of any other type, such as integer
 	 *            or string, this should be the value of the variable.
+	 * @param isolateId
+	 * 			  the worker to which this value belongs
 	 */
-	public DValue(int type, String typeName, String className, int attribs, Object value)
+	public DValue(int type, String typeName, String className, int attribs, Object value, int isolateId)
 	{
 		init(type, typeName, className, attribs, value);
+		setIsolateId(isolateId);
 	}
 
 	/**
@@ -133,18 +151,18 @@ public class DValue implements Value
 	 * There is nothing special about these objects -- it would be just as legitimate for
 	 * anyone who wants a Value for a primitive to make their own subclass of Value.
 	 */
-	public static DValue forPrimitive(Object primitiveValue)
+	public static DValue forPrimitive(Object primitiveValue, int isolateId)
 	{
 		if (primitiveValue == null)
-			return new DValue(VariableType.NULL, "null", "", 0, primitiveValue); //$NON-NLS-1$ //$NON-NLS-2$
+			return new DValue(VariableType.NULL, "null", "", 0, primitiveValue, isolateId); //$NON-NLS-1$ //$NON-NLS-2$
 		else if (primitiveValue == Value.UNDEFINED)
-			return new DValue(VariableType.UNDEFINED, "undefined", "", 0, primitiveValue); //$NON-NLS-1$ //$NON-NLS-2$
+			return new DValue(VariableType.UNDEFINED, "undefined", "", 0, primitiveValue, isolateId); //$NON-NLS-1$ //$NON-NLS-2$
 		else if (primitiveValue instanceof Boolean)
-			return new DValue(VariableType.BOOLEAN, "Boolean", "", 0, primitiveValue); //$NON-NLS-1$ //$NON-NLS-2$
+			return new DValue(VariableType.BOOLEAN, "Boolean", "", 0, primitiveValue, isolateId); //$NON-NLS-1$ //$NON-NLS-2$
 		else if (primitiveValue instanceof Double)
-			return new DValue(VariableType.NUMBER, "Number", "", 0, primitiveValue); //$NON-NLS-1$ //$NON-NLS-2$
+			return new DValue(VariableType.NUMBER, "Number", "", 0, primitiveValue, isolateId); //$NON-NLS-1$ //$NON-NLS-2$
 		else if (primitiveValue instanceof String)
-			return new DValue(VariableType.STRING, "String", "", 0, primitiveValue); //$NON-NLS-1$ //$NON-NLS-2$
+			return new DValue(VariableType.STRING, "String", "", 0, primitiveValue, isolateId); //$NON-NLS-1$ //$NON-NLS-2$
 		assert false;
 		return null;
 	}
@@ -167,6 +185,15 @@ public class DValue implements Value
 		m_members = null;
 		m_inheritedPrivates = null;
 		m_nonProtoId = getId();
+		m_isolateId = Isolate.DEFAULT_ID;
+	}
+	
+	public int getIsolateId() {
+		return m_isolateId;
+	}
+	
+	public void setIsolateId(int isolateid) {
+		m_isolateId = isolateid;
 	}
 
 	/*
@@ -281,9 +308,9 @@ public class DValue implements Value
 	/**
 	 * WARNING: this call will initiate a call to the session to obtain the members
 	 * the first time around.
-	 * @throws NotConnectedException
-	 * @throws NoResponseException
-	 * @throws NotSuspendedException
+	 * @throws flash.tools.debugger.NotConnectedException
+	 * @throws flash.tools.debugger.NoResponseException
+	 * @throws flash.tools.debugger.NotSuspendedException
 	 */
 	private void obtainMembers(Session s) throws NotSuspendedException, NoResponseException, NotConnectedException
 	{
@@ -298,8 +325,8 @@ public class DValue implements Value
 			long id = getId();
 			if (id != Value.UNKNOWN_ID)
 			{
-				if (((PlayerSession)s).getRawValue(id) == this)
-					((PlayerSession)s).obtainMembers(id);
+				if (((PlayerSession)s).getRawValue(id, m_isolateId) == this)
+					((PlayerSession)s).obtainMembers(id, m_isolateId);
 				if (m_members != null)
 				{
 					Iterator<DVariable> iter = m_members.values().iterator();
@@ -483,8 +510,9 @@ public class DValue implements Value
 
 	/**
 	 * Necessary for expression evaluation.
-	 * @see Context#lookup(Object)
+	 * @see flash.tools.debugger.expression.Context#lookup(Object)
 	 */
+	@Override
 	public String toString() { return getValueAsString(); }
 
 	public Variable[] getPrivateInheritedMembers() {

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DVariable.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DVariable.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DVariable.java
index e991e66..2fa59b3 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DVariable.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DVariable.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -44,10 +42,10 @@ public class DVariable implements Variable, Comparable
 	/** Just name, without namespace */
 	private String		m_name;
 
-	/** @see Variable#getNamespace() */
+	/** @see flash.tools.debugger.Variable#getNamespace() */
 	private String		m_namespace = ""; //$NON-NLS-1$
 
-	/** @see VariableAttribute */
+	/** @see flash.tools.debugger.VariableAttribute */
 	private int			m_attribs;
 
 	/**
@@ -71,7 +69,7 @@ public class DVariable implements Variable, Comparable
 
 	/**
 	 * The variable's "level" -- see <code>Variable.getLevel()</code>
-	 * @see Variable#getLevel()
+	 * @see flash.tools.debugger.Variable#getLevel()
 	 */
 	private byte		m_level;
 
@@ -85,6 +83,11 @@ public class DVariable implements Variable, Comparable
 	 * parent's ID, or else my parent's parent's ID if my parent is <code>__proto__</code>.
 	 */
 	long				m_nonProtoParentId;
+	
+	/**
+	 * The worker to which this variable belongs.
+	 */
+	private int m_isolateId;
 
 	/**
 	 * Create a variable and its value.
@@ -95,7 +98,7 @@ public class DVariable implements Variable, Comparable
 	 * @param value
 	 *            the variable's value.
 	 */
-	public DVariable(String name, DValue value)
+	public DVariable(String name, DValue value, int isolateId)
 	{
 		m_rawName = name;
 		m_attribs = value.getAttributes();
@@ -127,6 +130,7 @@ public class DVariable implements Variable, Comparable
 		m_nonProtoParentId = Value.UNKNOWN_ID;
 		m_value = value;
 		value.setSession(m_session);
+		m_isolateId = isolateId;
 	}
 
 	/* getters/setters */
@@ -136,7 +140,11 @@ public class DVariable implements Variable, Comparable
 	public int			getScope()				{ return m_attribs & VariableAttribute.SCOPE_MASK; }
 	public int			getLevel()				{ return m_level; }
 	public String		getDefiningClass()		{ return m_definingClass; }
-
+	
+	public int getIsolateId() {
+		return m_isolateId;
+	}
+	
 	public void makePublic()
 	{
 		int attributes = getAttributes();
@@ -175,7 +183,7 @@ public class DVariable implements Variable, Comparable
 		boolean hasValueChanged = false;
 		if (s instanceof PlayerSession)
 		{
-			Value previousParent = ((PlayerSession)s).getPreviousValue(m_nonProtoParentId);
+			Value previousParent = ((PlayerSession)s).getPreviousValue(m_nonProtoParentId, m_isolateId);
 			if (previousParent != null)
 			{
 				try {
@@ -210,7 +218,7 @@ public class DVariable implements Variable, Comparable
 	 */
 	public FaultEvent setValue(Session s, int type, String value) throws NotSuspendedException, NoResponseException, NotConnectedException
 	{
-		return ((PlayerSession)s).setScalarMember(m_nonProtoParentId, m_rawName, type, value);
+		return ((PlayerSession)s).setScalarMember(m_nonProtoParentId, m_rawName, type, value, m_isolateId);
 	}
 
 	/*
@@ -265,7 +273,7 @@ public class DVariable implements Variable, Comparable
 
 		String n1 = getName();
 		String n2 = v2.getName();
-
+		
 		return String.CASE_INSENSITIVE_ORDER.compare(n1, n2);
 	}
 
@@ -289,7 +297,7 @@ public class DVariable implements Variable, Comparable
 
 			// If this Variable is stale (that is, the program has run since this Variable
 			// was created), then we can't invoke the getter.
-			if (playerSession.getRawValue(m_value.getId()) == m_value)
+			if (playerSession.getRawValue(m_value.getId(), m_isolateId) == m_value)
 			{
 				// temporarily turn on "invoke getters" preference
 				int oldInvokeGetters = playerSession.getPreference(SessionManager.PREF_INVOKE_GETTERS);
@@ -297,7 +305,7 @@ public class DVariable implements Variable, Comparable
 
 				try {
 					// fire the getter using the original object id. make sure we get something reasonable back
-					Value v = playerSession.getValue(m_nonProtoParentId, getRawName());
+					Value v = playerSession.getValue(m_nonProtoParentId, getRawName(), m_isolateId);
 					if (v != null)
 					{
 						m_value = v;
@@ -330,8 +338,9 @@ public class DVariable implements Variable, Comparable
 
 	/**
 	 * Added so that expressions such as <code>a.b.c = e.f</code> work in the command-line interface.
-	 * @see Context#lookup(Object)
+	 * @see flash.tools.debugger.expression.Context#lookup(Object)
 	 */
+	@Override
 	public String toString() { return getValue().getValueAsString(); }
 
 	/**

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/DWatch.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/DWatch.java b/modules/debugger/src/java/flash/tools/debugger/concrete/DWatch.java
index 85679fb..35b2c41 100644
--- a/modules/debugger/src/java/flash/tools/debugger/concrete/DWatch.java
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/DWatch.java
@@ -1,20 +1,18 @@
 /*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- *  Licensed to the Apache Software Foundation (ASF) under one or more
- *  contributor license agreements.  See the NOTICE file distributed with
- *  this work for additional information regarding copyright ownership.
- *  The ASF licenses this file to You under the Apache License, Version 2.0
- *  (the "License"); you may not use this file except in compliance with
- *  the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  */
 
 package flash.tools.debugger.concrete;
@@ -30,17 +28,23 @@ public class DWatch implements Watch
 	String		m_rawMemberName; // corresponds to Variable.getRawName()
 	int			m_kind;
 	int			m_tag;
+	int m_isolateId;
 
-	public DWatch(long id, String name, int kind, int tag)
+	public DWatch(long id, String name, int kind, int tag, int isolateId)
 	{
 		m_parentValueId = id;
 		m_rawMemberName = name;
 		m_kind = kind;
 		m_tag = tag;
+		m_isolateId = isolateId;
 	}
 
     public long			getValueId()	{ return m_parentValueId; }
 	public String		getMemberName()	{ return m_rawMemberName; }
     public int			getKind()		{ return m_kind; }
     public int			getTag()		{ return m_tag; }
+    
+    public int getIsolateId() {
+    	return m_isolateId;
+    }
 }

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/379cb609/modules/debugger/src/java/flash/tools/debugger/concrete/IsolatePlayerSession.java
----------------------------------------------------------------------
diff --git a/modules/debugger/src/java/flash/tools/debugger/concrete/IsolatePlayerSession.java b/modules/debugger/src/java/flash/tools/debugger/concrete/IsolatePlayerSession.java
new file mode 100644
index 0000000..887b9c0
--- /dev/null
+++ b/modules/debugger/src/java/flash/tools/debugger/concrete/IsolatePlayerSession.java
@@ -0,0 +1,221 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package flash.tools.debugger.concrete;
+
+import flash.tools.debugger.Frame;
+import flash.tools.debugger.IsolateController;
+import flash.tools.debugger.IsolateSession;
+import flash.tools.debugger.Location;
+import flash.tools.debugger.NoResponseException;
+import flash.tools.debugger.NotConnectedException;
+import flash.tools.debugger.NotSupportedException;
+import flash.tools.debugger.NotSuspendedException;
+import flash.tools.debugger.PlayerDebugException;
+import flash.tools.debugger.SuspendedException;
+import flash.tools.debugger.SwfInfo;
+import flash.tools.debugger.Value;
+import flash.tools.debugger.Variable;
+import flash.tools.debugger.VersionException;
+import flash.tools.debugger.Watch;
+import flash.tools.debugger.expression.PlayerFaultException;
+
+/**
+ * Concrete implementation of IsolateSession. Re-routes
+ * calls to the *worker() method equivalents.
+ * @author anirudhs
+ *
+ */
+public class IsolatePlayerSession implements IsolateSession {
+
+	private IsolateController fSession;
+	private int fIsolateId;
+	
+	public IsolatePlayerSession(int isolateId, IsolateController mainSession) {
+		fIsolateId = isolateId;
+		fSession = mainSession;
+	}
+	
+	@Override
+	public void resume() throws NotSuspendedException, NotConnectedException,
+			NoResponseException {
+		fSession.resumeWorker(fIsolateId);
+	}
+
+	@Override
+	public void suspend() throws SuspendedException, NotConnectedException,
+			NoResponseException {
+		fSession.suspendWorker(fIsolateId);
+	}
+
+	@Override
+	public boolean isSuspended() throws NotConnectedException {
+		return fSession.isWorkerSuspended(fIsolateId);
+	}
+
+	@Override
+	public int suspendReason() throws NotConnectedException {
+		return fSession.suspendReasonWorker(fIsolateId);
+	}
+
+	@Override
+	public Frame[] getFrames() throws NotConnectedException {
+		return fSession.getFramesWorker(fIsolateId);
+	}
+
+	@Override
+	public void stepInto() throws NotSuspendedException, NoResponseException,
+			NotConnectedException {
+		fSession.stepIntoWorker(fIsolateId);
+	}
+
+	@Override
+	public void stepOut() throws NotSuspendedException, NoResponseException,
+			NotConnectedException {
+		fSession.stepOutWorker(fIsolateId);
+	}
+
+	@Override
+	public void stepOver() throws NotSuspendedException, NoResponseException,
+			NotConnectedException {
+		fSession.stepOverWorker(fIsolateId);
+	}
+
+	@Override
+	public void stepContinue() throws NotSuspendedException,
+			NoResponseException, NotConnectedException {
+		fSession.stepContinueWorker(fIsolateId);
+	}
+
+	@Override
+	public SwfInfo[] getSwfs() throws NoResponseException {
+		return fSession.getSwfsWorker(fIsolateId);
+	}
+
+	@Override
+	public Location setBreakpoint(int fileId, int lineNum)
+			throws NoResponseException, NotConnectedException {
+		return fSession.setBreakpointWorker(fileId, lineNum, fIsolateId);
+	}
+
+	@Override
+	public Watch[] getWatchList() throws NoResponseException,
+			NotConnectedException {
+		return fSession.getWatchListWorker(fIsolateId);
+	}
+
+	@Override
+	public Variable[] getVariableList() throws NotSuspendedException,
+			NoResponseException, NotConnectedException, VersionException {
+		return fSession.getVariableListWorker(fIsolateId);
+	}
+
+	@Override
+	public Value getValue(long valueId) throws NotSuspendedException,
+			NoResponseException, NotConnectedException {
+		return fSession.getValueWorker(valueId, fIsolateId);
+	}
+
+	@Override
+	public Value getGlobal(String name) throws NotSuspendedException,
+			NoResponseException, NotConnectedException {
+		return fSession.getGlobalWorker(name, fIsolateId);
+	}
+
+	@Override
+	public boolean evalIs(Value value, Value type) throws PlayerDebugException,
+			PlayerFaultException {
+		return fSession.evalIsWorker(value, type, fIsolateId);
+	}
+
+	@Override
+	public boolean evalIs(Value value, String type)
+			throws PlayerDebugException, PlayerFaultException {
+		return fSession.evalIsWorker(value, type, fIsolateId);
+	}
+
+	@Override
+	public boolean evalInstanceof(Value value, Value type)
+			throws PlayerDebugException, PlayerFaultException {
+		return fSession.evalInstanceofWorker(value, type, fIsolateId);
+	}
+
+	@Override
+	public boolean evalInstanceof(Value value, String type)
+			throws PlayerDebugException, PlayerFaultException {
+		return fSession.evalInstanceofWorker(value, type, fIsolateId);
+	}
+
+	@Override
+	public boolean evalIn(Value property, Value object)
+			throws PlayerDebugException, PlayerFaultException {
+		return fSession.evalInWorker(property, object, fIsolateId);
+	}
+
+	@Override
+	public Value evalAs(Value value, Value type) throws PlayerDebugException,
+			PlayerFaultException {
+		return fSession.evalAsWorker(value, type, fIsolateId);
+	}
+
+	@Override
+	public Value callFunction(Value thisObject, String functionName,
+			Value[] args) throws PlayerDebugException {
+		return fSession.callFunctionWorker(thisObject, functionName, args, fIsolateId);
+	}
+
+	@Override
+	public Value callConstructor(String classname, Value[] args)
+			throws PlayerDebugException {
+		return fSession.callConstructorWorker(classname, args, fIsolateId);
+	}
+	
+	@Override
+	public boolean setExceptionBreakpoint(String exceptionClass) throws NoResponseException, NotConnectedException {
+		return fSession.setExceptionBreakpointWorker(exceptionClass, fIsolateId);
+	}
+
+	@Override
+	public boolean clearExceptionBreakpoint(String exceptionClass) throws NoResponseException, NotConnectedException {
+		return fSession.clearExceptionBreakpointWorker(exceptionClass, fIsolateId);
+	}
+
+	@Override
+	public void breakOnCaughtExceptions(boolean b) throws NotSupportedException, NoResponseException {
+		fSession.breakOnCaughtExceptions(b, fIsolateId);
+	}
+
+	@Override
+	public boolean supportsWatchpoints() {
+		return fSession.supportsWatchpoints(fIsolateId);
+	}
+
+	@Override
+	public boolean playerCanBreakOnAllExceptions() {
+		return fSession.playerCanBreakOnAllExceptions(fIsolateId);
+	}
+
+	@Override
+	public boolean supportsWideLineNumbers() {
+		return fSession.supportsWideLineNumbers(fIsolateId);
+	}
+
+	@Override
+	public boolean playerCanCallFunctions() {
+		return fSession.playerCanCallFunctions(fIsolateId);
+	}
+
+}


Mime
View raw message