From patchwork Mon Sep 14 14:01:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 8676 Received: (qmail 80788 invoked by alias); 14 Sep 2015 14:02:01 -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 80765 invoked by uid 89); 14 Sep 2015 14:02:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f170.google.com Received: from mail-wi0-f170.google.com (HELO mail-wi0-f170.google.com) (209.85.212.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 14 Sep 2015 14:01:58 +0000 Received: by wicge5 with SMTP id ge5so144260638wic.0 for ; Mon, 14 Sep 2015 07:01:55 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.194.81.137 with SMTP id a9mr30340510wjy.155.1442239315025; Mon, 14 Sep 2015 07:01:55 -0700 (PDT) Received: by 10.27.83.201 with HTTP; Mon, 14 Sep 2015 07:01:54 -0700 (PDT) Date: Mon, 14 Sep 2015 16:01:54 +0200 Message-ID: Subject: [PATCH] [D] Re-apply change for handling non-local references in nested functions From: Iain Buclaw To: GDB Patches X-IsSubscribed: yes Hi, This was first applied by Pierre-Marie back in February (see 63e43d3aedb8b1112899c2d0ad74cbbee687e5d6), but my re-write of d-exp.y was written about 6 months earlier, and I subsequently missed it when backporting upstream changes. This reapplies that change. Regards Iain. gdb/ChangeLog: * d-exp.y: Remove an obsolete comment and propagate the block information to the produced expression. --- diff --git a/gdb/d-exp.y b/gdb/d-exp.y index dd87d8a..b66565d 100644 --- a/gdb/d-exp.y +++ b/gdb/d-exp.y @@ -483,9 +483,7 @@ PrimaryExpression: } write_exp_elt_opcode (pstate, OP_VAR_VALUE); - /* We want to use the selected frame, not another more inner frame - which happens to be in the same block. */ - write_exp_elt_block (pstate, NULL); + write_exp_elt_block (pstate, sym.block); write_exp_elt_sym (pstate, sym.symbol); write_exp_elt_opcode (pstate, OP_VAR_VALUE); }