DebugClients/Python/DebugClientBase.py

branch
6_1_x
changeset 4643
705ee8ad484f
parent 4632
ca310db386ed
child 4644
99699903c454
--- a/DebugClients/Python/DebugClientBase.py	Fri Jan 08 15:35:11 2016 +0100
+++ b/DebugClients/Python/DebugClientBase.py	Fri Jan 08 22:14:39 2016 +0100
@@ -771,8 +771,8 @@
                 try:
                     value = eval(
                         arg, self.currentThread.getCurrentFrame().f_globals,
-                        self.currentThread.getFrameLocals(0))
-                except:
+                        self.currentThread.getFrameLocals(self.framenr))
+                    self.currentThread.storeFrameLocals(self.framenr)
                     # Report the exception and the traceback
                     try:
                         type, value, tb = sys.exc_info()
@@ -801,11 +801,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
-                except:
+                    self.currentThread.storeFrameLocals(self.framenr)
                     # Report the exception and the traceback
                     try:
                         type, value, tb = sys.exc_info()
@@ -994,6 +994,8 @@
                             _locals["sys"].stdout = __stdout
                         else:
                             exec code in _globals, _locals
+                        
+                        self.currentThread.storeFrameLocals(self.framenr)
                 except SystemExit, exc:
                     self.progTerminated(exc.code)
                 except:
@@ -1356,12 +1358,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 +1402,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