Mercurial > emacs
comparison lisp/gdb-ui.el @ 48640:7bc8b0b65a02
(gdba): Use the default for gud-find-file.
(def-gdb-variable): Remove: fold into def-gdb-var.
(def-gdb-var): Use buffer-local-value and with-current-buffer.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Tue, 03 Dec 2002 21:40:47 +0000 |
parents | 00993d9b9cb7 |
children | da382393fb77 |
comparison
equal
deleted
inserted
replaced
48639:00993d9b9cb7 | 48640:7bc8b0b65a02 |
---|---|
94 `gdb-restore-windows' - to restore the layout if its lost. | 94 `gdb-restore-windows' - to restore the layout if its lost. |
95 `gdb-quit' - to delete (most) of the buffers used by gdb." | 95 `gdb-quit' - to delete (most) of the buffers used by gdb." |
96 | 96 |
97 (interactive (list (gud-query-cmdline 'gdba))) | 97 (interactive (list (gud-query-cmdline 'gdba))) |
98 | 98 |
99 (gdba-common-init command-line nil | 99 (gdba-common-init command-line nil 'gdba-marker-filter) |
100 'gdba-marker-filter 'gud-gdb-find-file) | |
101 | 100 |
102 (set (make-local-variable 'gud-minor-mode) 'gdba) | 101 (set (make-local-variable 'gud-minor-mode) 'gdba) |
103 | 102 |
104 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" "Set breakpoint at current line.") | 103 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" "Set breakpoint at current line.") |
105 (gud-def gud-run "run" nil "Run the program.") | 104 (gud-def gud-run "run" nil "Run the program.") |
291 | 290 |
292 ;;; The list of instance variables is built up by the expansions of | 291 ;;; The list of instance variables is built up by the expansions of |
293 ;;; DEF-GDB-VARIABLE | 292 ;;; DEF-GDB-VARIABLE |
294 ;;; | 293 ;;; |
295 | 294 |
296 (defmacro def-gdb-variable (name accessor setter &optional default doc) | |
297 `(progn | |
298 (defvar ,name ,default ,doc) | |
299 (if (not (memq ',name gdb-instance-variables)) | |
300 (push ',name gdb-instance-variables)) | |
301 ,(and accessor | |
302 `(defun ,accessor () | |
303 (let ((buffer (gdb-get-instance-buffer 'gdba))) | |
304 (and buffer (save-excursion | |
305 (set-buffer buffer) | |
306 ,name))))) | |
307 ,(and setter | |
308 `(defun ,setter (val) | |
309 (let ((buffer (gdb-get-instance-buffer 'gdba))) | |
310 (and buffer (save-excursion | |
311 (set-buffer buffer) | |
312 (setq ,name val)))))))) | |
313 | |
314 (defmacro def-gdb-var (root-symbol &optional default doc) | 295 (defmacro def-gdb-var (root-symbol &optional default doc) |
315 (let* ((root (symbol-name root-symbol)) | 296 (let* ((root (symbol-name root-symbol)) |
316 (accessor (intern (concat "gdb-instance-" root))) | 297 (accessor (intern (concat "gdb-instance-" root))) |
317 (setter (intern (concat "set-gdb-instance-" root))) | 298 (setter (intern (concat "set-gdb-instance-" root))) |
318 (var-name (intern (concat "gdb-" root)))) | 299 (name (intern (concat "gdb-" root)))) |
319 `(def-gdb-variable | 300 `(progn |
320 ,var-name ,accessor ,setter | 301 (defvar ,name ,default ,doc) |
321 ,default ,doc))) | 302 (if (not (memq ',name gdb-instance-variables)) |
303 (push ',name gdb-instance-variables)) | |
304 ,(and accessor | |
305 `(defun ,accessor () | |
306 (let ((buffer (gdb-get-instance-buffer 'gdba))) | |
307 (and buffer (buffer-local-value ',name buffer))))) | |
308 ,(and setter | |
309 `(defun ,setter (val) | |
310 (let ((buffer (gdb-get-instance-buffer 'gdba))) | |
311 (and buffer (with-current-buffer buffer | |
312 (setq ,name val))))))))) | |
322 | 313 |
323 (def-gdb-var buffer-type nil | 314 (def-gdb-var buffer-type nil |
324 "One of the symbols bound in gdb-instance-buffer-rules") | 315 "One of the symbols bound in gdb-instance-buffer-rules") |
325 | 316 |
326 (def-gdb-var burst "" | 317 (def-gdb-var burst "" |