Add a --pdb-postmortem argument.

This commit is contained in:
Florian Bruhin 2015-03-29 19:45:00 +02:00
parent 34a0976a6f
commit 8af2e712ae
3 changed files with 11 additions and 1 deletions

View File

@ -80,6 +80,9 @@ It was inspired by other browsers/addons like dwb and Vimperator/Pentadactyl.
*--no-crash-dialog*::
Don't show a crash dialog.
*--pdb-postmortem*::
Drop into pdb on exceptions.
*--qt-name* 'NAME'::
Set the window name.

View File

@ -24,6 +24,7 @@ import sys
import subprocess
import configparser
import signal
import pdb
import bdb
import base64
import functools
@ -596,7 +597,11 @@ class Application(QApplication):
is_ignored_exception = (exctype is bdb.BdbQuit or
not issubclass(exctype, Exception))
if is_ignored_exception or self._args.no_crash_dialog:
if self._args.pdb_postmortem:
pdb.post_mortem(tb)
if (is_ignored_exception or self._args.no_crash_dialog or
self._args.pdb_postmortem):
# pdb exit, KeyboardInterrupt, ...
status = 0 if is_ignored_exception else 2
try:

View File

@ -84,6 +84,8 @@ def get_argparser():
action='store_true')
debug.add_argument('--no-crash-dialog', action='store_true', help="Don't "
"show a crash dialog.")
debug.add_argument('--pdb-postmortem', action='store_true',
help="Drop into pdb on exceptions.")
# For the Qt args, we use store_const with const=True rather than
# store_true because we want the default to be None, to make
# utils.qt:get_args easier.