Mercurial > emacs
comparison lisp/progmodes/gdb-mi.el @ 104213:8642d488076f
(gdb-gud-context-call): Does not need to be a macro.
(gdb-registers-handler-custom): Do not fail when register names
are unavailable.
author | Dmitry Dzhus <dima@sphinx.net.ru> |
---|---|
date | Sun, 09 Aug 2009 00:17:01 +0000 |
parents | c911628739b9 |
children | 23230e6cbc19 |
comparison
equal
deleted
inserted
replaced
104212:28307c643e9f | 104213:8642d488076f |
---|---|
564 (concat command " --all ") | 564 (concat command " --all ") |
565 (gdb-current-context-command command t)) | 565 (gdb-current-context-command command t)) |
566 command)) | 566 command)) |
567 | 567 |
568 ;; TODO Document this. We use noarg when not in gud-def | 568 ;; TODO Document this. We use noarg when not in gud-def |
569 (defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg) | 569 (defun gdb-gud-context-call (cmd1 &optional cmd2 noall noarg) |
570 `(gud-call | 570 (gud-call |
571 (concat | 571 (concat |
572 (gdb-gud-context-command ,cmd1 ,noall) | 572 (gdb-gud-context-command cmd1 noall) |
573 ,cmd2) ,(when (not noarg) 'arg))) | 573 cmd2) (when (not noarg) 'arg))) |
574 | 574 |
575 ;;;###autoload | 575 ;;;###autoload |
576 (defun gdb (command-line) | 576 (defun gdb (command-line) |
577 "Run gdb on program FILE in buffer *gud-FILE*. | 577 "Run gdb on program FILE in buffer *gud-FILE*. |
578 The directory containing FILE becomes the initial working directory | 578 The directory containing FILE becomes the initial working directory |
3548 (dolist (register register-values) | 3548 (dolist (register register-values) |
3549 (let* ((register-number (gdb-get-field register 'number)) | 3549 (let* ((register-number (gdb-get-field register 'number)) |
3550 (value (gdb-get-field register 'value)) | 3550 (value (gdb-get-field register 'value)) |
3551 (register-name (nth (string-to-number register-number) | 3551 (register-name (nth (string-to-number register-number) |
3552 gdb-register-names))) | 3552 gdb-register-names))) |
3553 (when register-name | |
3553 (gdb-table-add-row | 3554 (gdb-table-add-row |
3554 table | 3555 table |
3555 (list | 3556 (list |
3556 (propertize register-name 'font-lock-face font-lock-variable-name-face) | 3557 (propertize register-name 'font-lock-face font-lock-variable-name-face) |
3557 (if (member register-number gdb-changed-registers) | 3558 (if (member register-number gdb-changed-registers) |
3558 (propertize value 'font-lock-face font-lock-warning-face) | 3559 (propertize value 'font-lock-face font-lock-warning-face) |
3559 value)) | 3560 value)) |
3560 `(mouse-face highlight | 3561 `(mouse-face highlight |
3561 help-echo "mouse-2: edit value" | 3562 help-echo "mouse-2: edit value" |
3562 gdb-register-name ,register-name)))) | 3563 gdb-register-name ,register-name))))) |
3563 (insert (gdb-table-string table " ")) | 3564 (insert (gdb-table-string table " ")) |
3564 (setq mode-name | 3565 (setq mode-name |
3565 (gdb-current-context-mode-name "Registers")))) | 3566 (gdb-current-context-mode-name "Registers")))) |
3566 | 3567 |
3567 (defun gdb-edit-register-value (&optional event) | 3568 (defun gdb-edit-register-value (&optional event) |