diff options
| author | Nick Roberts | 2009-09-23 23:22:13 +0000 |
|---|---|---|
| committer | Nick Roberts | 2009-09-23 23:22:13 +0000 |
| commit | 99f3b856f6018a93ee3c00b24a464eb46914d2f5 (patch) | |
| tree | 7a950058d2b85294f88aeb7b71e410edb5332051 | |
| parent | 9c1a45edeff23a43329bcd87905058b20f06c241 (diff) | |
| download | emacs-99f3b856f6018a93ee3c00b24a464eb46914d2f5.tar.gz emacs-99f3b856f6018a93ee3c00b24a464eb46914d2f5.zip | |
(gdb-version): New variable.
(gdb-non-stop-handler): Set gdb-version.
(gdb-gud-context-command, gdb-current-context-command, gdb-stopped):
Condition "--thread" option on gdb-version.
(gdb-invalidate-threads): Remove unused argument.
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 831c6fdb0f8..6756b7c9f30 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -218,6 +218,7 @@ Emacs can't find.") | |||
| 218 | (defvar gdb-source-window nil) | 218 | (defvar gdb-source-window nil) |
| 219 | (defvar gdb-inferior-status nil) | 219 | (defvar gdb-inferior-status nil) |
| 220 | (defvar gdb-continuation nil) | 220 | (defvar gdb-continuation nil) |
| 221 | (defvar gdb-version nil) | ||
| 221 | (defvar gdb-filter-output nil | 222 | (defvar gdb-filter-output nil |
| 222 | "Message to be shown in GUD console. | 223 | "Message to be shown in GUD console. |
| 223 | 224 | ||
| @@ -571,9 +572,10 @@ If NOALL is t, always add --thread option no matter what | |||
| 571 | When `gdb-non-stop' is nil, return COMMAND unchanged." | 572 | When `gdb-non-stop' is nil, return COMMAND unchanged." |
| 572 | (if gdb-non-stop | 573 | (if gdb-non-stop |
| 573 | (if (and gdb-gud-control-all-threads | 574 | (if (and gdb-gud-control-all-threads |
| 574 | (not noall)) | 575 | (not noall) |
| 576 | (string-equal gdb-version "7.0+")) | ||
| 575 | (concat command " --all ") | 577 | (concat command " --all ") |
| 576 | (gdb-current-context-command command t)) | 578 | (gdb-current-context-command command)) |
| 577 | command)) | 579 | command)) |
| 578 | 580 | ||
| 579 | (defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg) | 581 | (defmacro gdb-gud-context-call (cmd1 &optional cmd2 noall noarg) |
| @@ -820,7 +822,9 @@ detailed description of this mode. | |||
| 820 | (if (re-search-forward "No symbol" nil t) | 822 | (if (re-search-forward "No symbol" nil t) |
| 821 | (progn | 823 | (progn |
| 822 | (message "This version of GDB doesn't support non-stop mode. Turning it off.") | 824 | (message "This version of GDB doesn't support non-stop mode. Turning it off.") |
| 823 | (setq gdb-non-stop nil)) | 825 | (setq gdb-non-stop nil) |
| 826 | (setq gdb-version "pre-7.0")) | ||
| 827 | (setq gdb-version "7.0+") | ||
| 824 | (gdb-input (list "-gdb-set target-async 1" 'ignore)) | 828 | (gdb-input (list "-gdb-set target-async 1" 'ignore)) |
| 825 | (gdb-input (list "-enable-pretty-printing" 'ignore)))) | 829 | (gdb-input (list "-enable-pretty-printing" 'ignore)))) |
| 826 | 830 | ||
| @@ -1629,16 +1633,10 @@ static char *magick[] = { | |||
| 1629 | (concat (car item) "\n"))) | 1633 | (concat (car item) "\n"))) |
| 1630 | 1634 | ||
| 1631 | ;; NOFRAME is used for gud execution control commands | 1635 | ;; NOFRAME is used for gud execution control commands |
| 1632 | (defun gdb-current-context-command (command &optional noframe) | 1636 | (defun gdb-current-context-command (command) |
| 1633 | "Add --thread and --frame options to gdb COMMAND. | 1637 | "Add --thread to gdb COMMAND when needed." |
| 1634 | 1638 | (if (and gdb-thread-number | |
| 1635 | Option values are taken from `gdb-thread-number' and | 1639 | (string-equal gdb-version "7.0+")) |
| 1636 | `gdb-frame-number'. If `gdb-thread-number' is nil, COMMAND is | ||
| 1637 | returned unchanged. If `gdb-frame-number' is nil of NOFRAME is t, | ||
| 1638 | then no --frame option is added." | ||
| 1639 | ;; gdb-frame-number may be nil while gdb-thread-number is non-nil | ||
| 1640 | ;; (when current thread is running) | ||
| 1641 | (if gdb-thread-number | ||
| 1642 | (concat command " --thread " gdb-thread-number) | 1640 | (concat command " --thread " gdb-thread-number) |
| 1643 | command)) | 1641 | command)) |
| 1644 | 1642 | ||
| @@ -1920,7 +1918,9 @@ current thread and update GDB buffers." | |||
| 1920 | ;; thread | 1918 | ;; thread |
| 1921 | (when (not gdb-register-names) | 1919 | (when (not gdb-register-names) |
| 1922 | (gdb-input | 1920 | (gdb-input |
| 1923 | (list (concat "-data-list-register-names --thread " thread-id) | 1921 | (list (concat "-data-list-register-names" |
| 1922 | (if (string-equal gdb-version "7.0+") | ||
| 1923 | (concat" --thread " thread-id))) | ||
| 1924 | 'gdb-register-names-handler))) | 1924 | 'gdb-register-names-handler))) |
| 1925 | 1925 | ||
| 1926 | ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler | 1926 | ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler |
| @@ -2565,7 +2565,7 @@ corresponding to the mode line clicked." | |||
| 2565 | "Display GDB threads in a new frame.") | 2565 | "Display GDB threads in a new frame.") |
| 2566 | 2566 | ||
| 2567 | (def-gdb-trigger-and-handler | 2567 | (def-gdb-trigger-and-handler |
| 2568 | gdb-invalidate-threads (gdb-current-context-command "-thread-info" gud-running) | 2568 | gdb-invalidate-threads (gdb-current-context-command "-thread-info") |
| 2569 | gdb-thread-list-handler gdb-thread-list-handler-custom | 2569 | gdb-thread-list-handler gdb-thread-list-handler-custom |
| 2570 | '(start update update-threads)) | 2570 | '(start update update-threads)) |
| 2571 | 2571 | ||