1 ;;; Copyright (C) 2012 Rocky Bernstein <rocky@gnu.org>
2 ;; `pdb' Main interface to pdb via Emacs
3 (require 'load-relative)
4 (require-relative-list '("../../common/helper"
5 "../../common/track") "dbgr-")
6 (require-relative-list '("core" "track-mode") "dbgr-pdb-")
8 ;; This is needed, or at least the docstring part of it is needed to
9 ;; get the customization menu to work in Emacs 23.
11 "The Python pdb debugger"
17 ;; -------------------------------------------------------------------
18 ;; User definable variables
21 (defcustom pdb-command-name
23 "File name for executing the stock Python debugger and command options.
24 This should be an executable on your path, or an absolute file name."
28 (declare-function pdb-track-mode (bool))
30 ;; -------------------------------------------------------------------
35 (defun dbgr-pdb (&optional opt-command-line no-reset)
36 "Invoke the pdb Python debugger and start the Emacs user interface.
38 String COMMAND-LINE specifies how to run pdb.
40 Normally command buffers are reused when the same debugger is
41 reinvoked inside a command buffer with a similar command. If we
42 discover that the buffer has prior command-buffer information and
43 NO-RESET is nil, then that information which may point into other
44 buffers and source buffers which may contain marks and fringe or
45 marginal icons is reset."
50 (cmd-str (or opt-command-line (pdb-query-cmdline
52 (cmd-args (split-string-and-unquote cmd-str))
53 (parsed-args (pdb-parse-cmd-args cmd-args))
54 (script-args (cdr cmd-args))
55 (script-name (car script-args))
57 (dbgr-run-process "pdb" script-name cmd-args
58 'pdb-track-mode no-reset)
63 (defalias 'pdb 'dbgr-pdb)