1) Although dbg will be dropped from being supported or bundled with PHPeclipse,...
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.core / src / net / sourceforge / phpdt / internal / debug / core / model / PHPDebugTarget.java
index 6ac564e..3f64b31 100644 (file)
@@ -40,18 +40,14 @@ import org.eclipse.ui.model.IWorkbenchAdapter;
 public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget, ILaunchListener,
                IDebugEventSetListener {
 
-       private IProcess process;
-
-       private ILaunch launch;
-
-       private PHPThread[] threads = new PHPThread[0];
-
-       private PHPDBGProxy phpDBGProxy;
+       private IProcess      process;
+       private ILaunch       launch;
+       private PHPThread[]   threads = new PHPThread[0];
+       private PHPDBGProxy   phpDBGProxy;
 
        private class State {
                private boolean isTerminated = false;
-
-               private boolean isSuspended = false;
+               private boolean isSuspended  = false;
 
                boolean isTerminated() {
                        return isTerminated;
@@ -107,6 +103,11 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
                fireThreadCreateEvent(phpThread);
        }
 
+       public void updateThreads (PHPThread phpThread) {
+               fireChangeEvent ();
+               fireThreadCreateEvent (phpThread);
+       }
+
        private void fireChangeEvent() {
                DebugEvent ev = new DebugEvent(this, DebugEvent.CHANGE);
                DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });
@@ -117,14 +118,14 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
                DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] { ev });
        }
 
-       protected PHPThread getThreadById(int id) {
-               for (int i = 0; i < threads.length; i++) {
-                       if (threads[i].getId() == id) {
-                               return threads[i];
-                       }
-               }
-               return null;
-       }
+//     protected PHPThread getThreadById(int id) {
+//             for (int i = 0; i < threads.length; i++) {
+//                     if (threads[i].getId() == id) {
+//                             return threads[i];
+//                     }
+//             }
+//             return null;
+//     }
 
        public IThread[] getThreads() {
                return threads;
@@ -168,10 +169,10 @@ public class PHPDebugTarget extends PHPDebugElement implements IPHPDebugTarget,
        public synchronized boolean isTerminated() {
                return state.isTerminated();
        }
-       
+
        private synchronized void terminateThreads () {
                int i;
-               
+
                try {
                        for (i = 0; i < threads.length; i++) {
                                threads[i].terminate ();