~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/breakin.py

  • Committer: Martin Pool
  • Date: 2007-04-17 04:39:12 UTC
  • mto: This revision was merged to the branch mainline in revision 2450.
  • Revision ID: mbp@sourcefrog.net-20070417043912-2mwgd3htam3a5uq2
C-\ drops bzr into the debugger

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright (C) 2006 Canonical Ltd
 
2
 
 
3
import pdb
 
4
import signal
 
5
import sys
 
6
 
 
7
def _debug(signal_number, interrupted_frame):
 
8
    sys.stderr.write("** SIGQUIT received, entering debugger\n"
 
9
            "** Type 'c' to continue or 'q' to stop the process\n")
 
10
    pdb.set_trace()
 
11
 
 
12
def hook_sigquit():
 
13
    # when sigquit (C-\) is received go into pdb
 
14
    # XXX: is this meaningful on Windows?
 
15
    signal.signal(signal.SIGQUIT, _debug)
 
16
 
 
17