aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2005-11-22 03:10:53 +0000
committerNick Roberts2005-11-22 03:10:53 +0000
commite03a33ea4841e078f8d26a6750220ce8c6861c99 (patch)
tree3472695c03bf5a3f8c9e4ce02cbacbee49c956bd
parentd7c0be75d37fe07fefbb0be1333da9bade496fb2 (diff)
downloademacs-e03a33ea4841e078f8d26a6750220ce8c6861c99.tar.gz
emacs-e03a33ea4841e078f8d26a6750220ce8c6861c99.zip
(gdb-locals-watch-keymap): New local map.
(gdb-struct-string, gdb-array-string): New constants. (gdb-info-locals-handler): Use them. (gdb-reset): Reset gdb-var-list to nil.
-rw-r--r--lisp/progmodes/gdb-ui.el34
1 files changed, 29 insertions, 5 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 92265dd46da..0d4c9211b09 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -75,9 +75,11 @@
75;; of 'info registers'. 75;; of 'info registers'.
76;; 3) Use tree-widget.el instead of the speedbar for watch-expressions? 76;; 3) Use tree-widget.el instead of the speedbar for watch-expressions?
77;; 4) Mark breakpoint locations on scroll-bar of source buffer? 77;; 4) Mark breakpoint locations on scroll-bar of source buffer?
78;; 5) After release of 22.1 use '-var-list-children --all-values' 78;; 5) After release of 22.1, use "-var-list-children --all-values"
79;; and '-stack-list-locals 2' which need GDB 6.1 onwards. 79;; and "-stack-list-locals --simple-values" which need GDB 6.1 onwards.
80;; 6) With gud-print and gud-pstar, print the variable name in the GUD 80;; 6) After release of 22.1, use "-var-update --all-values" which needs
81;; GDB 6.4 onwards.
82;; 7) With gud-print and gud-pstar, print the variable name in the GUD
81;; buffer instead of the value's history number. 83;; buffer instead of the value's history number.
82 84
83;;; Code: 85;;; Code:
@@ -2230,6 +2232,27 @@ corresponding to the mode line clicked."
2230 "server info locals\n" 2232 "server info locals\n"
2231 gdb-info-locals-handler) 2233 gdb-info-locals-handler)
2232 2234
2235(defvar gdb-locals-watch-keymap
2236 (let ((map (make-sparse-keymap)))
2237 (define-key map [mouse-2] '(lambda (event) (interactive "e")
2238 (mouse-set-point event)
2239 (beginning-of-line)
2240 (gud-watch)))
2241 map)
2242 "Keymap to create watch expression of a complex data type local variable.")
2243
2244(defconst gdb-struct-string
2245 (concat (propertize "[struct/union];"
2246 'mouse-face 'highlight
2247 'help-echo "mouse-2: create watch expression"
2248 'local-map gdb-locals-watch-keymap) "\n"))
2249
2250(defconst gdb-array-string
2251 (concat " " (propertize "[array];"
2252 'mouse-face 'highlight
2253 'help-echo "mouse-2: create watch expression"
2254 'local-map gdb-locals-watch-keymap) "\n"))
2255
2233;; Abbreviate for arrays and structures. 2256;; Abbreviate for arrays and structures.
2234;; These can be expanded using gud-display. 2257;; These can be expanded using gud-display.
2235(defun gdb-info-locals-handler () 2258(defun gdb-info-locals-handler ()
@@ -2242,10 +2265,10 @@ corresponding to the mode line clicked."
2242 (replace-match "" nil nil)) 2265 (replace-match "" nil nil))
2243 (goto-char (point-min)) 2266 (goto-char (point-min))
2244 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t) 2267 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t)
2245 (replace-match "(structure);\n" nil nil)) 2268 (replace-match gdb-struct-string nil nil))
2246 (goto-char (point-min)) 2269 (goto-char (point-min))
2247 (while (re-search-forward "\\s-*{.*\n" nil t) 2270 (while (re-search-forward "\\s-*{.*\n" nil t)
2248 (replace-match " (array);\n" nil nil)))) 2271 (replace-match gdb-array-string nil nil))))
2249 (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) 2272 (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
2250 (and buf 2273 (and buf
2251 (with-current-buffer buf 2274 (with-current-buffer buf
@@ -2504,6 +2527,7 @@ Kills the gdb buffers and resets the source buffers."
2504 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) 2527 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2505 (setq gud-running nil) 2528 (setq gud-running nil)
2506 (setq gdb-active-process nil) 2529 (setq gdb-active-process nil)
2530 (setq gdb-var-list nil)
2507 (remove-hook 'after-save-hook 'gdb-create-define-alist t)) 2531 (remove-hook 'after-save-hook 'gdb-create-define-alist t))
2508 2532
2509(defun gdb-source-info () 2533(defun gdb-source-info ()