1520 elif f.f_globals is f.f_locals: |
1520 elif f.f_globals is f.f_locals: |
1521 scope = -1 |
1521 scope = -1 |
1522 else: |
1522 else: |
1523 varDict = f.f_locals |
1523 varDict = f.f_locals |
1524 |
1524 |
1525 if scope == -1: |
1525 varlist = [] if scope == -1 else self.__formatVariablesList( |
1526 varlist = [] |
1526 varDict, scope, filterList) |
1527 else: |
|
1528 varlist = self.__formatVariablesList(varDict, scope, filterList) |
|
1529 |
1527 |
1530 self.sendJsonCommand("ResponseVariables", { |
1528 self.sendJsonCommand("ResponseVariables", { |
1531 "scope": scope, |
1529 "scope": scope, |
1532 "variables": varlist, |
1530 "variables": varlist, |
1533 }) |
1531 }) |
1804 @rtype list of tuple of (str, str, str) |
1802 @rtype list of tuple of (str, str, str) |
1805 """ |
1803 """ |
1806 filterList = [] if filterList is None else filterList[:] |
1804 filterList = [] if filterList is None else filterList[:] |
1807 |
1805 |
1808 varlist = [] |
1806 varlist = [] |
1809 if scope: |
1807 patternFilterObjects = ( |
1810 patternFilterObjects = self.globalsFilterObjects |
1808 self.globalsFilterObjects |
1811 else: |
1809 if scope else |
1812 patternFilterObjects = self.localsFilterObjects |
1810 self.localsFilterObjects |
|
1811 ) |
1813 if type(dict_) == dict: |
1812 if type(dict_) == dict: |
1814 dict_ = dict_.items() |
1813 dict_ = dict_.items() |
1815 |
1814 |
1816 for key, value in dict_: |
1815 for key, value in dict_: |
1817 # no more elements available |
1816 # no more elements available |
2142 "__spec__": modSpec, |
2141 "__spec__": modSpec, |
2143 "__builtins__": __builtins__, |
2142 "__builtins__": __builtins__, |
2144 }) |
2143 }) |
2145 else: |
2144 else: |
2146 code = self.__compileFileSource(self.running) |
2145 code = self.__compileFileSource(self.running) |
2147 if code: |
2146 res = ( |
2148 res = self.mainThread.run(code, self.debugMod.__dict__, debug=True) |
2147 self.mainThread.run(code, self.debugMod.__dict__, debug=True) |
2149 else: |
2148 if code else |
2150 res = 42 # should not happen |
2149 42 # should not happen |
|
2150 ) |
2151 return res |
2151 return res |
2152 |
2152 |
2153 def run_call(self, scriptname, func, *args): |
2153 def run_call(self, scriptname, func, *args): |
2154 """ |
2154 """ |
2155 Public method used to start the remote debugger and call a function. |
2155 Public method used to start the remote debugger and call a function. |