1. xemacs
  2. debug


debug / pdb.el

Diff from to

File pdb.el

  • Ignore whitespace
 ; requires 'pdb' to be an executable command which runs the pdb.py from 
 ; Python 1.4b3 or later (e.g. a symbolic link to /usr/local/lib/python1.4/pdb.py)
-; - copy pdb.el to your xemacs site-lisp directory (or somewhere else where
-;   else on your xemacs' load path)
-; - add (load-library "pdb.el") to your ~/.emacs file
+; On Windows platforms, you can place a "pdb.bat" file somewhere along
+; your path, containing something like 
+; "C:\Program Files\Python\python.exe" -u "C:\Program Files\Python\Lib\pdb.py" %1 %2 %3 %4 %5 %6 %7 %8 %9
+; (modify the paths according to where your local Python installation lives)
+; - copy pdb.el to your xemacs site-lisp directory (or somewhere else
+;   on your xemacs' load path)  Note - for XEmacs 21 this is not necessary
+; - add (load-library "pdb.el") to your ~/.emacs file (not needed for Xemacs 21)
 ; - open some python file and start pdb from Emacs with M-x pdb
 ; - type in pdb commands or use the gud commands from your source buffer
 ;   (C-x C-a C-...see the 'gud-def's below and gud.el for more information) 
 ; Tested with xemacs 19.13/19.14 / gud.el 1.3 / python 1.4b3.
 ; Wolfgang Weitz <wwe@aifb.uni-karlsruhe.de>
+; Charles G Waldman <cgw@pgt.com> 1998-11-18
+; Fixed gud-pdb-marker filter so this works on Windows, as well as
+; directories with a hyphen in the name (like site-packages).  Also
+; use completing read to read the command line at startup.
 (defun gud-pdb-marker-filter (string)
   (if (string-match
-       "> \\([/a-zA-Z_][/a-zA-Z0-9_\\.]*\\)(\\([0-9]+\\))[?a-zA-Z_][a-zA-Z0-9_]*()\\(->[^\n]+\\)?\n"
+       "> \\([-/\\\\: a-zA-Z0-9_\\.]+\\)(\\([0-9]+\\))[?a-zA-Z0-9_]+().*"
       (setq gud-last-frame
       The directory containing FILE becomes the initial working directory
       and source-file directory for your debugger."
-  (list (read-from-minibuffer "Run pdb (like this): "
+  (list (read-shell-command "Run pdb (like this): "
 			       (if (consp gud-pdb-history)
-				   (car gud-pdb-history) "pdb ") nil nil
+				   (car gud-pdb-history) "pdb ") 
 			       '(gud-pdb-history . 1))))
   (gud-overload-functions '((gud-massage-args . gud-pdb-massage-args)
 			    (gud-marker-filter . gud-pdb-marker-filter)
   (gud-def gud-finish "return"      "\C-f" "Finish executing current function.")
   (gud-def gud-up     "up %p"       "<" "Up N stack frames (numeric arg).")
   (gud-def gud-down   "down %p"     ">" "Down N stack frames (numeric arg).")
-  (gud-def gud-print  "p %e"        "\C-p" "Evaluate C expression at point.")
+  (gud-def gud-print  "p %e"        "\C-p" "Evaluate Python expression at point.")
   (gud-def gud-where "where" "?" "where")