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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Fri, 21 May 2021 18:04:01 +0200
branch
eric7
changeset 8363
e0890180e16a
parent 8361
025f3037dcef
child 8364
2d72d4d11771

Debugger: changed code to not switch to the Debug Viewer when not debugging.
(grafted from b43cf23955aa98f0bb3da66ef0cab785af7924de)

eric7/DebugClients/Python/DebugClientBase.py file | annotate | diff | comparison | revisions
eric7/Debugger/DebugServer.py file | annotate | diff | comparison | revisions
eric7/Debugger/DebugUI.py file | annotate | diff | comparison | revisions
--- a/eric7/DebugClients/Python/DebugClientBase.py	Sun May 23 11:55:39 2021 +0200
+++ b/eric7/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/eric7/Debugger/DebugServer.py	Sun May 23 11:55:39 2021 +0200
+++ b/eric7/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/eric7/Debugger/DebugUI.py	Sun May 23 11:55:39 2021 +0200
+++ b/eric7/Debugger/DebugUI.py	Fri May 21 18:04:01 2021 +0200
@@ -1373,8 +1373,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):
         """
@@ -1396,8 +1397,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
@@ -1405,19 +1406,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