address for root variables.")
(defvar gdb-main-file nil "Source file from which program execution begins.")
(defvar gud-old-arrow nil)
+(defvar gdb-thread-indicator nil)
(defvar gdb-overlay-arrow-position nil)
(defvar gdb-stack-position nil)
(defvar gdb-server-prefix nil)
gdb-look-up-stack nil
gdb-frame-begin nil
gdb-printing t
- gud-old-arrow nil)
+ gud-old-arrow nil
+ gdb-thread-indicator nil)
(setq gdb-buffer-type 'gdba)
("stopped" gdb-stopped)
("error-begin" gdb-error)
("error" gdb-error)
- ) "An assoc mapping annotation tags to functions which process them.")
+ ("new-thread" (lambda (ignored) (gdb-get-buffer-create 'gdb-threads-buffer))))
+ "An assoc mapping annotation tags to functions which process them.")
(defun gdb-resync()
(setq gdb-flush-pending-output t)
(setq gud-running nil)
(gdb-force-mode-line-update
- (propertize "stopped"'face font-lock-warning-face))
+ (propertize "stopped" 'face font-lock-warning-face))
(setq gdb-output-sink 'user)
(setq gdb-input-queue nil)
(setq gdb-pending-triggers nil)
(add-to-list 'overlay-arrow-variable-list 'gdb-stack-position)
(setq truncate-lines t) ;; Make it easier to see overlay arrow.
(setq buffer-read-only t)
+ (gdb-thread-identification)
(use-local-map gdb-frames-mode-map)
(run-mode-hooks 'gdb-frames-mode-hook)
(setq gdb-stack-update t)
(let ((buffer-read-only nil))
(save-excursion
(goto-char (point-min))
+ (if (re-search-forward "\\* \\([0-9]+\\)" nil t)
+ (setq gdb-thread-indicator
+ (propertize (concat " [" (match-string 1) "]")
+ ; FIXME: this help-echo doesn't work
+ 'help-echo "thread id")))
+ (goto-char (point-min))
(while (< (point) (point-max))
(unless (looking-at "No ")
(add-text-properties (line-beginning-position) (line-end-position)
(set (make-local-variable 'font-lock-defaults)
'(gdb-threads-font-lock-keywords))
(run-mode-hooks 'gdb-threads-mode-hook)
- 'gdb-invalidate-threads)
+ ;; Force "info threads" onto queue.
+ (lambda () (let ((gud-running nil)) (gdb-invalidate-threads))))
(defun gdb-get-thread-number ()
(save-excursion
(list (concat gdb-server-prefix "thread "
(gdb-get-thread-number) "\n") 'ignore))
(gud-display-frame))
-\f
+(defun gdb-thread-identification ()
+ (setq mode-line-buffer-identification
+ (list (car mode-line-buffer-identification)
+ '(gdb-thread-indicator gdb-thread-indicator))))
+\f
;; Registers buffer.
;;
(defcustom gdb-all-registers nil
(setq major-mode 'gdb-registers-mode)
(setq mode-name "Registers")
(setq buffer-read-only t)
+ (gdb-thread-identification)
(use-local-map gdb-registers-mode-map)
(run-mode-hooks 'gdb-registers-mode-hook)
(if (string-equal gdb-version "pre-6.4")
(setq major-mode 'gdb-locals-mode)
(setq mode-name (concat "Locals:" gdb-selected-frame))
(setq buffer-read-only t)
+ (gdb-thread-identification)
(use-local-map gdb-locals-mode-map)
(set (make-local-variable 'font-lock-defaults)
'(gdb-locals-font-lock-keywords))
(goto-char (point-min))
(if (search-forward "Includes preprocessor macro info." nil t)
(setq gdb-macro-info t))
- (if gdb-many-windows
+ (if gdb-many-windows
(gdb-setup-windows)
(gdb-get-buffer-create 'gdb-breakpoints-buffer)
(if gdb-show-main
(add-to-list 'overlay-arrow-variable-list 'gdb-overlay-arrow-position)
(setq fringes-outside-margins t)
(setq buffer-read-only t)
+ (gdb-thread-identification)
(use-local-map gdb-assembler-mode-map)
(gdb-invalidate-assembler)
(set (make-local-variable 'font-lock-defaults)