diff options
| author | Ken Brown | 2011-11-29 22:18:33 -0500 |
|---|---|---|
| committer | Ken Brown | 2011-11-29 22:18:33 -0500 |
| commit | 087ef505f2853594c8f9c2756e7d31097d82c081 (patch) | |
| tree | 192584570170d20660f674bd205c6551d6c1fa5a /lisp | |
| parent | df103ffb3d10eef57921c9d70c6e3eac35759b73 (diff) | |
| download | emacs-087ef505f2853594c8f9c2756e7d31097d82c081.tar.gz emacs-087ef505f2853594c8f9c2756e7d31097d82c081.zip | |
Fix gdb-mi.el bug#9853, bug#9858, and bug#9878.
* lisp/progmodes/gdb-mi.el (gdb-version): Remove defvar.
(gdb-supports-non-stop): New defvar, replacing `gdb-version'.
(gdb-gud-context-command, gdb-non-stop-handler)
(gdb-current-context-command, gdb-stopped): Use it.
(gdb-init-1): Enable pretty printing here.
(gdb-non-stop-handler): Don't enable pretty-printing here. Check
to see if the target supports non-stop mode; if not, turn off
non-stop mode. Use the following.
(gdb-check-target-async): New defun.
(gud-watch, gdb-stopped): Fix whitespace.
(gdb-get-source-file): Don't try to display the source file if
`gdb-main-file' is nil.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 30 |
2 files changed, 36 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c827a9d3835..f9f53ce91ab 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,19 @@ | |||
| 1 | 2011-11-29 Ken Brown <kbrown@cornell.edu> | ||
| 2 | |||
| 3 | * progmodes/gdb-mi.el: Fix bug#9853, bug#9858, and bug#9878. | ||
| 4 | (gdb-version): Remove defvar. | ||
| 5 | (gdb-supports-non-stop): New defvar, replacing `gdb-version'. | ||
| 6 | (gdb-gud-context-command, gdb-non-stop-handler) | ||
| 7 | (gdb-current-context-command, gdb-stopped): Use it. | ||
| 8 | (gdb-init-1): Enable pretty printing here. | ||
| 9 | (gdb-non-stop-handler): Don't enable pretty-printing here. Check | ||
| 10 | to see if the target supports non-stop mode; if not, turn off | ||
| 11 | non-stop mode. Use the following. | ||
| 12 | (gdb-check-target-async): New defun. | ||
| 13 | (gud-watch, gdb-stopped): Fix whitespace. | ||
| 14 | (gdb-get-source-file): Don't try to display the source file if | ||
| 15 | `gdb-main-file' is nil. | ||
| 16 | |||
| 1 | 2011-11-29 Stefan Monnier <monnier@iro.umontreal.ca> | 17 | 2011-11-29 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 18 | ||
| 3 | * align.el: Try to generate fewer markers (bug#10047). | 19 | * align.el: Try to generate fewer markers (bug#10047). |
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index ba3f938d718..ab40dff24f1 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -214,7 +214,7 @@ Emacs can't find.") | |||
| 214 | (defvar gdb-source-window nil) | 214 | (defvar gdb-source-window nil) |
| 215 | (defvar gdb-inferior-status nil) | 215 | (defvar gdb-inferior-status nil) |
| 216 | (defvar gdb-continuation nil) | 216 | (defvar gdb-continuation nil) |
| 217 | (defvar gdb-version nil) | 217 | (defvar gdb-supports-non-stop nil) |
| 218 | (defvar gdb-filter-output nil | 218 | (defvar gdb-filter-output nil |
| 219 | "Message to be shown in GUD console. | 219 | "Message to be shown in GUD console. |
| 220 | 220 | ||
| @@ -574,7 +574,7 @@ When `gdb-non-stop' is nil, return COMMAND unchanged." | |||
| 574 | (if gdb-non-stop | 574 | (if gdb-non-stop |
| 575 | (if (and gdb-gud-control-all-threads | 575 | (if (and gdb-gud-control-all-threads |
| 576 | (not noall) | 576 | (not noall) |
| 577 | (string-equal gdb-version "7.0+")) | 577 | gdb-supports-non-stop) |
| 578 | (concat command " --all ") | 578 | (concat command " --all ") |
| 579 | (gdb-current-context-command command)) | 579 | (gdb-current-context-command command)) |
| 580 | command)) | 580 | command)) |
| @@ -872,6 +872,8 @@ detailed description of this mode. | |||
| 872 | (when gdb-non-stop | 872 | (when gdb-non-stop |
| 873 | (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler))) | 873 | (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler))) |
| 874 | 874 | ||
| 875 | (gdb-input (list "-enable-pretty-printing" 'ignore)) | ||
| 876 | |||
| 875 | ;; find source file and compilation directory here | 877 | ;; find source file and compilation directory here |
| 876 | (if gdb-create-source-file-list | 878 | (if gdb-create-source-file-list |
| 877 | (gdb-input | 879 | (gdb-input |
| @@ -890,10 +892,18 @@ detailed description of this mode. | |||
| 890 | (message | 892 | (message |
| 891 | "This version of GDB doesn't support non-stop mode. Turning it off.") | 893 | "This version of GDB doesn't support non-stop mode. Turning it off.") |
| 892 | (setq gdb-non-stop nil) | 894 | (setq gdb-non-stop nil) |
| 893 | (setq gdb-version "pre-7.0")) | 895 | (setq gdb-supports-non-stop nil)) |
| 894 | (setq gdb-version "7.0+") | 896 | (setq gdb-supports-non-stop t) |
| 895 | (gdb-input (list "-gdb-set target-async 1" 'ignore)) | 897 | (gdb-input (list "-gdb-set target-async 1" 'ignore)) |
| 896 | (gdb-input (list "-enable-pretty-printing" 'ignore)))) | 898 | (gdb-input (list "-list-target-features" 'gdb-check-target-async)))) |
| 899 | |||
| 900 | (defun gdb-check-target-async () | ||
| 901 | (goto-char (point-min)) | ||
| 902 | (unless (re-search-forward "async" nil t) | ||
| 903 | (message | ||
| 904 | "Target doesn't support non-stop mode. Turning it off.") | ||
| 905 | (setq gdb-non-stop nil) | ||
| 906 | (gdb-input (list "-gdb-set non-stop 0" 'ignore)))) | ||
| 897 | 907 | ||
| 898 | (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") | 908 | (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") |
| 899 | 909 | ||
| @@ -1071,7 +1081,7 @@ With arg, enter name of variable to be watched in the minibuffer." | |||
| 1071 | (tooltip-identifier-from-point (point))))))) | 1081 | (tooltip-identifier-from-point (point))))))) |
| 1072 | (set-text-properties 0 (length expr) nil expr) | 1082 | (set-text-properties 0 (length expr) nil expr) |
| 1073 | (gdb-input | 1083 | (gdb-input |
| 1074 | (list (concat"-var-create - * " expr "") | 1084 | (list (concat "-var-create - * " expr "") |
| 1075 | `(lambda () (gdb-var-create-handler ,expr))))))) | 1085 | `(lambda () (gdb-var-create-handler ,expr))))))) |
| 1076 | (message "gud-watch is a no-op in this mode.")))) | 1086 | (message "gud-watch is a no-op in this mode.")))) |
| 1077 | 1087 | ||
| @@ -1699,7 +1709,7 @@ static char *magick[] = { | |||
| 1699 | (defun gdb-current-context-command (command) | 1709 | (defun gdb-current-context-command (command) |
| 1700 | "Add --thread to gdb COMMAND when needed." | 1710 | "Add --thread to gdb COMMAND when needed." |
| 1701 | (if (and gdb-thread-number | 1711 | (if (and gdb-thread-number |
| 1702 | (string-equal gdb-version "7.0+")) | 1712 | gdb-supports-non-stop) |
| 1703 | (concat command " --thread " gdb-thread-number) | 1713 | (concat command " --thread " gdb-thread-number) |
| 1704 | command)) | 1714 | command)) |
| 1705 | 1715 | ||
| @@ -1983,8 +1993,8 @@ current thread and update GDB buffers." | |||
| 1983 | (when (not gdb-register-names) | 1993 | (when (not gdb-register-names) |
| 1984 | (gdb-input | 1994 | (gdb-input |
| 1985 | (list (concat "-data-list-register-names" | 1995 | (list (concat "-data-list-register-names" |
| 1986 | (if (string-equal gdb-version "7.0+") | 1996 | (if gdb-supports-non-stop |
| 1987 | (concat" --thread " thread-id))) | 1997 | (concat " --thread " thread-id))) |
| 1988 | 'gdb-register-names-handler))) | 1998 | 'gdb-register-names-handler))) |
| 1989 | 1999 | ||
| 1990 | ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler | 2000 | ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler |
| @@ -4133,7 +4143,7 @@ buffers, if required." | |||
| 4133 | (if gdb-many-windows | 4143 | (if gdb-many-windows |
| 4134 | (gdb-setup-windows) | 4144 | (gdb-setup-windows) |
| 4135 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) | 4145 | (gdb-get-buffer-create 'gdb-breakpoints-buffer) |
| 4136 | (if gdb-show-main | 4146 | (if (and gdb-show-main gdb-main-file) |
| 4137 | (let ((pop-up-windows t)) | 4147 | (let ((pop-up-windows t)) |
| 4138 | (display-buffer (gud-find-file gdb-main-file)))))) | 4148 | (display-buffer (gud-find-file gdb-main-file)))))) |
| 4139 | 4149 | ||