Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Doug Evans <dje@google.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Fix ext lang calls to value_struct_elt
Date: Thu, 03 Nov 2016 18:16:00 -0000	[thread overview]
Message-ID: <001a11405eae5bc7d80540698d1d@google.com> (raw)

Hi.

I found this while reading the code.

2016-11-03  Doug Evans  <dje@google.com>

	* guile/scm-value.c (gdbscm_value_field): Fix call to value_struct_elt.
	* python/py-value.c (valpy_getitem): Ditto.

diff --git a/gdb/guile/scm-value.c b/gdb/guile/scm-value.c
index 1cdf953..416e488 100644
--- a/gdb/guile/scm-value.c
+++ b/gdb/guile/scm-value.c
@@ -726,7 +726,8 @@ gdbscm_value_field (SCM self, SCM field_scm)
      {
        struct value *tmp = value;

-      res_val = value_struct_elt (&tmp, NULL, field, NULL, NULL);
+      res_val = value_struct_elt (&tmp, NULL, field, NULL,
+				  "struct/class/union");
      }
    CATCH (except, RETURN_MASK_ALL)
      {
diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c
index 46683b8..f8bf17a 100644
--- a/gdb/python/py-value.c
+++ b/gdb/python/py-value.c
@@ -754,7 +754,8 @@ valpy_getitem (PyObject *self, PyObject *key)
        struct value *res_val = NULL;

        if (field)
-	res_val = value_struct_elt (&tmp, NULL, field, 0, NULL);
+	res_val = value_struct_elt (&tmp, NULL, field, NULL,
+				    "struct/class/union");
        else if (bitpos >= 0)
  	res_val = value_struct_elt_bitpos (&tmp, bitpos, field_type,
  					   "struct/class/union");


             reply	other threads:[~2016-11-03 18:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 18:16 Doug Evans [this message]
2016-11-03 20:59 ` Yao Qi
2016-11-07 21:33   ` Doug Evans

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=001a11405eae5bc7d80540698d1d@google.com \
    --to=dje@google.com \
    --cc=gdb-patches@sourceware.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox