src/eric7/DebugClients/Python/DebugClientBase.py

branch
eric7
changeset 9396
06699e5600a3
parent 9383
1d9a71952123
child 9397
a415cb83dafb
diff -r 74b24086c146 -r 06699e5600a3 src/eric7/DebugClients/Python/DebugClientBase.py
--- a/src/eric7/DebugClients/Python/DebugClientBase.py	Sat Oct 08 19:15:59 2022 +0200
+++ b/src/eric7/DebugClients/Python/DebugClientBase.py	Mon Oct 10 09:25:29 2022 +0200
@@ -1410,7 +1410,7 @@
         Private method to return the variables of a frame to the debug server.
 
         @param var list encoded name of the requested variable
-        @type list of str
+        @type list of str and int
         @param frmnr distance of frame reported on. 0 is the current frame
         @type int
         @param scope 1 to report global variables, 0 for local variables
@@ -1448,7 +1448,7 @@
             idx, varDict = next(varGen)
             if idx != -2:  # more elements available
                 var.insert(0, idx)
-                varlist = self.__formatVariablesList(varDict, scope, filterList)
+                varlist = self.__formatVariablesList(varDict, scope, filterList, var)
         elif scope != -1:
             variable = varDict
             # Lookup the wanted attribute
@@ -1473,7 +1473,9 @@
 
                     idx, varDict = next(varGen)
                     if idx != -2:  # more elements available
-                        varlist = self.__formatVariablesList(varDict, scope, filterList)
+                        varlist = self.__formatVariablesList(
+                            varDict, scope, filterList, var
+                        )
 
             var.insert(0, idx)
 
@@ -1486,7 +1488,7 @@
             },
         )
 
-    def __formatVariablesList(self, variables, scope, filterList=None):
+    def __formatVariablesList(self, variables, scope, filterList=None, var=None):
         """
         Private method to produce a formated variables list.
 
@@ -1505,8 +1507,10 @@
         @type int
         @param filterList list of variable types to be filtered.
             Variables are only added to the list, if their type is not
-            contained in the filter list.
-        @type list of str
+            contained in the filter list. (defaults to None)
+        @type list of str (optional)
+        @param var list encoded name of the requested variable (defaults to None)
+        @type list of str and int (optional)
         @return A tuple consisting of a list of formatted variables. Each
             variable entry is a tuple of three elements, the variable name,
             its type and value.
@@ -1519,6 +1523,9 @@
             self.globalsFilterObjects if scope else self.localsFilterObjects
         )
 
+        if var:
+            var = ".".join(str(v) for v in var)
+
         for variabel in variables:
             valtype = None
             rvalue = None
@@ -1530,9 +1537,10 @@
                 key, valtype, rvalue = variabel
 
             # filter based on the filter pattern
+            keyPath = "{0}.{1}".format(var, key) if var else key
             if patternFilterObjects and (
-                (not showFlag and patternFilterObjects.match(str(key)))
-                or (showFlag and not patternFilterObjects.match(str(key)))
+                (not showFlag and patternFilterObjects.match(str(keyPath)))
+                or (showFlag and not patternFilterObjects.match(str(keyPath)))
             ):
                 continue
 

eric ide

mercurial