569 exec(code, self.debugMod.__dict__) |
569 exec(code, self.debugMod.__dict__) |
570 except SystemExit as exc: |
570 except SystemExit as exc: |
571 res = exc.code |
571 res = exc.code |
572 atexit._run_exitfuncs() |
572 atexit._run_exitfuncs() |
573 self.writestream.flush() |
573 self.writestream.flush() |
574 self.progTerminated(res) |
574 self.progTerminated(res, exit=True) |
575 return |
575 return |
576 |
576 |
577 if cmd == DebugProtocol.RequestProfile: |
577 if cmd == DebugProtocol.RequestProfile: |
578 sys.setprofile(None) |
578 sys.setprofile(None) |
579 import PyProfile |
579 import PyProfile |
614 except SystemExit as exc: |
614 except SystemExit as exc: |
615 res = exc.code |
615 res = exc.code |
616 atexit._run_exitfuncs() |
616 atexit._run_exitfuncs() |
617 self.prof.save() |
617 self.prof.save() |
618 self.writestream.flush() |
618 self.writestream.flush() |
619 self.progTerminated(res) |
619 self.progTerminated(res, exit=True) |
620 return |
620 return |
621 |
621 |
622 if cmd == DebugProtocol.RequestCoverage: |
622 if cmd == DebugProtocol.RequestCoverage: |
623 from coverage import coverage |
623 from coverage import coverage |
624 sys.argv = [] |
624 sys.argv = [] |
1252 |
1252 |
1253 @return flag indicating a running debug session (boolean) |
1253 @return flag indicating a running debug session (boolean) |
1254 """ |
1254 """ |
1255 return self.running |
1255 return self.running |
1256 |
1256 |
1257 def progTerminated(self, status): |
1257 def progTerminated(self, status, exit=False): |
1258 """ |
1258 """ |
1259 Public method to tell the debugger that the program has terminated. |
1259 Public method to tell the debugger that the program has terminated. |
1260 |
1260 |
1261 @param status the return status |
1261 @param status return status |
|
1262 @param exit flag indicating to perform a sys.exit() |
|
1263 @type bool |
1262 """ |
1264 """ |
1263 if status is None: |
1265 if status is None: |
1264 status = 0 |
1266 status = 0 |
1265 else: |
1267 else: |
1266 try: |
1268 try: |