]> code.delx.au - gnu-emacs/commitdiff
(gud-common-init): Throw an error if program is
authorNick Roberts <nickrob@snap.net.nz>
Wed, 28 Apr 2004 18:15:12 +0000 (18:15 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Wed, 28 Apr 2004 18:15:12 +0000 (18:15 +0000)
already running under gdb.

lisp/progmodes/gud.el

index bdf8c93f900dcc61acdc28cc78a5b89b6aa804a7..9cb3ae26c3b591853df3b3c6539f3c23330f34fa 100644 (file)
@@ -2384,8 +2384,10 @@ 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 "*"))
+    (if 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.