comparison lisp/progmodes/gdb-ui.el @ 95251:7fc95e208907

(gdb-enable-debug): New function. (gdb-annotation-rules): New entry for "thread-changed". (gdb-thread-changed): New function.
author Nick Roberts <nickrob@snap.net.nz>
date Fri, 23 May 2008 07:36:54 +0000
parents 52b7a8c22af5
children b4e36ff621b3
comparison
equal deleted inserted replaced
95250:ae1ecb8cd760 95251:7fc95e208907
399 (format ":%s [%s]" 399 (format ":%s [%s]"
400 (process-status (get-buffer-process buffer)) status)) 400 (process-status (get-buffer-process buffer)) status))
401 ;; Force mode line redisplay soon. 401 ;; Force mode line redisplay soon.
402 (force-mode-line-update))))) 402 (force-mode-line-update)))))
403 403
404 (defun gdb-enable-debug (arg)
405 "Toggle logging of transaction between Emacs and Gdb.
406 The log is stored in `gdb-debug-log' as an alist with elements
407 whose cons is send, send-item or recv and whose cdr is the string
408 being transferred. This list may grow up to a size of
409 `gdb-debug-log-max' after which the oldest element (at the end of
410 the list) is deleted every time a new one is added (at the front)."
411 (interactive "P")
412 (setq gdb-enable-debug
413 (if (null arg)
414 (not gdb-enable-debug)
415 (> (prefix-numeric-value arg) 0)))
416 (message (format "Logging of transaction %sabled"
417 (if gdb-enable-debug "en" "dis"))))
418
404 (defun gdb-many-windows (arg) 419 (defun gdb-many-windows (arg)
405 "Toggle the number of windows in the basic arrangement. 420 "Toggle the number of windows in the basic arrangement.
406 With prefix argument ARG, display additional buffers if ARG is positive, 421 With prefix argument ARG, display additional buffers if ARG is positive,
407 otherwise use a single window." 422 otherwise use a single window."
408 (interactive "P") 423 (interactive "P")
1311 ("watchpoint" gdb-stopping) 1326 ("watchpoint" gdb-stopping)
1312 ("frame-begin" gdb-frame-begin) 1327 ("frame-begin" gdb-frame-begin)
1313 ("stopped" gdb-stopped) 1328 ("stopped" gdb-stopped)
1314 ("error-begin" gdb-error) 1329 ("error-begin" gdb-error)
1315 ("error" gdb-error) 1330 ("error" gdb-error)
1316 ("new-thread" (lambda (ignored) (gdb-get-buffer-create 'gdb-threads-buffer)))) 1331 ("new-thread" (lambda (ignored)
1332 (gdb-get-buffer-create 'gdb-threads-buffer)))
1333 ("thread-changed" gdb-thread-changed))
1317 "An assoc mapping annotation tags to functions which process them.") 1334 "An assoc mapping annotation tags to functions which process them.")
1318 1335
1319 (defun gdb-resync() 1336 (defun gdb-resync()
1320 (setq gdb-flush-pending-output t) 1337 (setq gdb-flush-pending-output t)
1321 (setq gud-running nil) 1338 (setq gud-running nil)
1536 (error "Unexpected stopped annotation")))) 1553 (error "Unexpected stopped annotation"))))
1537 (if gdb-signalled (gdb-exited ignored))) 1554 (if gdb-signalled (gdb-exited ignored)))
1538 1555
1539 (defun gdb-error (ignored) 1556 (defun gdb-error (ignored)
1540 (setq gdb-error (not gdb-error))) 1557 (setq gdb-error (not gdb-error)))
1558
1559 (defun gdb-thread-changed (ignored)
1560 (gdb-frames-force-update))
1541 1561
1542 (defun gdb-post-prompt (ignored) 1562 (defun gdb-post-prompt (ignored)
1543 "An annotation handler for `post-prompt'. 1563 "An annotation handler for `post-prompt'.
1544 This begins the collection of output from the current command if that 1564 This begins the collection of output from the current command if that
1545 happens to be appropriate." 1565 happens to be appropriate."