aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2007-09-15 08:09:07 +0000
committerNick Roberts2007-09-15 08:09:07 +0000
commit9558a54ac728e667d1ed41b667fdfcf31a0b5d32 (patch)
tree787c244b4632002a84feaa7998319050f4f2882f
parent42ac3301fb1157a31b0895f7ab67217179ae816b (diff)
downloademacs-9558a54ac728e667d1ed41b667fdfcf31a0b5d32.tar.gz
emacs-9558a54ac728e667d1ed41b667fdfcf31a0b5d32.zip
(gdba, gdb-send, gdb-source-info):
Use gdb-ready. Discard input until GDB is ready to accept it.
-rw-r--r--lisp/progmodes/gdb-ui.el44
1 files changed, 27 insertions, 17 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 716b79138f9..629a61f68e1 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -223,6 +223,9 @@ handlers.")
223The directory containing FILE becomes the initial working directory 223The directory containing FILE becomes the initial working directory
224and source-file directory for your debugger. 224and source-file directory for your debugger.
225 225
226This function requires that GDB is run with \"--annotate=3\", so
227don't edit this option in the mini-buffer.
228
226If `gdb-many-windows' is nil (the default value) then gdb just 229If `gdb-many-windows' is nil (the default value) then gdb just
227pops up the GUD buffer unless `gdb-show-main' is t. In this case 230pops up the GUD buffer unless `gdb-show-main' is t. In this case
228it starts with two windows: one displaying the GUD buffer and the 231it starts with two windows: one displaying the GUD buffer and the
@@ -270,6 +273,10 @@ detailed description of this mode.
270 ;; 273 ;;
271 (interactive (list (gud-query-cmdline 'gdba))) 274 (interactive (list (gud-query-cmdline 'gdba)))
272 ;; 275 ;;
276 ;; Do this early in case user enters commands before GDB is ready.
277 (setq comint-input-sender 'gdb-send)
278 (setq gdb-ready nil)
279
273 ;; Let's start with a basic gud-gdb buffer and then modify it a bit. 280 ;; Let's start with a basic gud-gdb buffer and then modify it a bit.
274 (gdb command-line) 281 (gdb command-line)
275 (gdb-init-1)) 282 (gdb-init-1))
@@ -1124,20 +1131,21 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
1124(defun gdb-send (proc string) 1131(defun gdb-send (proc string)
1125 "A comint send filter for gdb. 1132 "A comint send filter for gdb.
1126This filter may simply queue input for a later time." 1133This filter may simply queue input for a later time."
1127 (with-current-buffer gud-comint-buffer 1134 (when gdb-ready
1128 (let ((inhibit-read-only t)) 1135 (with-current-buffer gud-comint-buffer
1129 (remove-text-properties (point-min) (point-max) '(face)))) 1136 (let ((inhibit-read-only t))
1130 (if gud-running 1137 (remove-text-properties (point-min) (point-max) '(face))))
1131 (progn 1138 (if gud-running
1132 (let ((item (concat string "\n"))) 1139 (progn
1133 (if gdb-enable-debug (push (cons 'send item) gdb-debug-log)) 1140 (let ((item (concat string "\n")))
1134 (process-send-string proc item))) 1141 (if gdb-enable-debug (push (cons 'send item) gdb-debug-log))
1135 (if (string-match "\\\\\\'" string) 1142 (process-send-string proc item)))
1136 (setq gdb-continuation (concat gdb-continuation string "\n")) 1143 (if (string-match "\\\\\\'" string)
1137 (let ((item (concat gdb-continuation string 1144 (setq gdb-continuation (concat gdb-continuation string "\n"))
1138 (if (not comint-input-sender-no-newline) "\n")))) 1145 (let ((item (concat gdb-continuation string
1139 (gdb-enqueue-input item) 1146 (if (not comint-input-sender-no-newline) "\n"))))
1140 (setq gdb-continuation nil))))) 1147 (gdb-enqueue-input item)
1148 (setq gdb-continuation nil))))))
1141 1149
1142;; Note: Stuff enqueued here will be sent to the next prompt, even if it 1150;; Note: Stuff enqueued here will be sent to the next prompt, even if it
1143;; is a query, or other non-top-level prompt. 1151;; is a query, or other non-top-level prompt.
@@ -1193,8 +1201,9 @@ This filter may simply queue input for a later time."
1193;; any newlines. 1201;; any newlines.
1194;; 1202;;
1195 1203
1196(defcustom gud-gdba-command-name "gdb -annotate=3" 1204(defcustom gud-gdba-command-name "gdb --annotate=3"
1197 "Default command to execute an executable under the GDB-UI debugger." 1205 "Default command to execute an executable under the GDB-UI debugger.
1206The option \"--annotate=3\" must be included in it's value."
1198 :type 'string 1207 :type 'string
1199 :group 'gud 1208 :group 'gud
1200 :version "22.1") 1209 :version "22.1")
@@ -2996,7 +3005,8 @@ buffers."
2996 (gdb-get-buffer-create 'gdb-breakpoints-buffer) 3005 (gdb-get-buffer-create 'gdb-breakpoints-buffer)
2997 (if gdb-show-main 3006 (if gdb-show-main
2998 (let ((pop-up-windows t)) 3007 (let ((pop-up-windows t))
2999 (display-buffer (gud-find-file gdb-main-file)))))) 3008 (display-buffer (gud-find-file gdb-main-file)))))
3009 (setq gdb-ready t))
3000 3010
3001(defun gdb-get-location (bptno line flag) 3011(defun gdb-get-location (bptno line flag)
3002 "Find the directory containing the relevant source file. 3012 "Find the directory containing the relevant source file.