DebugClients/Python/DebugClientBase.py

changeset 4642
f18d5fb9a53b
parent 4631
5c1a96925da4
child 4830
f609a22f43bd
child 4833
803bf753032a
--- a/DebugClients/Python/DebugClientBase.py	Mon Jan 04 17:49:31 2016 +0100
+++ b/DebugClients/Python/DebugClientBase.py	Fri Jan 08 22:14:39 2016 +0100
@@ -771,7 +771,8 @@
                 try:
                     value = eval(
                         arg, self.currentThread.getCurrentFrame().f_globals,
-                        self.currentThread.getFrameLocals(0))
+                        self.currentThread.getFrameLocals(self.framenr))
+                    self.currentThread.storeFrameLocals(self.framenr)
                 except Exception:
                     # Report the exception and the traceback
                     try:
@@ -801,10 +802,11 @@
             
             if cmd == DebugProtocol.RequestExec:
                 _globals = self.currentThread.getCurrentFrame().f_globals
-                _locals = self.currentThread.getFrameLocals(0)
+                _locals = self.currentThread.getFrameLocals(self.framenr)
                 try:
                     code = compile(arg + '\n', '<stdin>', 'single')
                     exec code in _globals, _locals
+                    self.currentThread.storeFrameLocals(self.framenr)
                 except Exception:
                     # Report the exception and the traceback
                     try:
@@ -994,6 +996,8 @@
                             _locals["sys"].stdout = __stdout
                         else:
                             exec code in _globals, _locals
+                        
+                        self.currentThread.storeFrameLocals(self.framenr)
                 except SystemExit, exc:
                     self.progTerminated(exc.code)
                 except Exception:
@@ -1356,12 +1360,11 @@
                 scope = -1
         elif scope:
             dict = f.f_globals
+        elif f.f_globals is f.f_locals:
+                scope = -1
         else:
             dict = f.f_locals
             
-            if f.f_globals is f.f_locals:
-                scope = -1
-                
         varlist = [scope]
         
         if scope != -1:
@@ -1401,12 +1404,11 @@
                 scope = -1
         elif scope:
             dict = f.f_globals
+        elif f.f_globals is f.f_locals:
+                scope = -1
         else:
             dict = f.f_locals
-            
-            if f.f_globals is f.f_locals:
-                scope = -1
-                
+        
         varlist = [scope, var]
         
         if scope != -1:

eric ide

mercurial