773 if cmd == DebugProtocol.RequestEval: |
773 if cmd == DebugProtocol.RequestEval: |
774 try: |
774 try: |
775 value = eval( |
775 value = eval( |
776 arg, |
776 arg, |
777 self.currentThread.getCurrentFrame().f_globals, |
777 self.currentThread.getCurrentFrame().f_globals, |
778 self.currentThread.getFrameLocals(0)) |
778 self.currentThread.getFrameLocals(self.framenr)) |
|
779 self.currentThread.storeFrameLocals(self.framenr) |
779 except Exception: |
780 except Exception: |
780 # Report the exception and the traceback |
781 # Report the exception and the traceback |
781 try: |
782 try: |
782 type, value, tb = sys.exc_info() |
783 type, value, tb = sys.exc_info() |
783 sys.last_type = type |
784 sys.last_type = type |
804 |
805 |
805 return |
806 return |
806 |
807 |
807 if cmd == DebugProtocol.RequestExec: |
808 if cmd == DebugProtocol.RequestExec: |
808 _globals = self.currentThread.getCurrentFrame().f_globals |
809 _globals = self.currentThread.getCurrentFrame().f_globals |
809 _locals = self.currentThread.getFrameLocals(0) |
810 _locals = self.currentThread.getFrameLocals(self.framenr) |
810 try: |
811 try: |
811 code = compile(arg + '\n', '<stdin>', 'single') |
812 code = compile(arg + '\n', '<stdin>', 'single') |
812 exec(code, _globals, _locals) |
813 exec(code, _globals, _locals) |
|
814 self.currentThread.storeFrameLocals(self.framenr) |
813 except Exception: |
815 except Exception: |
814 # Report the exception and the traceback |
816 # Report the exception and the traceback |
815 try: |
817 try: |
816 type, value, tb = sys.exc_info() |
818 type, value, tb = sys.exc_info() |
817 sys.last_type = type |
819 sys.last_type = type |
994 _locals["sys"].stdout = self.writestream |
996 _locals["sys"].stdout = self.writestream |
995 exec(code, _globals, _locals) |
997 exec(code, _globals, _locals) |
996 _locals["sys"].stdout = __stdout |
998 _locals["sys"].stdout = __stdout |
997 else: |
999 else: |
998 exec(code, _globals, _locals) |
1000 exec(code, _globals, _locals) |
|
1001 |
|
1002 self.currentThread.storeFrameLocals(self.framenr) |
999 except SystemExit as exc: |
1003 except SystemExit as exc: |
1000 self.progTerminated(exc.code) |
1004 self.progTerminated(exc.code) |
1001 except Exception: |
1005 except Exception: |
1002 # Report the exception and the traceback |
1006 # Report the exception and the traceback |
1003 try: |
1007 try: |