eric6/DebugClients/Python/DebugClientBase.py

branch
multi_processing
changeset 7374
5401ae8ddaa1
parent 7373
d036d72f457c
child 7376
21df384d6150
diff -r d036d72f457c -r 5401ae8ddaa1 eric6/DebugClients/Python/DebugClientBase.py
--- a/eric6/DebugClients/Python/DebugClientBase.py	Mon Jan 27 19:50:40 2020 +0100
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Tue Jan 28 19:41:51 2020 +0100
@@ -392,12 +392,24 @@
                 params["variable"], params["frameNumber"],
                 params["scope"], params["filters"])
         
+        elif method == "RequestStack":
+            stack = self.mainThread.getStack()
+            self.sendResponseLine(stack)
+        
         elif method == "RequestThreadList":
             self.dumpThreadList()
         
         elif method == "RequestThreadSet":
-            if params["threadID"] in self.threads:
-                self.setCurrentThread(params["threadID"])
+            if params["threadID"] == -1:
+                # -1 is indication for the main thread
+                threadId = -1
+                for thread in self.threads.values():
+                    if thread.name == "MainThread":
+                        threadId = thread.id
+            else:
+                threadId = params["threadID"]
+            if threadId in self.threads:
+                self.setCurrentThread(threadId)
                 self.sendJsonCommand("ResponseThreadSet", {})
                 stack = self.currentThread.getStack()
                 self.sendJsonCommand("ResponseStack", {

eric ide

mercurial