From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ubX6Lkl2V2F9DgAAWB0awg (envelope-from ) for ; Fri, 01 Oct 2021 16:57:45 -0400 Received: by simark.ca (Postfix, from userid 112) id AC53B1EDF7; Fri, 1 Oct 2021 16:57:45 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4FA441E813 for ; Fri, 1 Oct 2021 16:57:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0A40385742C for ; Fri, 1 Oct 2021 20:57:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0A40385742C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1633121865; bh=W+GY0/La5a9z5oC83yiEvA+yA5xfyMxY073tdhhCeP4=; h=Date:To:Subject:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=n4MWCadHvD6S+n0x89gpMGEQhLkUg/o/++yWlKS53mLfiFhLrAA4Ybz/oGUKK18XI CdTVRFJoZgJr3a45MxS1T1V1MJzz6pSIUdKnNkZ5E5RFLePD2HQcjjM+OQ2dC2GK54 JPqG6MwXF9+OJWZ72UOBcVMh62WLhosROYcw+YZ0= Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 249753857C5D for ; Fri, 1 Oct 2021 20:56:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 249753857C5D Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 191Kuhpn011717 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 1 Oct 2021 16:56:48 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 191Kuhpn011717 Received: by simark.ca (Postfix, from userid 112) id 936101EE18; Fri, 1 Oct 2021 16:56:43 -0400 (EDT) Received: from www.simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id AD5131E813; Fri, 1 Oct 2021 16:56:41 -0400 (EDT) MIME-Version: 1.0 Date: Fri, 01 Oct 2021 16:56:41 -0400 To: Tom de Vries Subject: Re: [PATCH 4/4] [gdb/symtab] Use unrelocated addresses in call_site In-Reply-To: <20211001123328.22314-4-tdevries@suse.de> References: <20211001123328.22314-1-tdevries@suse.de> <20211001123328.22314-4-tdevries@suse.de> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <82e1a4ada2d2fbef2b436f707c9cf435@polymtl.ca> X-Sender: simon.marchi@polymtl.ca Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Fri, 1 Oct 2021 20:56:43 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Simon Marchi via Gdb-patches Reply-To: Simon Marchi Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 2021-10-01 08:33, Tom de Vries via Gdb-patches wrote: > From: Simon Marchi > > Consider test-case gdb.trace/entry-values.exp with target board > unix/-fPIE/-pie. > > Using this command we have an abbreviated version, and can see the > correct > @entry values for foo: > ... > $ gdb -q -batch outputs/gdb.trace/entry-values/entry-values \ > -ex start \ > -ex "break foo" \ > -ex "set print entry-values both" \ > -ex continue > Temporary breakpoint 1 at 0x679 > > Temporary breakpoint 1, 0x0000555555554679 in main () > Breakpoint 2 at 0x55555555463e > > Breakpoint 2, 0x000055555555463e in foo (i=0, i@entry=2, j=2, > j@entry=3) > ... > > Now, let's try the same again, but run directly to foo rather than > stopping at > main: > ... > $ gdb -q -batch outputs/gdb.trace/entry-values/entry-values \ > -ex "break foo" \ > -ex "set print entry-values both" \ > -ex run > Breakpoint 1 at 0x63e > > Breakpoint 1, 0x000055555555463e in foo (i=0, i@entry=, > \ > j=2, j@entry=) > ... > > So, what explains the difference? Noteworthy, this is a dwarf assembly > test-case, with debug info for foo and bar, but not for main. > > In the first case: > - we run to main > - this does not trigger expanding debug info, because there's none for > main > - we set a breakpoint at foo > - this triggers expanding debug info. Relocated addresses are used in > call_site info (because the exec is started) > - we continue to foo, and manage to find the call_site info > > In the second case: > - we set a breakpoint at foo > - this triggers expanding debug info. Unrelocated addresses are used > in > call_site info (because the exec is not started) > - we run to foo > - this triggers objfile_relocate1, but it doesn't update the call_site > info addresses > - we don't manage to find the call_site info Thanks for this explanation, I had not realized the difference in behavior here. The patch LGTM. Simon