576 execfile(sys.argv[0], self.debugMod.__dict__) |
576 execfile(sys.argv[0], self.debugMod.__dict__) |
577 except SystemExit as exc: |
577 except SystemExit as exc: |
578 res = exc.code |
578 res = exc.code |
579 atexit._run_exitfuncs() |
579 atexit._run_exitfuncs() |
580 self.writestream.flush() |
580 self.writestream.flush() |
581 self.progTerminated(res) |
581 self.progTerminated(res, exit=True) |
582 return |
582 return |
583 |
583 |
584 if cmd == DebugProtocol.RequestCoverage: |
584 if cmd == DebugProtocol.RequestCoverage: |
585 from coverage import coverage |
585 from coverage import coverage |
586 sys.argv = [] |
586 sys.argv = [] |
654 except SystemExit as exc: |
654 except SystemExit as exc: |
655 res = exc.code |
655 res = exc.code |
656 atexit._run_exitfuncs() |
656 atexit._run_exitfuncs() |
657 self.prof.save() |
657 self.prof.save() |
658 self.writestream.flush() |
658 self.writestream.flush() |
659 self.progTerminated(res) |
659 self.progTerminated(res, exit=True) |
660 return |
660 return |
661 |
661 |
662 if cmd == DebugProtocol.RequestShutdown: |
662 if cmd == DebugProtocol.RequestShutdown: |
663 self.sessionClose() |
663 self.sessionClose() |
664 return |
664 return |
1241 |
1241 |
1242 @return flag indicating a running debug session (boolean) |
1242 @return flag indicating a running debug session (boolean) |
1243 """ |
1243 """ |
1244 return self.running |
1244 return self.running |
1245 |
1245 |
1246 def progTerminated(self, status): |
1246 def progTerminated(self, status, exit=False): |
1247 """ |
1247 """ |
1248 Public method to tell the debugger that the program has terminated. |
1248 Public method to tell the debugger that the program has terminated. |
1249 |
1249 |
1250 @param status the return status |
1250 @param status return status |
|
1251 @param exit flag indicating to perform a sys.exit() |
|
1252 @type bool |
1251 """ |
1253 """ |
1252 if status is None: |
1254 if status is None: |
1253 status = 0 |
1255 status = 0 |
1254 else: |
1256 else: |
1255 try: |
1257 try: |