diff options
| author | Dmitry Dzhus | 2009-07-07 20:10:05 +0000 |
|---|---|---|
| committer | Dmitry Dzhus | 2009-07-07 20:10:05 +0000 |
| commit | 69a197a214dbb33415af772dc87b5e8ae3f553f2 (patch) | |
| tree | d812808f2e32de7d61b81cbb668fb99f60935462 | |
| parent | e7006f272c47da3f26df519d6b8b90bd6da68c3c (diff) | |
| download | emacs-69a197a214dbb33415af772dc87b5e8ae3f553f2.tar.gz emacs-69a197a214dbb33415af772dc87b5e8ae3f553f2.zip | |
* progmodes/gdb-mi.el (gdb-input): Add trailing newline to command.
| -rw-r--r-- | lisp/ChangeLog | 1 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 64 |
2 files changed, 33 insertions, 32 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 39b56a54c7f..4edccce0719 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | (gdb-stack-list-frames-handler): Rewritten without regexps. | 17 | (gdb-stack-list-frames-handler): Rewritten without regexps. |
| 18 | (gdb-breakpoints-list-handler-custom): y/n instead of on/off; do | 18 | (gdb-breakpoints-list-handler-custom): y/n instead of on/off; do |
| 19 | not highlight breakpoints without line information. | 19 | not highlight breakpoints without line information. |
| 20 | (gdb-input): Add trailing newline to command. | ||
| 20 | 21 | ||
| 21 | * progmodes/gdb-mi.el (gdb-init-1): Set mode name for disassembly | 22 | * progmodes/gdb-mi.el (gdb-init-1): Set mode name for disassembly |
| 22 | buffer properly. | 23 | buffer properly. |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index ae5f135c2a9..d9abe26ceea 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -487,23 +487,23 @@ detailed description of this mode. | |||
| 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 | ||
| @@ -553,7 +553,7 @@ detailed description of this mode. | |||
| 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 () |
| @@ -683,7 +683,7 @@ With arg, enter name of variable to be watched in the minibuffer." | |||
| 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 | ||
| @@ -710,7 +710,7 @@ With arg, enter name of variable to be watched in the minibuffer." | |||
| 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))) |
| @@ -719,7 +719,7 @@ With arg, enter name of variable to be watched in the minibuffer." | |||
| 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 | ||
| @@ -742,10 +742,10 @@ With arg, enter name of variable to be watched in the minibuffer." | |||
| 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 |
| @@ -779,12 +779,12 @@ numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") | |||
| 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)) |
| @@ -804,7 +804,7 @@ numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") | |||
| 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." |
| @@ -812,7 +812,7 @@ numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") | |||
| 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=\\(\".+\"\\)") |
| @@ -826,7 +826,7 @@ numchild=\"\\(.+?\\)\".*?,value=\\(\".*?\"\\).*?,type=\"\\(.+?\\)\".*?}") | |||
| 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 |
| @@ -1193,7 +1193,7 @@ static char *magick[] = { | |||
| 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" |
| @@ -1537,7 +1537,7 @@ OUTPUT-HANDLER-NAME handler uses customization of CUSTOM-DEFUN." | |||
| 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 () |
| @@ -1607,10 +1607,10 @@ OUTPUT-HANDLER-NAME handler uses customization of CUSTOM-DEFUN." | |||
| 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 | ||
| @@ -1691,7 +1691,7 @@ If not in a source or disassembly buffer just set point." | |||
| 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." |
| @@ -1714,7 +1714,7 @@ If not in a source or disassembly buffer just set point." | |||
| 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 |
| @@ -1808,7 +1808,7 @@ FILE is a full path." | |||
| 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 | ||
| @@ -1895,7 +1895,7 @@ FILE is a full path." | |||
| 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 |
| @@ -2283,7 +2283,7 @@ corresponding to the mode line clicked." | |||
| 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 |
| @@ -2481,7 +2481,7 @@ breakpoints buffer." | |||
| 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 | ||
| @@ -2595,7 +2595,7 @@ member." | |||
| 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 |
| @@ -2746,7 +2746,7 @@ member." | |||
| 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 |
| @@ -2840,7 +2840,7 @@ member." | |||
| 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 | ||
| @@ -2880,7 +2880,7 @@ is set in them." | |||
| 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 | ||