From patchwork Thu Nov 3 18:16:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Evans X-Patchwork-Id: 17168 Received: (qmail 28665 invoked by alias); 3 Nov 2016 18:16:14 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 28654 invoked by uid 89); 3 Nov 2016 18:16:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=SCM, scm, Hx-languages-length:1166, H*MI:sk:001a114 X-HELO: mail-pa0-f73.google.com Received: from mail-pa0-f73.google.com (HELO mail-pa0-f73.google.com) (209.85.220.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Nov 2016 18:16:12 +0000 Received: by mail-pa0-f73.google.com with SMTP id yw6so1864663pac.1 for ; Thu, 03 Nov 2016 11:16:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:message-id:date:subject:from:to; bh=q9Wsje/dxWkC+mSC9nut4lQxQw9J8zhKLW+sqwds1Pk=; b=PGz/bsHSx8rpdQc3FIwzHIPmEM1HJ/LVlJmUGR3iAoLQzAYmBRlOt3dq3bG3AKOX1M P/LB+dXqe2sWr6s4aUMNmiv98bMJ3p5ip5SQF2qCTVA8uZ6FOHXLOExo0BqXvF01r3F/ QyIKiJf9bLSwqRlv9Q77dotS1dm9mCCKeEVB+O/eImWWWE7CdWaDIfeCYkPpj3kc0R1O a9q/pUqCxxUCfPGj0xRIzINZbWRKhIXKFAveTxmUpu+snFhmURT6doSBjBAclu9rT1M7 fqQnZXH1muMXe7P7XoUA+3NnR7Shc+fn6QRWotj/aY8pPg0fAA7kQQ/rpQexdPrQTh0L pK5w== X-Gm-Message-State: ABUngvdjIrgdFEcyF2ZCDSH97Ny31gDaCAnyZRaBpNnZZ+Skq/xfJ/hhZo+IbgGHNC2JGxENdTtrO2uCBtMr5+Qo0jdTERRBBC2GS+rqk01Bl+SQza0i3ZBhR/IWEFIh6ShXshbOgmfcsvlaNHCrnOfKvrkJe+kST1QgIZKpPAdV3E8iqfJ0BQ== MIME-Version: 1.0 X-Received: by 10.98.35.78 with SMTP id j75mr2914934pfj.18.1478196970877; Thu, 03 Nov 2016 11:16:10 -0700 (PDT) Message-ID: <001a11405eae5bc7d80540698d1d@google.com> Date: Thu, 03 Nov 2016 18:16:10 +0000 Subject: [PATCH] Fix ext lang calls to value_struct_elt From: Doug Evans To: gdb-patches@sourceware.org X-IsSubscribed: yes Hi. I found this while reading the code. 2016-11-03 Doug Evans * 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");