Mercurial > emacs
comparison lisp/progmodes/gdb-mi.el @ 103755:a1a6e341fa6e
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
author | Dmitry Dzhus <dima@sphinx.net.ru> |
---|---|
date | Tue, 07 Jul 2009 20:10:05 +0000 |
parents | b186b013ff68 |
children | b4080ae429fb |
comparison
equal
deleted
inserted
replaced
103754:b186b013ff68 | 103755:a1a6e341fa6e |
---|---|
485 (gdb-clear-inferior-io) | 485 (gdb-clear-inferior-io) |
486 (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) | 486 (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) |
487 (gdb-input | 487 (gdb-input |
488 ;; Needs GDB 6.4 onwards | 488 ;; Needs GDB 6.4 onwards |
489 (list (concat "-inferior-tty-set " | 489 (list (concat "-inferior-tty-set " |
490 (process-tty-name (get-process "gdb-inferior")) "\n") | 490 (process-tty-name (get-process "gdb-inferior"))) |
491 'ignore))) | 491 'ignore))) |
492 (if (eq window-system 'w32) | 492 (if (eq window-system 'w32) |
493 (gdb-input (list "-gdb-set new-console off\n" 'ignore))) | 493 (gdb-input (list "-gdb-set new-console off" 'ignore))) |
494 (gdb-input (list "-gdb-set height 0\n" 'ignore)) | 494 (gdb-input (list "-gdb-set height 0" 'ignore)) |
495 ;; find source file and compilation directory here | 495 ;; find source file and compilation directory here |
496 (gdb-input | 496 (gdb-input |
497 ; Needs GDB 6.2 onwards. | 497 ; Needs GDB 6.2 onwards. |
498 (list "-file-list-exec-source-files\n" 'gdb-get-source-file-list)) | 498 (list "-file-list-exec-source-files" 'gdb-get-source-file-list)) |
499 (if gdb-create-source-file-list | 499 (if gdb-create-source-file-list |
500 (gdb-input | 500 (gdb-input |
501 ; Needs GDB 6.0 onwards. | 501 ; Needs GDB 6.0 onwards. |
502 (list "-file-list-exec-source-file\n" 'gdb-get-source-file))) | 502 (list "-file-list-exec-source-file" 'gdb-get-source-file))) |
503 (gdb-input | 503 (gdb-input |
504 (list "-data-list-register-names\n" 'gdb-get-register-names)) | 504 (list "-data-list-register-names" 'gdb-get-register-names)) |
505 (gdb-input | 505 (gdb-input |
506 (list "-gdb-show prompt\n" 'gdb-get-prompt))) | 506 (list "-gdb-show prompt" 'gdb-get-prompt))) |
507 | 507 |
508 (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") | 508 (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") |
509 | 509 |
510 (defun gdb-create-define-alist () | 510 (defun gdb-create-define-alist () |
511 "Create an alist of #define directives for GUD tooltips." | 511 "Create an alist of #define directives for GUD tooltips." |
551 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) | 551 (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) |
552 (goto-char (point-min)) | 552 (goto-char (point-min)) |
553 (if (search-forward "expands to: " nil t) | 553 (if (search-forward "expands to: " nil t) |
554 (unless (looking-at "\\S-+.*(.*).*") | 554 (unless (looking-at "\\S-+.*(.*).*") |
555 (gdb-input | 555 (gdb-input |
556 (list (concat "print " expr "\n") | 556 (list (concat "print " expr) |
557 `(lambda () (gdb-tooltip-print ,expr)))))))) | 557 `(lambda () (gdb-tooltip-print ,expr)))))))) |
558 | 558 |
559 (defun gdb-init-buffer () | 559 (defun gdb-init-buffer () |
560 (set (make-local-variable 'gud-minor-mode) 'gdbmi) | 560 (set (make-local-variable 'gud-minor-mode) 'gdbmi) |
561 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) | 561 (set (make-local-variable 'tool-bar-map) gud-tool-bar-map) |
681 (buffer-substring (region-beginning) (region-end)) | 681 (buffer-substring (region-beginning) (region-end)) |
682 (concat (if (eq major-mode 'gdb-registers-mode) "$") | 682 (concat (if (eq major-mode 'gdb-registers-mode) "$") |
683 (tooltip-identifier-from-point (point))))))) | 683 (tooltip-identifier-from-point (point))))))) |
684 (set-text-properties 0 (length expr) nil expr) | 684 (set-text-properties 0 (length expr) nil expr) |
685 (gdb-input | 685 (gdb-input |
686 (list (concat"-var-create - * " expr "\n") | 686 (list (concat"-var-create - * " expr "") |
687 `(lambda () (gdb-var-create-handler ,expr))))))) | 687 `(lambda () (gdb-var-create-handler ,expr))))))) |
688 (message "gud-watch is a no-op in this mode.")))) | 688 (message "gud-watch is a no-op in this mode.")))) |
689 | 689 |
690 (defconst gdb-var-create-regexp | 690 (defconst gdb-var-create-regexp |
691 "name=\"\\(.*?\\)\",.*numchild=\"\\(.*?\\)\",\\(?:.*value=\\(\".*\"\\),\\)?.*type=\"\\(.*?\\)\"") | 691 "name=\"\\(.*?\\)\",.*numchild=\"\\(.*?\\)\",\\(?:.*value=\\(\".*\"\\),\\)?.*type=\"\\(.*?\\)\"") |
708 (unless (string-equal | 708 (unless (string-equal |
709 speedbar-initial-expansion-list-name "GUD") | 709 speedbar-initial-expansion-list-name "GUD") |
710 (speedbar-change-initial-expansion-list "GUD")) | 710 (speedbar-change-initial-expansion-list "GUD")) |
711 (gdb-input | 711 (gdb-input |
712 (list | 712 (list |
713 (concat "-var-evaluate-expression " (car var) "\n") | 713 (concat "-var-evaluate-expression " (car var)) |
714 `(lambda () (gdb-var-evaluate-expression-handler | 714 `(lambda () (gdb-var-evaluate-expression-handler |
715 ,(car var) nil))))) | 715 ,(car var) nil))))) |
716 (message-box "No symbol \"%s\" in current context." expr))) | 716 (message-box "No symbol \"%s\" in current context." expr))) |
717 | 717 |
718 (defun gdb-speedbar-update () | 718 (defun gdb-speedbar-update () |
719 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame) | 719 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame) |
720 (not (member 'gdb-speedbar-timer gdb-pending-triggers))) | 720 (not (member 'gdb-speedbar-timer gdb-pending-triggers))) |
721 ;; Dummy command to update speedbar even when idle. | 721 ;; Dummy command to update speedbar even when idle. |
722 (gdb-input (list "-environment-pwd\n" 'gdb-speedbar-timer-fn)) | 722 (gdb-input (list "-environment-pwd" 'gdb-speedbar-timer-fn)) |
723 ;; Keep gdb-pending-triggers non-nil till end. | 723 ;; Keep gdb-pending-triggers non-nil till end. |
724 (push 'gdb-speedbar-timer gdb-pending-triggers))) | 724 (push 'gdb-speedbar-timer gdb-pending-triggers))) |
725 | 725 |
726 (defun gdb-speedbar-timer-fn () | 726 (defun gdb-speedbar-timer-fn () |
727 (if gdb-speedbar-auto-raise | 727 (if gdb-speedbar-auto-raise |
740 (gdb-speedbar-update)) | 740 (gdb-speedbar-update)) |
741 | 741 |
742 ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. | 742 ; Uses "-var-list-children --all-values". Needs GDB 6.1 onwards. |
743 (defun gdb-var-list-children (varnum) | 743 (defun gdb-var-list-children (varnum) |
744 (gdb-input | 744 (gdb-input |
745 (list (concat "-var-update " varnum "\n") 'ignore)) | 745 (list (concat "-var-update " varnum) 'ignore)) |
746 (gdb-input | 746 (gdb-input |
747 (list (concat "-var-list-children --all-values " | 747 (list (concat "-var-list-children --all-values " |
748 varnum "\n") | 748 varnum) |
749 `(lambda () (gdb-var-list-children-handler ,varnum))))) | 749 `(lambda () (gdb-var-list-children-handler ,varnum))))) |
750 | 750 |
751 (defconst gdb-var-list-children-regexp | 751 (defconst gdb-var-list-children-regexp |
752 "child={.*?name=\"\\(.+?\\)\".*?,exp=\"\\(.+?\\)\".*?,\ | 752 "child={.*?name=\"\\(.+?\\)\".*?,exp=\"\\(.+?\\)\".*?,\ |
753 numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") | 753 numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") |
777 (defun gdb-var-set-format (format) | 777 (defun gdb-var-set-format (format) |
778 "Set the output format for a variable displayed in the speedbar." | 778 "Set the output format for a variable displayed in the speedbar." |
779 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) | 779 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
780 (varnum (car var))) | 780 (varnum (car var))) |
781 (gdb-input | 781 (gdb-input |
782 (list (concat "-var-set-format " varnum " " format "\n") 'ignore)) | 782 (list (concat "-var-set-format " varnum " " format) 'ignore)) |
783 (gdb-var-update))) | 783 (gdb-var-update))) |
784 | 784 |
785 (defun gdb-var-delete-1 (varnum) | 785 (defun gdb-var-delete-1 (varnum) |
786 (gdb-input | 786 (gdb-input |
787 (list (concat "-var-delete " varnum "\n") 'ignore)) | 787 (list (concat "-var-delete " varnum) 'ignore)) |
788 (setq gdb-var-list (delq var gdb-var-list)) | 788 (setq gdb-var-list (delq var gdb-var-list)) |
789 (dolist (varchild gdb-var-list) | 789 (dolist (varchild gdb-var-list) |
790 (if (string-match (concat (car var) "\\.") (car varchild)) | 790 (if (string-match (concat (car var) "\\.") (car varchild)) |
791 (setq gdb-var-list (delq varchild gdb-var-list))))) | 791 (setq gdb-var-list (delq varchild gdb-var-list))))) |
792 | 792 |
802 (gdb-var-delete-1 varnum))))) | 802 (gdb-var-delete-1 varnum))))) |
803 | 803 |
804 (defun gdb-var-delete-children (varnum) | 804 (defun gdb-var-delete-children (varnum) |
805 "Delete children of variable object at point from the speedbar." | 805 "Delete children of variable object at point from the speedbar." |
806 (gdb-input | 806 (gdb-input |
807 (list (concat "-var-delete -c " varnum "\n") 'ignore))) | 807 (list (concat "-var-delete -c " varnum) 'ignore))) |
808 | 808 |
809 (defun gdb-edit-value (text token indent) | 809 (defun gdb-edit-value (text token indent) |
810 "Assign a value to a variable displayed in the speedbar." | 810 "Assign a value to a variable displayed in the speedbar." |
811 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) | 811 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) |
812 (varnum (car var)) (value)) | 812 (varnum (car var)) (value)) |
813 (setq value (read-string "New value: ")) | 813 (setq value (read-string "New value: ")) |
814 (gdb-input | 814 (gdb-input |
815 (list (concat "-var-assign " varnum " " value "\n") | 815 (list (concat "-var-assign " varnum " " value) |
816 `(lambda () (gdb-edit-value-handler ,value)))))) | 816 `(lambda () (gdb-edit-value-handler ,value)))))) |
817 | 817 |
818 (defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)") | 818 (defconst gdb-error-regexp "\\^error,msg=\\(\".+\"\\)") |
819 | 819 |
820 (defun gdb-edit-value-handler (value) | 820 (defun gdb-edit-value-handler (value) |
824 | 824 |
825 ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. | 825 ; Uses "-var-update --all-values". Needs GDB 6.4 onwards. |
826 (defun gdb-var-update () | 826 (defun gdb-var-update () |
827 (if (not (member 'gdb-var-update gdb-pending-triggers)) | 827 (if (not (member 'gdb-var-update gdb-pending-triggers)) |
828 (gdb-input | 828 (gdb-input |
829 (list "-var-update --all-values *\n" 'gdb-var-update-handler))) | 829 (list "-var-update --all-values *" 'gdb-var-update-handler))) |
830 (push 'gdb-var-update gdb-pending-triggers)) | 830 (push 'gdb-var-update gdb-pending-triggers)) |
831 | 831 |
832 (defconst gdb-var-update-regexp | 832 (defconst gdb-var-update-regexp |
833 "{.*?name=\"\\(.*?\\)\".*?,\\(?:value=\\(\".*?\"\\),\\)?.*?\ | 833 "{.*?name=\"\\(.*?\\)\".*?,\\(?:value=\\(\".*?\"\\),\\)?.*?\ |
834 in_scope=\"\\(.*?\\)\".*?}") | 834 in_scope=\"\\(.*?\\)\".*?}") |
1191 (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log)) | 1191 (if gdb-enable-debug (push (cons 'send-item item) gdb-debug-log)) |
1192 (setq gdb-token-number (1+ gdb-token-number)) | 1192 (setq gdb-token-number (1+ gdb-token-number)) |
1193 (setcar item (concat (number-to-string gdb-token-number) (car item))) | 1193 (setcar item (concat (number-to-string gdb-token-number) (car item))) |
1194 (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist) | 1194 (push (cons gdb-token-number (car (cdr item))) gdb-handler-alist) |
1195 (process-send-string (get-buffer-process gud-comint-buffer) | 1195 (process-send-string (get-buffer-process gud-comint-buffer) |
1196 (car item))) | 1196 (concat (car item) "\n"))) |
1197 | 1197 |
1198 | 1198 |
1199 (defcustom gud-gdb-command-name "gdb -i=mi" | 1199 (defcustom gud-gdb-command-name "gdb -i=mi" |
1200 "Default command to execute an executable under the GDB debugger." | 1200 "Default command to execute an executable under the GDB debugger." |
1201 :type 'string | 1201 :type 'string |
1535 (gdb-set-buffer-rules 'gdb-breakpoints-buffer | 1535 (gdb-set-buffer-rules 'gdb-breakpoints-buffer |
1536 'gdb-breakpoints-buffer-name | 1536 'gdb-breakpoints-buffer-name |
1537 'gdb-breakpoints-mode) | 1537 'gdb-breakpoints-mode) |
1538 | 1538 |
1539 (def-gdb-auto-updated-buffer gdb-breakpoints-buffer | 1539 (def-gdb-auto-updated-buffer gdb-breakpoints-buffer |
1540 gdb-invalidate-breakpoints "-break-list\n" | 1540 gdb-invalidate-breakpoints "-break-list" |
1541 gdb-breakpoints-list-handler gdb-breakpoints-list-handler-custom) | 1541 gdb-breakpoints-list-handler gdb-breakpoints-list-handler-custom) |
1542 | 1542 |
1543 (defun gdb-breakpoints-list-handler-custom () | 1543 (defun gdb-breakpoints-list-handler-custom () |
1544 (setq gdb-pending-triggers (delq 'gdb-invalidate-breakpoints | 1544 (setq gdb-pending-triggers (delq 'gdb-invalidate-breakpoints |
1545 gdb-pending-triggers)) | 1545 gdb-pending-triggers)) |
1605 ;; Only want one breakpoint icon at each location. | 1605 ;; Only want one breakpoint icon at each location. |
1606 (save-excursion | 1606 (save-excursion |
1607 (goto-line (string-to-number line)) | 1607 (goto-line (string-to-number line)) |
1608 (gdb-put-breakpoint-icon (string-equal flag "y") bptno))) | 1608 (gdb-put-breakpoint-icon (string-equal flag "y") bptno))) |
1609 (gdb-input | 1609 (gdb-input |
1610 (list (concat "list " file ":1\n") | 1610 (list (concat "list " file ":1") |
1611 'ignore)) | 1611 'ignore)) |
1612 (gdb-input | 1612 (gdb-input |
1613 (list "-file-list-exec-source-file\n" | 1613 (list "-file-list-exec-source-file" |
1614 `(lambda () (gdb-get-location | 1614 `(lambda () (gdb-get-location |
1615 ,bptno ,line ,flag))))))))))) | 1615 ,bptno ,line ,flag))))))))))) |
1616 | 1616 |
1617 (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") | 1617 (defvar gdb-source-file-regexp "fullname=\"\\(.*?\\)\"") |
1618 | 1618 |
1689 (concat | 1689 (concat |
1690 (if (get-text-property | 1690 (if (get-text-property |
1691 0 'gdb-enabled (car (posn-string posn))) | 1691 0 'gdb-enabled (car (posn-string posn))) |
1692 "-break-disable " | 1692 "-break-disable " |
1693 "-break-enable ") | 1693 "-break-enable ") |
1694 bptno "\n"))))))))) | 1694 bptno))))))))) |
1695 | 1695 |
1696 (defun gdb-mouse-toggle-breakpoint-fringe (event) | 1696 (defun gdb-mouse-toggle-breakpoint-fringe (event) |
1697 "Enable/disable breakpoint in left fringe with mouse click." | 1697 "Enable/disable breakpoint in left fringe with mouse click." |
1698 (interactive "e") | 1698 (interactive "e") |
1699 (mouse-minibuffer-check event) | 1699 (mouse-minibuffer-check event) |
1712 (gud-basic-call | 1712 (gud-basic-call |
1713 (concat | 1713 (concat |
1714 (if (get-text-property 0 'gdb-enabled obj) | 1714 (if (get-text-property 0 'gdb-enabled obj) |
1715 "-break-disable " | 1715 "-break-disable " |
1716 "-break-enable ") | 1716 "-break-enable ") |
1717 (get-text-property 0 'gdb-bptno obj) "\n")))))))) | 1717 (get-text-property 0 'gdb-bptno obj))))))))) |
1718 | 1718 |
1719 (defun gdb-breakpoints-buffer-name () | 1719 (defun gdb-breakpoints-buffer-name () |
1720 (with-current-buffer gud-comint-buffer | 1720 (with-current-buffer gud-comint-buffer |
1721 (concat "*breakpoints of " (gdb-get-target-string) "*"))) | 1721 (concat "*breakpoints of " (gdb-get-target-string) "*"))) |
1722 | 1722 |
1806 (gdb-set-buffer-rules 'gdb-threads-buffer | 1806 (gdb-set-buffer-rules 'gdb-threads-buffer |
1807 'gdb-threads-buffer-name | 1807 'gdb-threads-buffer-name |
1808 'gdb-threads-mode) | 1808 'gdb-threads-mode) |
1809 | 1809 |
1810 (def-gdb-auto-updated-buffer gdb-threads-buffer | 1810 (def-gdb-auto-updated-buffer gdb-threads-buffer |
1811 gdb-invalidate-threads "-thread-info\n" | 1811 gdb-invalidate-threads "-thread-info" |
1812 gdb-thread-list-handler gdb-thread-list-handler-custom) | 1812 gdb-thread-list-handler gdb-thread-list-handler-custom) |
1813 | 1813 |
1814 | 1814 |
1815 (defvar gdb-threads-font-lock-keywords | 1815 (defvar gdb-threads-font-lock-keywords |
1816 '(("in \\([^ ]+\\) (" (1 font-lock-function-name-face)) | 1816 '(("in \\([^ ]+\\) (" (1 font-lock-function-name-face)) |
1893 'gdb-memory-buffer-name | 1893 'gdb-memory-buffer-name |
1894 'gdb-memory-mode) | 1894 'gdb-memory-mode) |
1895 | 1895 |
1896 (def-gdb-auto-updated-buffer gdb-memory-buffer | 1896 (def-gdb-auto-updated-buffer gdb-memory-buffer |
1897 gdb-invalidate-memory | 1897 gdb-invalidate-memory |
1898 (format "-data-read-memory %s %s %d %d %d\n" | 1898 (format "-data-read-memory %s %s %d %d %d" |
1899 gdb-memory-address | 1899 gdb-memory-address |
1900 gdb-memory-format | 1900 gdb-memory-format |
1901 gdb-memory-unit | 1901 gdb-memory-unit |
1902 gdb-memory-rows | 1902 gdb-memory-rows |
1903 gdb-memory-columns) | 1903 gdb-memory-columns) |
2281 (def-gdb-auto-update-trigger gdb-invalidate-disassembly | 2281 (def-gdb-auto-update-trigger gdb-invalidate-disassembly |
2282 (gdb-get-buffer 'gdb-disassembly-buffer) | 2282 (gdb-get-buffer 'gdb-disassembly-buffer) |
2283 (let ((file (or gdb-selected-file gdb-main-file)) | 2283 (let ((file (or gdb-selected-file gdb-main-file)) |
2284 (line (or gdb-selected-line 1))) | 2284 (line (or gdb-selected-line 1))) |
2285 (if (not file) (error "Disassembly invalidated with no file selected.") | 2285 (if (not file) (error "Disassembly invalidated with no file selected.") |
2286 (format "-data-disassemble -f %s -l %d -n -1 -- 0\n" file line))) | 2286 (format "-data-disassemble -f %s -l %d -n -1 -- 0" file line))) |
2287 gdb-disassembly-handler) | 2287 gdb-disassembly-handler) |
2288 | 2288 |
2289 (def-gdb-auto-update-handler | 2289 (def-gdb-auto-update-handler |
2290 gdb-disassembly-handler | 2290 gdb-disassembly-handler |
2291 gdb-invalidate-disassembly | 2291 gdb-invalidate-disassembly |
2479 'gdb-stack-buffer-name | 2479 'gdb-stack-buffer-name |
2480 'gdb-frames-mode) | 2480 'gdb-frames-mode) |
2481 | 2481 |
2482 (def-gdb-auto-updated-buffer gdb-stack-buffer | 2482 (def-gdb-auto-updated-buffer gdb-stack-buffer |
2483 gdb-invalidate-frames | 2483 gdb-invalidate-frames |
2484 "-stack-list-frames\n" | 2484 "-stack-list-frames" |
2485 gdb-stack-list-frames-handler | 2485 gdb-stack-list-frames-handler |
2486 gdb-stack-list-frames-custom) | 2486 gdb-stack-list-frames-custom) |
2487 | 2487 |
2488 (defun gdb-insert-frame-location (frame) | 2488 (defun gdb-insert-frame-location (frame) |
2489 "Insert \"of file:line\" button or library name for structure FRAME. | 2489 "Insert \"of file:line\" button or library name for structure FRAME. |
2593 'gdb-locals-buffer-name | 2593 'gdb-locals-buffer-name |
2594 'gdb-locals-mode) | 2594 'gdb-locals-mode) |
2595 | 2595 |
2596 (def-gdb-auto-update-trigger gdb-invalidate-locals | 2596 (def-gdb-auto-update-trigger gdb-invalidate-locals |
2597 (gdb-get-buffer 'gdb-locals-buffer) | 2597 (gdb-get-buffer 'gdb-locals-buffer) |
2598 "-stack-list-locals --simple-values\n" | 2598 "-stack-list-locals --simple-values" |
2599 gdb-stack-list-locals-handler) | 2599 gdb-stack-list-locals-handler) |
2600 | 2600 |
2601 (defconst gdb-stack-list-locals-regexp | 2601 (defconst gdb-stack-list-locals-regexp |
2602 (concat "name=\"\\(.*?\\)\",type=\"\\(.*?\\)\"")) | 2602 (concat "name=\"\\(.*?\\)\",type=\"\\(.*?\\)\"")) |
2603 | 2603 |
2744 'gdb-registers-buffer-name | 2744 'gdb-registers-buffer-name |
2745 'gdb-registers-mode) | 2745 'gdb-registers-mode) |
2746 | 2746 |
2747 (def-gdb-auto-update-trigger gdb-invalidate-registers | 2747 (def-gdb-auto-update-trigger gdb-invalidate-registers |
2748 (gdb-get-buffer 'gdb-registers-buffer) | 2748 (gdb-get-buffer 'gdb-registers-buffer) |
2749 "-data-list-register-values x\n" | 2749 "-data-list-register-values x" |
2750 gdb-data-list-register-values-handler) | 2750 gdb-data-list-register-values-handler) |
2751 | 2751 |
2752 (defconst gdb-data-list-register-values-regexp | 2752 (defconst gdb-data-list-register-values-regexp |
2753 "number=\"\\(.*?\\)\",value=\"\\(.*?\\)\"") | 2753 "number=\"\\(.*?\\)\",value=\"\\(.*?\\)\"") |
2754 | 2754 |
2838 (if (and (gdb-get-buffer 'gdb-registers-buffer) | 2838 (if (and (gdb-get-buffer 'gdb-registers-buffer) |
2839 (not (member 'gdb-get-changed-registers gdb-pending-triggers))) | 2839 (not (member 'gdb-get-changed-registers gdb-pending-triggers))) |
2840 (progn | 2840 (progn |
2841 (gdb-input | 2841 (gdb-input |
2842 (list | 2842 (list |
2843 "-data-list-changed-registers\n" | 2843 "-data-list-changed-registers" |
2844 'gdb-get-changed-registers-handler)) | 2844 'gdb-get-changed-registers-handler)) |
2845 (push 'gdb-get-changed-registers gdb-pending-triggers)))) | 2845 (push 'gdb-get-changed-registers gdb-pending-triggers)))) |
2846 | 2846 |
2847 (defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"") | 2847 (defconst gdb-data-list-register-names-regexp "\"\\(.*?\\)\"") |
2848 | 2848 |
2878 | 2878 |
2879 (defun gdb-get-selected-frame () | 2879 (defun gdb-get-selected-frame () |
2880 (if (not (member 'gdb-get-selected-frame gdb-pending-triggers)) | 2880 (if (not (member 'gdb-get-selected-frame gdb-pending-triggers)) |
2881 (progn | 2881 (progn |
2882 (gdb-input | 2882 (gdb-input |
2883 (list "-stack-info-frame\n" 'gdb-frame-handler)) | 2883 (list "-stack-info-frame" 'gdb-frame-handler)) |
2884 (push 'gdb-get-selected-frame | 2884 (push 'gdb-get-selected-frame |
2885 gdb-pending-triggers)))) | 2885 gdb-pending-triggers)))) |
2886 | 2886 |
2887 (defun gdb-frame-handler () | 2887 (defun gdb-frame-handler () |
2888 (setq gdb-pending-triggers | 2888 (setq gdb-pending-triggers |