769 |
769 |
770 if cmd == DebugProtocol.RequestEval: |
770 if cmd == DebugProtocol.RequestEval: |
771 try: |
771 try: |
772 value = eval( |
772 value = eval( |
773 arg, self.currentThread.getCurrentFrame().f_globals, |
773 arg, self.currentThread.getCurrentFrame().f_globals, |
774 self.currentThread.getFrameLocals(0)) |
774 self.currentThread.getFrameLocals(self.framenr)) |
|
775 self.currentThread.storeFrameLocals(self.framenr) |
775 except Exception: |
776 except Exception: |
776 # Report the exception and the traceback |
777 # Report the exception and the traceback |
777 try: |
778 try: |
778 type, value, tb = sys.exc_info() |
779 type, value, tb = sys.exc_info() |
779 sys.last_type = type |
780 sys.last_type = type |
799 |
800 |
800 return |
801 return |
801 |
802 |
802 if cmd == DebugProtocol.RequestExec: |
803 if cmd == DebugProtocol.RequestExec: |
803 _globals = self.currentThread.getCurrentFrame().f_globals |
804 _globals = self.currentThread.getCurrentFrame().f_globals |
804 _locals = self.currentThread.getFrameLocals(0) |
805 _locals = self.currentThread.getFrameLocals(self.framenr) |
805 try: |
806 try: |
806 code = compile(arg + '\n', '<stdin>', 'single') |
807 code = compile(arg + '\n', '<stdin>', 'single') |
807 exec code in _globals, _locals |
808 exec code in _globals, _locals |
|
809 self.currentThread.storeFrameLocals(self.framenr) |
808 except Exception: |
810 except Exception: |
809 # Report the exception and the traceback |
811 # Report the exception and the traceback |
810 try: |
812 try: |
811 type, value, tb = sys.exc_info() |
813 type, value, tb = sys.exc_info() |
812 sys.last_type = type |
814 sys.last_type = type |
992 _locals["sys"].stdout = self.writestream |
994 _locals["sys"].stdout = self.writestream |
993 exec code in _globals, _locals |
995 exec code in _globals, _locals |
994 _locals["sys"].stdout = __stdout |
996 _locals["sys"].stdout = __stdout |
995 else: |
997 else: |
996 exec code in _globals, _locals |
998 exec code in _globals, _locals |
|
999 |
|
1000 self.currentThread.storeFrameLocals(self.framenr) |
997 except SystemExit, exc: |
1001 except SystemExit, exc: |
998 self.progTerminated(exc.code) |
1002 self.progTerminated(exc.code) |
999 except Exception: |
1003 except Exception: |
1000 # Report the exception and the traceback |
1004 # Report the exception and the traceback |
1001 try: |
1005 try: |