From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id GXs/LTa55GrR0hYAWB0awg (envelope-from ) for ; Fri, 30 Oct 2026 11:35:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1793374518; bh=bCSmJm0pOmQEvR4Fkb0SoJElDbD5pBy/s11ZEfZF/zM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=BCEg+i+GxWMr0+yLqTASF+Zzp0cFh+nGD9t+OkFSrZPmYch+8/aIHQtVpDJQC7nwT 4EC1l4rYerf810lWjTU51YdxudOn2+kA3kssxdD0MizTKPfoO21DXsd4pzq+sJdOMa sFGHGnKo7xhI9zwNuiU6CeVTfo8l40An1GY28tuk= Received: by simark.ca (Postfix, from userid 112) id B51DD378002; Fri, 30 Oct 2026 11:35:18 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=AkEWRg3K; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 30AE11E023 for ; Fri, 30 Oct 2026 11:35:18 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BBBC14BAE7C8 for ; Fri, 30 Oct 2026 15:35:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBBC14BAE7C8 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=AkEWRg3K Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 730C24BA23F7 for ; Fri, 30 Oct 2026 15:34:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 730C24BA23F7 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 730C24BA23F7 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793374488; cv=none; b=tRSFERuk63gWAdhZZpGZxWNOwEH/1yWtnfcbgAlrA+ODtkwdetn06hv4+3bvOn/BFo/yh+fCA6ehwtaVF3DrLPxD5KKPuJfcnrJ/y7dckgF63bbDpmVfalQBKtK2cJzv764rIaMh441hsCSIN88mwGJSClcrPyqoQ+3sYeSNx3M= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1793374488; c=relaxed/simple; bh=bCSmJm0pOmQEvR4Fkb0SoJElDbD5pBy/s11ZEfZF/zM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=H1SGbr1Am1MWvXsNUw/1+lndg3NwpmAhceN40x09DooCZY6Q5oSICmgD4hh4etedavBbZFi3ZhPWYmiCrJqKjjwusItC1aVsbpMJJU1uGT5TN+qR2fGbaoHLhMu6r6LbvM/zV6JcJH8lipARWlz8STkn1qW4sD2mIDORafNUtbU= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=AkEWRg3K DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 730C24BA23F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1793374487; bh=bCSmJm0pOmQEvR4Fkb0SoJElDbD5pBy/s11ZEfZF/zM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=AkEWRg3KW4MLd74MCFb0NwB2ne9yZgev6Fz57YKFjwxnr0nzYLg5TroXXpf4MFgDI DfwbXz5cZ8xq9siyMqVvfOH8oT3PRq2yBUmXmDk86xpv8uAYS+T0nkheBGkr4ohOzZ khWcMXd5EcxPu+x1v0mcpPxj1RFJBAAkG5OyaxoU= Received: by simark.ca (Postfix) id 4830E1E023; Fri, 30 Oct 2026 11:34:46 -0400 (EDT) Message-ID: <622c83da-e9e0-4c30-a50f-eeba63538e97@simark.ca> Date: Fri, 30 Oct 2026 11:34:45 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCHv10 2/5] gdb: rename program_space::entry_point_address* functions To: Andrew Burgess , gdb-patches@sourceware.org Cc: Pedro Alves References: <0218116b07c0f7f81a2831e0bde5227ca0b3e874.1793268860.git.aburgess@redhat.com> Content-Language: fr From: Simon Marchi In-Reply-To: <0218116b07c0f7f81a2831e0bde5227ca0b3e874.1793268860.git.aburgess@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 10/29/26 6:20 AM, Andrew Burgess wrote: > Rename program_space::entry_point_address to > program_space::exec_entry_point_address and > program_space::entry_point_address_query to > program_space::exec_entry_point_address_if_available. > > There are two aspects to this renaming. First I replace 'query' with > 'if_available' in one of the functions. I feel this better describes > the function, and also is inline with how other, similar, functions > are named in GDB. > > The second part of the renaming is to add the 'exec_' prefix to the > front of both function names. When a dynamically linked inferior is > started the first instruction executed is actually within the > run-time linker, not within the main executable, so it could be > argued that the actual entry address for the inferior is not the entry > address of the main executable. > > However, there is an equally valid argument that the entry address of > the executable is also something worth finding. The existing entry > address within the inferior is used for a number of tasks in GDB, for > example displaced stepping (arch-utils.c), inferior function > calls (arc-tdep.c and infcall.c), and for detecting the "entry" frame. > > This last one, the entry frame detection is interesting. In a > dynamically linked executable it could be argued that there are two > entry frames. The very first frame that is executed in the inferior, > this is where 'starti' stops the inferior. And then the very first > frame within the main executable. I think that both of these are > valid. > > Currently, as we can only find the entry address within the main > executable, we can only identify the first frame of the main > executable. And this can cause some problems, consider: > > (gdb) starti > Starting program: /tmp/hello > > Program stopped. > 0x00007ffff7fd3110 in _start () from /lib64/ld-linux-x86-64.so.2 > (gdb) bt > #0 0x00007ffff7fd3110 in _start () from /lib64/ld-linux-x86-64.so.2 > #1 0x0000000000000001 in ?? () > #2 0x00007fffffffac13 in ?? () > #3 0x0000000000000000 in ?? () > (gdb) > > Here frames #1 to #3 are all bogus, created by GDB based on whatever > values happen to be in the registers when the inferior starts. > > In a later commit I'd like to fix this problem, however, I would > prefer that the other users of program_space::entry_point_address > continue to use the address within the main executable. > > So, in order to keep the distinction between the two different types > of entry point, I'm renaming the existing functions with the 'exec_' > prefix. > > There should be no user visible changes after this commit. > > Approved-By: Pedro Alves This is already approved by Pedro and is a change that makes sense on its own, so I think you should just push it. Simon