From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 71029 invoked by alias); 22 Dec 2017 02:59:06 -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 71016 invoked by uid 89); 22 Dec 2017 02:59:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1593 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 22 Dec 2017 02:59:04 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3FA03117255; Thu, 21 Dec 2017 21:59:03 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 88shgRqm2vYq; Thu, 21 Dec 2017 21:59:03 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id CC2AD117206; Thu, 21 Dec 2017 21:59:02 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 375D7809B4; Fri, 22 Dec 2017 06:58:53 +0400 (+04) Date: Fri, 22 Dec 2017 02:59:00 -0000 From: Joel Brobecker To: Simon Marchi Cc: Xavier Roirand , gdb-patches@sourceware.org Subject: Re: [RFA/DWARF v2] Fix breakpoint add on inlined function using function name. Message-ID: <20171222025853.emffsrqu5sdt5bw2@adacore.com> References: <1513776096-19313-1-git-send-email-roirand@adacore.com> <848029766ceee39c449712a53db88482@polymtl.ca> <20171221110327.zjsnnghq7qvnvyme@adacore.com> <749a54992d7a966c56f7f79c939394b8@polymtl.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <749a54992d7a966c56f7f79c939394b8@polymtl.ca> User-Agent: NeoMutt/20170113 (1.7.2) X-SW-Source: 2017-12/txt/msg00475.txt.bz2 > Why doesn't the same happen in the Ada case? The debug info in the Ada > program looks similar, so a partial symbol should be created for this DIE: > > <1><77b>: Abbrev Number: 2 (DW_TAG_subprogram) > <77c> DW_AT_external : 1 > <77c> DW_AT_name : (indirect string, offset: 0xae3): > b__read_small > <780> DW_AT_decl_file : 2 > <781> DW_AT_decl_line : 3 > <782> DW_AT_inline : 3 (declared as inline and inlined) > > Then, when we set the breakpoint, I would expect GDB to find the partial > symbol for read_small in this objfile, expand it to full symbols, and then > find the inlined instance, just as it does for C. That's the difference I > don't get. That's the abstract instance of the inlined subprogram. You might notice that it has a DW_AT_inline attribute, and nothing else. This DIE is there as the parent for the DIE(s) that represent the instance(s) where the function was actually inlined: <2><1547>: Abbrev Number: 4 (DW_TAG_inlined_subroutine) <1548> DW_AT_abstract_origin: <0x1526> <154c> DW_AT_low_pc : 0x402552 <1554> DW_AT_high_pc : 0x2b <155c> DW_AT_call_file : 1 <155d> DW_AT_call_line : 5 This DIE is the one that represents one concrete instance of the inlined function. You can see that it has a DW_AT_abstract_origin attribute which points to the abstract instance (so we can "inherit" some of the attributes that are common to all concrete instances), and then the attributes specific to this inlined instance, such as location, and more important of all, the low/high_pc. -- Joel