]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/gud.el
(inferior-python-mode-map): Remove erroneous C-c C-z binding.
[gnu-emacs] / lisp / progmodes / gud.el
index ff04c05edffe8a15bc8d6ba391c0a531d5d5622d..035b5da875ab36e87a250eece93677b14cda7ba4 100644 (file)
@@ -4,7 +4,7 @@
 ;; Maintainer: FSF
 ;; Keywords: unix, tools
 
-;; Copyright (C) 1992,93,94,95,96,1998,2000,02,2003 Free Software Foundation, Inc.
+;; Copyright (C) 1992,93,94,95,96,1998,2000,02,03,04 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -92,7 +92,9 @@ If SOFT is non-nil, returns nil if the symbol doesn't already exist."
 Used to grey out relevant toolbar icons.")
 
 (easy-mmode-defmap gud-menu-map
-  '(([refresh] "Refresh" . gud-refresh)
+  '(([help]     menu-item "Help" gdb-goto-info
+                     :enable (eq gud-minor-mode 'gdba))
+    ([refresh] "Refresh" . gud-refresh)
     ([run]     menu-item "Run" gud-run
                      :enable (and (not gud-running)
                                  (memq gud-minor-mode '(gdba gdb dbx jdb))))
@@ -116,20 +118,17 @@ Used to grey out relevant toolbar icons.")
     ([print]   menu-item "Print Expression" gud-print
                      :enable (not gud-running))
     ([watch]   menu-item "Watch Expression" gud-watch
-                    :enable (and (not gud-running)
-                                 (eq gud-minor-mode 'gdba)))
+                    :enable (and (not gud-running) (eq gud-minor-mode 'gdba)))
     ([finish]  menu-item "Finish Function" gud-finish
                     :enable (and (not gud-running)
                                  (memq gud-minor-mode
                                        '(gdba gdb xdb jdb pdb bashdb))))
     ([stepi]   menu-item "Step Instruction" gud-stepi
                      :enable (and (not gud-running)
-                                 (memq gud-minor-mode
-                                       '(gdba gdb dbx))))
+                                 (memq gud-minor-mode '(gdba gdb dbx))))
     ([nexti]   menu-item "Next Instruction" gud-nexti
                      :enable (and (not gud-running)
-                                 (memq gud-minor-mode
-                                       '(gdba gdb dbx))))
+                                 (memq gud-minor-mode '(gdba gdb dbx))))
     ([step]    menu-item "Step Line" gud-step
                      :enable (not gud-running))
     ([next]    menu-item "Next Line" gud-next
@@ -171,7 +170,8 @@ Used to grey out relevant toolbar icons.")
                     (gud-stepi . "gud-si")
                     (gud-nexti . "gud-ni")
                     (gud-up . "gud-up")
-                    (gud-down . "gud-down"))
+                    (gud-down . "gud-down")
+                    (gdb-goto-info . "help"))
                   map)
          (tool-bar-local-item-from-menu
           (car x) (cdr x) map gud-minor-mode-map)))))
@@ -477,7 +477,7 @@ off the specialized speedbar mode."
     ;; gud-marker-acc until we receive the rest of it. Since we
     ;; know the full marker regexp above failed, it's pretty simple to
     ;; test for marker starts.
-    (if (string-match "\032.*\\'" gud-marker-acc)
+    (if (string-match "\n\\(\032.*\\)?\\'" gud-marker-acc)
        (progn
          ;; Everything before the potential marker start can be output.
          (setq output (concat output (substring gud-marker-acc
@@ -1401,7 +1401,7 @@ and source-file directory for your debugger."
 
     output))
 
-(defcustom gud-pdb-command-name "pdb"
+(defcustom gud-pdb-command-name "pydb"
   "File name for executing the Python debugger.
 This should be an executable on your path, or an absolute file name."
   :type 'string
@@ -2384,8 +2384,11 @@ comint mode, which see."
                    (if (file-name-directory file-subst)
                        (expand-file-name file-subst)
                      file-subst)))
-        (filepart (and file-word (concat "-" (file-name-nondirectory file)))))
+        (filepart (and file-word (concat "-" (file-name-nondirectory file))))
+        (existing-buffer (get-buffer (concat "*gud" filepart "*"))))
     (pop-to-buffer (concat "*gud" filepart "*"))
+    (when (and existing-buffer (get-buffer-process existing-buffer))
+      (error "This program is already running under gdb"))
     ;; Set the dir, in case the buffer already existed with a different dir.
     (setq default-directory dir)
     ;; Set default-directory to the file's directory.