;; still under development and is part of a process to migrate Emacs from
;; annotations to GDB/MI.
;;
+;; This mode SHOULD WORK WITH GDB 5.0 ONWARDS but you will NEED GDB 6.0
+;; ONWARDS TO USE WATCH EXPRESSIONS.
+;;
;; Windows Platforms:
;;
;; If you are using Emacs and GDB on Windows you will need to flush the buffer
(with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
(goto-char (point-min))
(if (search-forward "expands to: " nil t)
- (unless (looking-at "\\S+.*(.*).*")
+ (unless (looking-at "\\S-+.*(.*).*")
(gdb-enqueue-input
(list (concat gdb-server-prefix "print " expr "\n")
'gdb-tooltip-print))))))
gdb-info-registers-handler
gdb-info-registers-custom)
-(defun gdb-info-registers-custom ())
+(defun gdb-info-registers-custom ()
+ (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
+ (save-excursion
+ (let ((buffer-read-only nil)
+ bl)
+ (goto-char (point-min))
+ (while (< (point) (point-max))
+ (setq bl (line-beginning-position))
+ (when (looking-at "^[^ ]+")
+ (put-text-property bl (match-end 0)
+ 'face font-lock-variable-name-face))
+ (forward-line 1))))))
(defvar gdb-registers-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "q" 'kill-this-buffer)
map))
-(defvar gdb-registers-font-lock-keywords
- '(
- ("^[^ ]+" . font-lock-variable-name-face)
- )
- "Font lock keywords used in `gdb-registers-mode'.")
-
(defun gdb-registers-mode ()
"Major mode for gdb registers.
(setq mode-name "Registers:")
(setq buffer-read-only t)
(use-local-map gdb-registers-mode-map)
- (set (make-local-variable 'font-lock-defaults)
- '(gdb-registers-font-lock-keywords))
(run-mode-hooks 'gdb-registers-mode-hook)
(if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
'gdb-invalidate-registers
;; Abbreviate for arrays and structures.
;; These can be expanded using gud-display.
-(defun gdb-info-locals-handler nil
+(defun gdb-info-locals-handler ()
(setq gdb-pending-triggers (delq 'gdb-invalidate-locals
gdb-pending-triggers))
(let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
(define-key map "q" 'kill-this-buffer)
map))
-(defvar gdb-local-font-lock-keywords
+(defvar gdb-locals-font-lock-keywords
'(
;; var = (struct struct_tag) value
( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
(setq buffer-read-only t)
(use-local-map gdb-locals-mode-map)
(set (make-local-variable 'font-lock-defaults)
- '(gdb-local-font-lock-keywords))
+ '(gdb-locals-font-lock-keywords))
(run-mode-hooks 'gdb-locals-mode-hook)
(if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
'gdb-invalidate-locals