;;; Copyright (C) 2012 Rocky Bernstein ;; `pdb' Main interface to pdb via Emacs (require 'load-relative) (require-relative-list '("../../common/helper" "../../common/track") "dbgr-") (require-relative-list '("core" "track-mode") "dbgr-pdb-") ;; This is needed, or at least the docstring part of it is needed to ;; get the customization menu to work in Emacs 23. (defgroup pdb nil "The Python pdb debugger" :group 'processes :group 'dbgr :group 'python :version "23.1") ;; ------------------------------------------------------------------- ;; User definable variables ;; (defcustom pdb-command-name "pdb" "File name for executing the stock Python debugger and command options. This should be an executable on your path, or an absolute file name." :type 'string :group 'pdb) (declare-function pdb-track-mode (bool)) ;; ------------------------------------------------------------------- ;; The end. ;; ;;;###autoload (defun dbgr-pdb (&optional opt-command-line no-reset) "Invoke the pdb Python debugger and start the Emacs user interface. String COMMAND-LINE specifies how to run pdb. Normally command buffers are reused when the same debugger is reinvoked inside a command buffer with a similar command. If we discover that the buffer has prior command-buffer information and NO-RESET is nil, then that information which may point into other buffers and source buffers which may contain marks and fringe or marginal icons is reset." (interactive) (let* ( (cmd-str (or opt-command-line (pdb-query-cmdline "pdb"))) (cmd-args (split-string-and-unquote cmd-str)) (parsed-args (pdb-parse-cmd-args cmd-args)) (script-args (cdr cmd-args)) (script-name (car script-args)) (cmd-buf)) (dbgr-run-process "pdb" script-name cmd-args 'pdb-track-mode no-reset) ) ) (defalias 'pdb 'dbgr-pdb) (provide-me "dbgr-")