From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85915 invoked by alias); 2 May 2019 07:38:53 -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 85907 invoked by uid 89); 2 May 2019 07:38:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= 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; Thu, 02 May 2019 07:38:51 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 27A8C81DE5; Thu, 2 May 2019 07:38:50 +0000 (UTC) Received: from f29-4.lan (ovpn-116-84.phx2.redhat.com [10.3.116.84]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB5BA80EA; Thu, 2 May 2019 07:38:49 +0000 (UTC) Date: Thu, 02 May 2019 07:38:00 -0000 From: Kevin Buettner To: Eli Zaretskii Cc: gdb-patches@sourceware.org, Simon Marchi Subject: Re: The 'cold' function attribute and GDB Message-ID: <20190502003849.6759d177@f29-4.lan> In-Reply-To: References: <83wojaovbp.fsf@gnu.org> <077aee8c-7bef-bad6-a6a1-e69f116cc18b@simark.ca> <20190501195113.69aea752@f30-4.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-05/txt/msg00033.txt.bz2 On Thu, 02 May 2019 10:05:41 +0300 Eli Zaretskii wrote: > On May 2, 2019 5:51:13 AM GMT+03:00, Kevin Buettner wrote: > > On Wed, 1 May 2019 16:17:04 -0400 > > Simon Marchi wrote: > > > > > In an ideal world, if gcc generates two separate ranges > > > of instruction for this function (the hot path and the cold path), > > it should describe > > > it as two ranges in the entry for print_vectorlike. If so, it > > should be described with > > > a DW_AT_ranges attribute. > > > > Yes, this is exactly right. > > > I do see in the DWARF info that print_vectorlike has 2 address ranges: its DW_AT_ranges attribute specifies a value which is shown as a list of 2 ranges in the "objdump -WR" output. > > So where do I go from here? What to check next? Can you show me what is printed for the following commands? disassemble print_vectorlike x/3i print_vectorlike b print_vectorlike For the disassemble command, I expect both ranges to be displayed. The x and b commands should print insns / set a breakpoint on the entry pc (which should NOT be the cold address) of the function. If one or more of these things aren't happening, then something is going wrong somewhere. Kevin