Debugger: changed code to not switch to the Debug Viewer when not debugging.

Fri, 21 May 2021 18:04:01 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 21 May 2021 18:04:01 +0200
changeset 8349
b43cf23955aa
parent 8329
c823968b9602
child 8362
2b9eaba83d99

Debugger: changed code to not switch to the Debug Viewer when not debugging.

eric6/DebugClients/Python/DebugClientBase.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugServer.py file | annotate | diff | comparison | revisions
eric6/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
--- a/eric6/DebugClients/Python/DebugClientBase.py	Thu May 20 18:17:29 2021 +0200
+++ b/eric6/DebugClients/Python/DebugClientBase.py	Fri May 21 18:04:01 2021 +0200
@@ -1511,7 +1511,7 @@
             if scope:
                 varDict = self.debugMod.__dict__
             else:
-                scope = -1
+                scope = -2
         elif scope:
             varDict = f.f_globals
         elif f.f_globals is f.f_locals:
@@ -1519,7 +1519,7 @@
         else:
             varDict = f.f_locals
         
-        varlist = [] if scope == -1 else self.__formatVariablesList(
+        varlist = [] if scope < 0 else self.__formatVariablesList(
             varDict, scope, filterList)
         
         self.sendJsonCommand("ResponseVariables", {
--- a/eric6/Debugger/DebugServer.py	Thu May 20 18:17:29 2021 +0200
+++ b/eric6/Debugger/DebugServer.py	Fri May 21 18:04:01 2021 +0200
@@ -1743,8 +1743,8 @@
         """
         Public method to process the client variables info.
         
-        @param scope scope of the variables (-1 = empty global, 1 = global,
-            0 = local)
+        @param scope scope of the variables
+            (-2 = no frame found, -1 = empty locals, 1 = global, 0 = local)
         @type int
         @param variables the list of variables from the client
         @type list
--- a/eric6/Debugger/DebugUI.py	Thu May 20 18:17:29 2021 +0200
+++ b/eric6/Debugger/DebugUI.py	Fri May 21 18:04:01 2021 +0200
@@ -1372,8 +1372,9 @@
         @param debuggerId ID of the debugger backend
         @type str
         """
-        self.debugServer.remoteClientVariables(
-            debuggerId, 0, self.__localsVarFilterList)
+        if self.debugServer.isDebugging():
+            self.debugServer.remoteClientVariables(
+                debuggerId, 0, self.__localsVarFilterList)
     
     def __getClientVariables(self, debuggerId):
         """
@@ -1395,8 +1396,8 @@
         """
         Private method to write the clients variables to the user interface.
         
-        @param scope scope of the variables (-1 = empty locals, 1 = global,
-            0 = local)
+        @param scope scope of the variables
+            (-2 = no frame found, -1 = empty locals, 1 = global, 0 = local)
         @type int
         @param variables the list of variables from the client
         @type list
@@ -1404,19 +1405,20 @@
         @type str
         """
         if debuggerId == self.getSelectedDebuggerId():
-            self.ui.activateDebugViewer()
-            if scope > 0:
-                self.debugViewer.showVariables(variables, True)
-                if scope == 1:
-                    # now get the local variables
-                    self.debugServer.remoteClientVariables(
-                        self.getSelectedDebuggerId(),
-                        0, self.__localsVarFilterList)
-            elif scope == 0:
-                self.debugViewer.showVariables(variables, False)
-            elif scope == -1:
-                vlist = [(self.tr('No locals available.'), '', '')]
-                self.debugViewer.showVariables(vlist, False)
+            if scope > -2:
+                self.ui.activateDebugViewer()
+                if scope > 0:
+                    self.debugViewer.showVariables(variables, True)
+                    if scope == 1:
+                        # now get the local variables
+                        self.debugServer.remoteClientVariables(
+                            self.getSelectedDebuggerId(),
+                            0, self.__localsVarFilterList)
+                elif scope == 0:
+                    self.debugViewer.showVariables(variables, False)
+                elif scope == -1:
+                    vlist = [(self.tr('No locals available.'), '', '')]
+                    self.debugViewer.showVariables(vlist, False)
         
     def __clientVariable(self, scope, variables, debuggerId):
         """

eric ide

mercurial