From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#21438: 25.0.50; GUD locals frame/window doesn't shows struct values as nil Date: Wed, 09 Sep 2015 17:14:24 +0300 Message-ID: <83twr365of.fsf@gnu.org> References: <877fo0cem6.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1441819910 22470 80.91.229.3 (9 Sep 2015 17:31:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2015 17:31:50 +0000 (UTC) Cc: 21438@debbugs.gnu.org To: Tassilo Horn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Sep 09 19:31:38 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZZjDc-0004XB-7x for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Sep 2015 19:31:36 +0200 Original-Received: from localhost ([::1]:44196 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZjDb-00030N-0H for geb-bug-gnu-emacs@m.gmane.org; Wed, 09 Sep 2015 13:31:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZg9V-0003yk-UK for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 10:15:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZg9Q-0008O8-60 for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 10:15:09 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:33412) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZg9Q-0008Nj-35 for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 10:15:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZZg9P-0004KN-3b for bug-gnu-emacs@gnu.org; Wed, 09 Sep 2015 10:15:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Sep 2015 14:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21438 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21438-submit@debbugs.gnu.org id=B21438.144180807216588 (code B ref 21438); Wed, 09 Sep 2015 14:15:02 +0000 Original-Received: (at 21438) by debbugs.gnu.org; 9 Sep 2015 14:14:32 +0000 Original-Received: from localhost ([127.0.0.1]:53855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZg8u-0004JU-26 for submit@debbugs.gnu.org; Wed, 09 Sep 2015 10:14:32 -0400 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:40422) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZZg8r-0004JL-BS for 21438@debbugs.gnu.org; Wed, 09 Sep 2015 10:14:30 -0400 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NUE00A00Y39YJ00@a-mtaout20.012.net.il> for 21438@debbugs.gnu.org; Wed, 09 Sep 2015 17:14:28 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NUE00ALQY83MA70@a-mtaout20.012.net.il>; Wed, 09 Sep 2015 17:14:28 +0300 (IDT) In-reply-to: <877fo0cem6.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.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:106313 Archived-At: > From: Tassilo Horn > Date: Wed, 09 Sep 2015 08:04:49 +0200 > > stepping till the end of the function, this is the contents of the > locals buffer shows: > > --8<---------------cut here---------------start------------->8--- > struct it it nil > struct text_pos pt nil > struct window * w 0x12a1d40 > struct buffer * old_buffer 0x0 > Lisp_Object result 58 > --8<---------------cut here---------------end--------------->8--- > > But it and pt cannot be NULL/nil (and they are not when checking with > "info locals" in the GUD GDB buffer). > > The reason for that is that GUD uses the GDB command "-stack-list-locals > --thread X --simple-values" as defined in gdb-mi.el:3991 which returns: > > locals=[{name="it",type="struct it"}, > {name="pt",type="struct text_pos"}, > {name="w",type="struct window *",value="0x12a1d40"}, > {name="old_buffer",type="struct buffer *",value="0x0"}, > {name="result",type="Lisp_Object",value="58"}] > > Note that the entries for the two structs it and pt don't have a value > field. > > I guess the usage of --simple-values is intentional, and in fact, when > trying to use "--all-values" instead I get a > > error in process filter: gdb-jsonify-buffer: Stack overflow in regexp matcher Yes, the use of --simple-values is intentional. If you want to see the values of the fields, you need to click mouse-2 on the variable name, and then Emacs will pop up a frame with the fields. > I'm not actually sure if it would be benefitical to use --all-values > even if that regexp matching error was fixed because the structs can be > really large. But at least the value should not be shown as "nil" but > as "" or something else which makes it obvious that > the displayed value is not the real value. Like the patch below? If you think it's OK, I will push it. Thanks. --- lisp/progmodes/gdb-mi.el~0 2015-05-20 08:22:42.000000000 +0300 +++ lisp/progmodes/gdb-mi.el 2015-09-09 16:47:24.399310500 +0300 @@ -4038,6 +4038,8 @@ (let ((name (bindat-get-field local 'name)) (value (bindat-get-field local 'value)) (type (bindat-get-field local 'type))) + (when (not value) + (setq value "")) (if (or (not value) (string-match "\\0x" value)) (add-text-properties 0 (length name)