From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75812 invoked by alias); 16 Sep 2015 16:16:19 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 74804 invoked by uid 89); 16 Sep 2015 16:16:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f44.google.com Received: from mail-pa0-f44.google.com (HELO mail-pa0-f44.google.com) (209.85.220.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 16 Sep 2015 16:16:17 +0000 Received: by pacfv12 with SMTP id fv12so217522693pac.2 for ; Wed, 16 Sep 2015 09:16:15 -0700 (PDT) X-Received: by 10.66.121.229 with SMTP id ln5mr60089726pab.133.1442420175540; Wed, 16 Sep 2015 09:16:15 -0700 (PDT) Received: from seba.sebabeach.org.gmail.com (173-13-178-53-sfba.hfc.comcastbusiness.net. [173.13.178.53]) by smtp.gmail.com with ESMTPSA id rb8sm28815062pab.14.2015.09.16.09.16.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 09:16:15 -0700 (PDT) From: Doug Evans To: Joel Brobecker Cc: Pierre-Marie de Rodat , Kevin Buettner , gdb-patches@sourceware.org Subject: Re: [PATCH] Add proper handling for non-local references in nested functions References: <550C1170.9070208@adacore.com> <55685B60.3000004@redhat.com> <55775EB0.4080701@adacore.com> <55AF5F7E.5000600@adacore.com> <20150722173957.7ed51f18@pinnacle.lan> <55B0C583.6050601@adacore.com> <55BB538B.7090104@adacore.com> <55D1E2B5.4000200@adacore.com> <20150902234947.GA575@adacore.com> Date: Wed, 16 Sep 2015 16:16:00 -0000 In-Reply-To: <20150902234947.GA575@adacore.com> (Joel Brobecker's message of "Wed, 2 Sep 2015 16:49:47 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00382.txt.bz2 Joel Brobecker writes: > Hi Pierre-Marie, > >> >From f8cb12e93bc4b317bf03dd31fc158cc05fc60367 Mon Sep 17 00:00:00 2001 >> From: Pierre-Marie de Rodat >> Date: Thu, 5 Feb 2015 17:00:06 +0100 >> Subject: [PATCH] DWARF: handle non-local references in nested functions >> >> GDB's current behavior when dealing with non-local references in the >> context of nested fuctions is approximative: >> >> - code using valops.c:value_of_variable read the first available stack >> frame that holds the corresponding variable (whereas there can be >> multiple candidates for this); >> >> - code directly relying on read_var_value will instead read non-local >> variables in frames where they are not even defined. >> >> This change adds the necessary context to symbol reads (to get the block >> they belong to) and to blocks (the static link property, if any) so that >> GDB can make the proper decisions when dealing with non-local varibale >> references. >> >> gdb/ChangeLog: >> >> * ada-lang.c (ada_read_var_value): Add a var_block argument >> and pass it to default_read_var_value. >> * block.c (block_static_link): New accessor. >> * block.h (block_static_link): Declare it. >> * buildsym.c (finish_block_internal): Add a static_link >> [...] > > This patch is causing a crash on some platforms, as explained by > the revision log of the attached patch. > > gdb/ChangeLog: > > * dwarf2loc.c (locexpr_get_frame_base): Renames > block_op_get_frame_base. > (dwarf2_block_frame_base_locexpr_funcs): Replace reference to > block_op_get_frame_base by reference to locexpr_get_frame_base. > (loclist_get_frame_base): New function, near identical copy of > locexpr_get_frame_base. > (dwarf2_block_frame_base_loclist_funcs): Replace reference to > block_op_get_frame_base by reference to loclist_get_frame_base. LGTM.