forked from qt-creator/qt-creator
Debugger: Stop cleanly after post mortem debugging
..instead of trying to start over. Starting over may work but may also end up in strange issues which must get handled on the user site otherwise. Especially relevant for pyside projects that are using QApplication and similar where the old application instance has to be destroyed before another one can be created. Change-Id: I6af132da8499ef4ed983491cdc423fa73ea9ba32 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -770,14 +770,20 @@ class QtcInternalDumper:
|
||||
# In most cases SystemExit does not warrant a post-mortem session.
|
||||
print('The program exited via sys.exit(). Exit status:')
|
||||
print(sys.exc_info()[1])
|
||||
t = sys.exc_info()[2]
|
||||
self.interaction(None, t)
|
||||
|
||||
print('Post-mortem debugging is finished - ending debug session.')
|
||||
sys.exit(0)
|
||||
|
||||
except:
|
||||
traceback.print_exc()
|
||||
print('Uncaught exception. Entering post mortem debugging')
|
||||
print('Running "cont" or "step" will restart the program')
|
||||
t = sys.exc_info()[2]
|
||||
self.curframe_locals['__execption__'] = sys.exc_info()[0:2]
|
||||
self.interaction(None, t)
|
||||
print('Post mortem debugger finished. The ' + mainpyfile +
|
||||
' will be restarted')
|
||||
print('Post mortem debugger finished - ending debug session.')
|
||||
sys.exit(0)
|
||||
|
||||
def sigint_handler(self, signum, frame):
|
||||
if self.allow_kbdint:
|
||||
|
||||
Reference in New Issue
Block a user