changeset 55216:1014ad951130

(gud-common-init): Throw an error if program is already running under gdb.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 28 Apr 2004 18:15:12 +0000
parents d69cbc877b46
children 97d0e3a1174f
files lisp/progmodes/gud.el
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gud.el	Wed Apr 28 18:14:32 2004 +0000
+++ b/lisp/progmodes/gud.el	Wed Apr 28 18:15:12 2004 +0000
@@ -2384,8 +2384,10 @@
 		    (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.