diff options
| author | Nick Roberts | 2009-08-31 00:28:37 +0000 |
|---|---|---|
| committer | Nick Roberts | 2009-08-31 00:28:37 +0000 |
| commit | d50f7687ce8d054f28fc7ce86457bfffa6c8133d (patch) | |
| tree | 50e180b2da960c9f2c692719b320aa2233f43b6c | |
| parent | ab96f28bbb4f0d5614eb7e897a15b8c79e474b58 (diff) | |
| download | emacs-d50f7687ce8d054f28fc7ce86457bfffa6c8133d.tar.gz emacs-d50f7687ce8d054f28fc7ce86457bfffa6c8133d.zip | |
(gdb-control-all-threads)
(gdb-control-current-thread): Force tool bar update.
(gdb-non-stop-handler): New function.
(gdb-init-1): Use it to test if GDB version supports non-stop mode
Remove unused gdbmi buffer type.
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 1ff4aa4e33f..f3cdbc17519 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -528,12 +528,16 @@ the list) is deleted every time a new one is added (at the front)." | |||
| 528 | "Switch to non-stop/A mode." | 528 | "Switch to non-stop/A mode." |
| 529 | (interactive) | 529 | (interactive) |
| 530 | (setq gdb-gud-control-all-threads t) | 530 | (setq gdb-gud-control-all-threads t) |
| 531 | ;; Actually forcing the tool-bar to update. | ||
| 532 | (force-mode-line-update) | ||
| 531 | (message "Now in non-stop/A mode.")) | 533 | (message "Now in non-stop/A mode.")) |
| 532 | 534 | ||
| 533 | (defun gdb-control-current-thread () | 535 | (defun gdb-control-current-thread () |
| 534 | "Switch to non-stop/T mode." | 536 | "Switch to non-stop/T mode." |
| 535 | (interactive) | 537 | (interactive) |
| 536 | (setq gdb-gud-control-all-threads nil) | 538 | (setq gdb-gud-control-all-threads nil) |
| 539 | ;; Actually forcing the tool-bar to update. | ||
| 540 | (force-mode-line-update) | ||
| 537 | (message "Now in non-stop/T mode.")) | 541 | (message "Now in non-stop/T mode.")) |
| 538 | 542 | ||
| 539 | (defun gdb-find-watch-expression () | 543 | (defun gdb-find-watch-expression () |
| @@ -803,8 +807,7 @@ detailed description of this mode. | |||
| 803 | (gdb-input (list "-gdb-set height 0" 'ignore)) | 807 | (gdb-input (list "-gdb-set height 0" 'ignore)) |
| 804 | 808 | ||
| 805 | (when gdb-non-stop | 809 | (when gdb-non-stop |
| 806 | (gdb-input (list "-gdb-set non-stop 1" 'ignore)) | 810 | (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler))) |
| 807 | (gdb-input (list "-gdb-set target-async 1" 'ignore))) | ||
| 808 | 811 | ||
| 809 | ;; find source file and compilation directory here | 812 | ;; find source file and compilation directory here |
| 810 | (gdb-input | 813 | (gdb-input |
| @@ -817,6 +820,14 @@ detailed description of this mode. | |||
| 817 | (gdb-input | 820 | (gdb-input |
| 818 | (list "-gdb-show prompt" 'gdb-get-prompt))) | 821 | (list "-gdb-show prompt" 'gdb-get-prompt))) |
| 819 | 822 | ||
| 823 | (defun gdb-non-stop-handler () | ||
| 824 | (goto-char (point-min)) | ||
| 825 | (if (re-search-forward "No symbol" nil t) | ||
| 826 | (progn | ||
| 827 | (message "This version of GDB doesn't support non-stop mode. Turning it off.") | ||
| 828 | (setq gdb-non-stop nil)) | ||
| 829 | (gdb-input (list "-gdb-set target-async 1" 'ignore)))) | ||
| 830 | |||
| 820 | (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") | 831 | (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") |
| 821 | 832 | ||
| 822 | (defun gdb-create-define-alist () | 833 | (defun gdb-create-define-alist () |
| @@ -1372,9 +1383,6 @@ DOC is an optional documentation string." | |||
| 1372 | (gdb-bind-function-to-buffer trigger (current-buffer)))))))) | 1383 | (gdb-bind-function-to-buffer trigger (current-buffer)))))))) |
| 1373 | nil t)) | 1384 | nil t)) |
| 1374 | 1385 | ||
| 1375 | ;; GUD buffers are an exception to the rules | ||
| 1376 | (gdb-set-buffer-rules 'gdbmi 'error) | ||
| 1377 | |||
| 1378 | ;; Partial-output buffer : This accumulates output from a command executed on | 1386 | ;; Partial-output buffer : This accumulates output from a command executed on |
| 1379 | ;; behalf of emacs (rather than the user). | 1387 | ;; behalf of emacs (rather than the user). |
| 1380 | ;; | 1388 | ;; |
| @@ -1668,7 +1676,8 @@ If `gdb-thread-number' is nil, just wrap NAME in asterisks." | |||
| 1668 | "Only this function must be used to change `gdb-thread-number' | 1676 | "Only this function must be used to change `gdb-thread-number' |
| 1669 | value to NUMBER, because `gud-running' and `gdb-frame-number' | 1677 | value to NUMBER, because `gud-running' and `gdb-frame-number' |
| 1670 | need to be updated appropriately when current thread changes." | 1678 | need to be updated appropriately when current thread changes." |
| 1671 | (setq gdb-thread-number number) | 1679 | ;; GDB 6.8 and earlier always output thread-id="0" when stopping. |
| 1680 | (unless (string-equal number "0") (setq gdb-thread-number number)) | ||
| 1672 | (setq gdb-frame-number "0") | 1681 | (setq gdb-frame-number "0") |
| 1673 | (gdb-update-gud-running)) | 1682 | (gdb-update-gud-running)) |
| 1674 | 1683 | ||