aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2006-03-16 07:29:18 +0000
committerNick Roberts2006-03-16 07:29:18 +0000
commitbe08da22a6f9055a58a10ab66e755fd5250bbac2 (patch)
treeec78862ffe8b34d8e7e213e73c1fdcc68ef39903
parentaf9674234ed87d2ea08891ab2e1ddb6d086b16e2 (diff)
downloademacs-be08da22a6f9055a58a10ab66e755fd5250bbac2.tar.gz
emacs-be08da22a6f9055a58a10ab66e755fd5250bbac2.zip
(gdb-inferior-status): New variable.
(gdb-force-mode-line-update): New function. (gdb-resync, gdb-starting, gdb-signal, gdb-exited, gdb-stopped) (gdb-exited): Use them. (gdb-signal): New fuction. (gdb-annotation-rules): Provide a rule for it.
-rw-r--r--lisp/progmodes/gdb-ui.el29
1 files changed, 27 insertions, 2 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index db704985f2a..86d1cb02da0 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -125,6 +125,7 @@ and #define directives otherwise.")
125(defvar gdb-buffer-fringe-width nil) 125(defvar gdb-buffer-fringe-width nil)
126(defvar gdb-signalled nil) 126(defvar gdb-signalled nil)
127(defvar gdb-source-window nil) 127(defvar gdb-source-window nil)
128(defvar gdb-inferior-status nil)
128 129
129(defvar gdb-buffer-type nil 130(defvar gdb-buffer-type nil
130 "One of the symbols bound in `gdb-buffer-rules'.") 131 "One of the symbols bound in `gdb-buffer-rules'.")
@@ -317,6 +318,16 @@ of the inferior. Non-nil means display the layout shown for
317 :group 'gud 318 :group 'gud
318 :version "22.1") 319 :version "22.1")
319 320
321(defun gdb-force-mode-line-update (status)
322 (let ((buffer gud-comint-buffer))
323 (if (and buffer (buffer-name buffer))
324 (with-current-buffer buffer
325 (setq mode-line-process
326 (format ":%s [%s]"
327 (process-status (get-buffer-process buffer)) status))
328 ;; Force mode line redisplay soon.
329 (force-mode-line-update)))))
330
320(defun gdb-many-windows (arg) 331(defun gdb-many-windows (arg)
321 "Toggle the number of windows in the basic arrangement. 332 "Toggle the number of windows in the basic arrangement.
322With arg, display additional buffers iff arg is positive." 333With arg, display additional buffers iff arg is positive."
@@ -524,7 +535,8 @@ With arg, use separate IO iff arg is positive."
524 gdb-buffer-fringe-width (car (window-fringes)) 535 gdb-buffer-fringe-width (car (window-fringes))
525 gdb-debug-ring nil 536 gdb-debug-ring nil
526 gdb-signalled nil 537 gdb-signalled nil
527 gdb-source-window nil) 538 gdb-source-window nil
539 gdb-inferior-status nil)
528 540
529 (setq gdb-buffer-type 'gdba) 541 (setq gdb-buffer-type 'gdba)
530 542
@@ -1152,7 +1164,7 @@ This filter may simply queue input for a later time."
1152 ("starting" gdb-starting) 1164 ("starting" gdb-starting)
1153 ("exited" gdb-exited) 1165 ("exited" gdb-exited)
1154 ("signalled" gdb-signalled) 1166 ("signalled" gdb-signalled)
1155 ("signal" gdb-stopping) 1167 ("signal" gdb-signal)
1156 ("breakpoint" gdb-stopping) 1168 ("breakpoint" gdb-stopping)
1157 ("watchpoint" gdb-stopping) 1169 ("watchpoint" gdb-stopping)
1158 ("frame-begin" gdb-frame-begin) 1170 ("frame-begin" gdb-frame-begin)
@@ -1164,6 +1176,7 @@ This filter may simply queue input for a later time."
1164(defun gdb-resync() 1176(defun gdb-resync()
1165 (setq gdb-flush-pending-output t) 1177 (setq gdb-flush-pending-output t)
1166 (setq gud-running nil) 1178 (setq gud-running nil)
1179 (gdb-force-mode-line-update "stopped")
1167 (setq gdb-output-sink 'user) 1180 (setq gdb-output-sink 'user)
1168 (setq gdb-input-queue nil) 1181 (setq gdb-input-queue nil)
1169 (setq gdb-pending-triggers nil) 1182 (setq gdb-pending-triggers nil)
@@ -1238,6 +1251,8 @@ not GDB."
1238 ((eq sink 'user) 1251 ((eq sink 'user)
1239 (progn 1252 (progn
1240 (setq gud-running t) 1253 (setq gud-running t)
1254 (setq gdb-inferior-status "running")
1255 (gdb-force-mode-line-update gdb-inferior-status)
1241 (gdb-remove-text-properties) 1256 (gdb-remove-text-properties)
1242 (setq gud-overlay-arrow-position nil) 1257 (setq gud-overlay-arrow-position nil)
1243 (setq gdb-overlay-arrow-position nil) 1258 (setq gdb-overlay-arrow-position nil)
@@ -1247,6 +1262,11 @@ not GDB."
1247 (gdb-resync) 1262 (gdb-resync)
1248 (error "Unexpected `starting' annotation"))))) 1263 (error "Unexpected `starting' annotation")))))
1249 1264
1265(defun gdb-signal (ignored)
1266 (setq gdb-inferior-status "signal")
1267 (gdb-force-mode-line-update gdb-inferior-status)
1268 (gdb-stopping ignored))
1269
1250(defun gdb-stopping (ignored) 1270(defun gdb-stopping (ignored)
1251 "An annotation handler for `breakpoint' and other annotations. 1271 "An annotation handler for `breakpoint' and other annotations.
1252They say that I/O for the subprocess is now GDB, not the program 1272They say that I/O for the subprocess is now GDB, not the program
@@ -1269,6 +1289,8 @@ directives."
1269 (setq gdb-active-process nil) 1289 (setq gdb-active-process nil)
1270 (setq gud-overlay-arrow-position nil) 1290 (setq gud-overlay-arrow-position nil)
1271 (setq gdb-overlay-arrow-position nil) 1291 (setq gdb-overlay-arrow-position nil)
1292 (setq gdb-inferior-status "exited")
1293 (gdb-force-mode-line-update gdb-inferior-status)
1272 (gdb-stopping ignored)) 1294 (gdb-stopping ignored))
1273 1295
1274(defun gdb-signalled (ignored) 1296(defun gdb-signalled (ignored)
@@ -1290,6 +1312,9 @@ directives."
1290It is just like `gdb-stopping', except that if we already set the output 1312It is just like `gdb-stopping', except that if we already set the output
1291sink to `user' in `gdb-stopping', that is fine." 1313sink to `user' in `gdb-stopping', that is fine."
1292 (setq gud-running nil) 1314 (setq gud-running nil)
1315 (unless (member gdb-inferior-status '("exited" "signal"))
1316 (setq gdb-inferior-status "stopped")
1317 (gdb-force-mode-line-update gdb-inferior-status))
1293 (let ((sink gdb-output-sink)) 1318 (let ((sink gdb-output-sink))
1294 (cond 1319 (cond
1295 ((eq sink 'inferior) 1320 ((eq sink 'inferior)