all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Tassilo Horn <tsdh@gnu.org>
Cc: 21438@debbugs.gnu.org
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	[thread overview]
Message-ID: <83twr365of.fsf@gnu.org> (raw)
In-Reply-To: <877fo0cem6.fsf@gnu.org>

> From: Tassilo Horn <tsdh@gnu.org>
> 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 "<non-simple value>" 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 "<complex data type>"))
         (if (or (not value)
                 (string-match "\\0x" value))
             (add-text-properties 0 (length name)





  reply	other threads:[~2015-09-09 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09  6:04 bug#21438: 25.0.50; GUD locals frame/window doesn't shows struct values as nil Tassilo Horn
2015-09-09 14:14 ` Eli Zaretskii [this message]
2015-09-09 15:10   ` Tassilo Horn
2015-09-09 15:57     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83twr365of.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=21438@debbugs.gnu.org \
    --cc=tsdh@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.