=== modified file 'lisp/progmodes/gdb-mi.el' --- lisp/progmodes/gdb-mi.el 2011-10-06 16:11:38 +0000 +++ lisp/progmodes/gdb-mi.el 2011-10-26 17:49:07 +0000 @@ -225,7 +225,7 @@ (defvar gdb-source-window nil) (defvar gdb-inferior-status nil) (defvar gdb-continuation nil) -(defvar gdb-version nil) +(defvar gdb-supports-non-stop nil) (defvar gdb-filter-output nil "Message to be shown in GUD console. @@ -585,7 +585,7 @@ (if gdb-non-stop (if (and gdb-gud-control-all-threads (not noall) - (string-equal gdb-version "7.0+")) + gdb-supports-non-stop) (concat command " --all ") (gdb-current-context-command command)) command)) @@ -860,6 +860,8 @@ (when gdb-non-stop (gdb-input (list "-gdb-set non-stop 1" 'gdb-non-stop-handler))) + (gdb-input (list "-enable-pretty-printing" 'ignore)) + ;; find source file and compilation directory here (gdb-input ; Needs GDB 6.2 onwards. @@ -878,10 +880,9 @@ (message "This version of GDB doesn't support non-stop mode. Turning it off.") (setq gdb-non-stop nil) - (setq gdb-version "pre-7.0")) - (setq gdb-version "7.0+") - (gdb-input (list "-gdb-set target-async 1" 'ignore)) - (gdb-input (list "-enable-pretty-printing" 'ignore)))) + (setq gdb-supports-non-stop nil)) + (setq gdb-supports-non-stop t) + (gdb-input (list "-gdb-set target-async 1" 'ignore)))) (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") @@ -1059,7 +1060,7 @@ (tooltip-identifier-from-point (point))))))) (set-text-properties 0 (length expr) nil expr) (gdb-input - (list (concat"-var-create - * " expr "") + (list (concat "-var-create - * " expr "") `(lambda () (gdb-var-create-handler ,expr))))))) (message "gud-watch is a no-op in this mode.")))) @@ -1687,7 +1688,7 @@ (defun gdb-current-context-command (command) "Add --thread to gdb COMMAND when needed." (if (and gdb-thread-number - (string-equal gdb-version "7.0+")) + gdb-supports-non-stop) (concat command " --thread " gdb-thread-number) command)) @@ -1971,8 +1972,8 @@ (when (not gdb-register-names) (gdb-input (list (concat "-data-list-register-names" - (if (string-equal gdb-version "7.0+") - (concat" --thread " thread-id))) + (if gdb-supports-non-stop + (concat " --thread " thread-id))) 'gdb-register-names-handler))) ;;; Don't set gud-last-frame here as it's currently done in gdb-frame-handler