Function: pdb
pdb is an autoloaded, interactive and byte-compiled function defined
in gud.el.gz.
Signature
(pdb COMMAND-LINE)
Documentation
Run COMMAND-LINE in the *gud-FILE* buffer to debug Python programs.
COMMAND-LINE should include the pdb executable
name (gud-pdb-command-name) and the file to be debugged.
If called interactively, the command line will be prompted for.
The directory containing this file becomes the initial working directory and source-file directory for your debugger.
Probably introduced at or before Emacs version 20.3.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/gud.el.gz
;;;###autoload
(defun pdb (command-line)
"Run COMMAND-LINE in the `*gud-FILE*' buffer to debug Python programs.
COMMAND-LINE should include the pdb executable
name (`gud-pdb-command-name') and the file to be debugged.
If called interactively, the command line will be prompted for.
The directory containing this file becomes the initial working
directory and source-file directory for your debugger."
(interactive
(list (gud-query-cmdline
'pdb nil
(when-let* ((file (buffer-file-name)))
(list (concat gud-pdb-command-name " "
(shell-quote-argument file)))))))
(gud-common-init command-line nil 'gud-pdb-marker-filter)
(setq-local gud-minor-mode 'pdb)
(gud-def gud-break "break %d%f:%l" "\C-b" "Set breakpoint at current line.")
(gud-def gud-remove "clear %d%f:%l" "\C-d" "Remove breakpoint at current line")
(gud-def gud-step "step" "\C-s" "Step one source line with display.")
(gud-def gud-next "next" "\C-n" "Step one line (skip functions).")
(gud-def gud-cont "continue" "\C-r" "Continue with display.")
(gud-def gud-finish "return" "\C-f" "Finish executing current function.")
(gud-def gud-up "up" "<" "Up one stack frame.")
(gud-def gud-down "down" ">" "Down one stack frame.")
(gud-def gud-print "p %e" "\C-p" "Evaluate Python expression at point.")
(gud-def gud-statement "!%e" "\C-e" "Execute Python statement at point.")
(gud-set-repeat-map-property 'gud-pdb-repeat-map)
;; (setq comint-prompt-regexp "^(.*pdb[+]?) *")
(setq comint-prompt-regexp "^(Pdb) *")
(setq paragraph-start comint-prompt-regexp)
(run-hooks 'pdb-mode-hook))