From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86620 invoked by alias); 1 Aug 2018 23:40:43 -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 86609 invoked by uid 89); 1 Aug 2018 23:40:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.6 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,KAM_STOCKGEN,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=simon.marchi@ericsson.com, simonmarchiericssoncom X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 Aug 2018 23:40:41 +0000 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C1DE308FBA1; Wed, 1 Aug 2018 23:40:40 +0000 (UTC) Received: from pinnacle.lan (ovpn-116-57.phx2.redhat.com [10.3.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3FF5960E3E; Wed, 1 Aug 2018 23:40:40 +0000 (UTC) Date: Wed, 01 Aug 2018 23:40:00 -0000 From: Kevin Buettner To: Simon Marchi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 3/8] Add support for non-contiguous blocks to find_pc_partial_function Message-ID: <20180801164039.400a0350@pinnacle.lan> In-Reply-To: References: <20180625233239.49dc52ea@pinnacle.lan> <20180625234703.08a2e8ca@pinnacle.lan> <20180719115216.6a08ad9a@pinnacle.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00028.txt.bz2 On Tue, 31 Jul 2018 21:59:57 -0400 Simon Marchi wrote: > > int > > find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address, > > - CORE_ADDR *endaddr) > > + CORE_ADDR *endaddr, const struct block **block) > > { > > struct obj_section *section; > > struct symbol *f; > > @@ -232,13 +223,37 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address, > > f = find_pc_sect_function (mapped_pc, section); > > if (f != NULL > > && (msymbol.minsym == NULL > > - || (BLOCK_START (SYMBOL_BLOCK_VALUE (f)) > > + || (BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (f)) > > I don't understand this change, can you explain it briefly? > > > >= BMSYMBOL_VALUE_ADDRESS (msymbol)))) > > { A function's minimal symbol generally (maybe even always) refers to the entry pc. Therefore, we want to compare the block's entry pc to the minimal symbol address instead of the block start - which might not be the same as the entry pc. BLOCK_START will refer to the lowest address in all of the ranges. I'll add a comment to the code explaining this. Kevin