From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Brown Newsgroups: gmane.emacs.bugs Subject: bug#9853: 24.0.90; gdb-version only set in non-stop mode Date: Wed, 26 Oct 2011 14:04:17 -0400 Message-ID: <4EA84BA1.6080706@cornell.edu> References: <4EA4964E.5040002@cornell.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050902030007020707020108" X-Trace: dough.gmane.org 1319652330 24347 80.91.229.12 (26 Oct 2011 18:05:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 26 Oct 2011 18:05:30 +0000 (UTC) To: 9853@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 26 20:05:26 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RJ7qt-0005od-TD for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Oct 2011 20:05:24 +0200 Original-Received: from localhost ([::1]:56749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ7qt-0001vw-Bx for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Oct 2011 14:05:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:44623) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ7qq-0001ve-C2 for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2011 14:05:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RJ7qo-00046B-RO for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2011 14:05:20 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:47945) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RJ7qo-000460-NL for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2011 14:05:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RJ7sT-0001mi-Tc for bug-gnu-emacs@gnu.org; Wed, 26 Oct 2011 14:07:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ken Brown Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Oct 2011 18:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 9853 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 9853-submit@debbugs.gnu.org id=B9853.13196523856813 (code B ref 9853); Wed, 26 Oct 2011 18:07:01 +0000 Original-Received: (at 9853) by debbugs.gnu.org; 26 Oct 2011 18:06:25 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RJ7rt-0001lq-CP for submit@debbugs.gnu.org; Wed, 26 Oct 2011 14:06:25 -0400 Original-Received: from granite1.mail.cornell.edu ([128.253.83.141] helo=authusersmtp.mail.cornell.edu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RJ7rp-0001lh-LW for 9853@debbugs.gnu.org; Wed, 26 Oct 2011 14:06:23 -0400 Original-Received: from [128.84.234.240] (dhcp240.math.cornell.edu [128.84.234.240]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id p9QI4bAn028308 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for <9853@debbugs.gnu.org>; Wed, 26 Oct 2011 14:04:37 -0400 (EDT) User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: <4EA4964E.5040002@cornell.edu> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 26 Oct 2011 14:07:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:53161 Archived-At: This is a multi-part message in MIME format. --------------050902030007020707020108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 10/23/2011 6:33 PM, Ken Brown wrote: > The variable gdb-version is set in the function gdb-non-stop-handler, > which is only called if gdb-non-stop is non-nil. Given that > gdb-non-stop-setting is customizable and may well be set to nil, > wouldn't it make more sense to get the version some other way? For > instance, there's a GDB/MI command -gdb-version that could be used. After looking through gdb-mi.el more carefully, I see that emacs doesn't really need to know the GDB version. So I withdraw my complaint. But I think the variable gdb-version should probably be renamed to reflect its real purpose, perhaps to gdb-supports-non-stop. > Also, the -enable-pretty-printing command is sent from > gdb-non-stop-handler and so is only sent if gdb-non-stop is non-nil. This still seems wrong, unless there's some reason that pretty-printing is only useful in non-stop mode. The attached patch implements my suggestions (and also makes a couple of whitespace changes). OK to apply? Ken --------------050902030007020707020108 Content-Type: text/plain; name="gdb-version.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="gdb-version.patch" === 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 --------------050902030007020707020108--