# HG changeset patch # User Nick Roberts # Date 1083176112 0 # Node ID 1014ad95113040a25899327791cfa04d7b4db7f2 # Parent d69cbc877b46ba1fd7e46b83beaeba5536a57bb5 (gud-common-init): Throw an error if program is already running under gdb. diff -r d69cbc877b46 -r 1014ad951130 lisp/progmodes/gud.el --- 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.