From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id abXzOe448GhEZDYAWB0awg (envelope-from ) for ; Wed, 15 Oct 2025 20:14:38 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=Plpv1+To; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E98E41E0BC; Wed, 15 Oct 2025 20:14:38 -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 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (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 B1BDC1E047 for ; Wed, 15 Oct 2025 20:14:31 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F31D385843A for ; Thu, 16 Oct 2025 00:14:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F31D385843A Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=Plpv1+To Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 5675D385843A for ; Thu, 16 Oct 2025 00:12:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5675D385843A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5675D385843A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573525; cv=none; b=BdvKDW874IKa1msxhmlwyhNlfiJzwXiI7SMjHsoVE9Fu+dAAYRf7WgXHXPN85/ITtSh51KQlq10o6Zho9vwhzT8OrBv3gL+5NR6cflXq7CUdW/M2DYR4QbHE8Kl7fbMXdZnoQ9+rtsQ+MgoMn6kL6/5WYOZ5gIc3u71/c2lLaQI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573525; c=relaxed/simple; bh=R34bN7tDAQFuXeIijOG3j24BztjgAj9fPE3gMqUVUnE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=lAOyak8yjlCvQ9xMgqSrJlcmDPQg1dbNvks6szGnA7VnpwoVPObnssDqzp/yzHhejwvJLinUXHCwfRziibdLTffEMj8KwxwC0AKOcBLm8m/0b+0yHPka+cOq4yKM/9EzBzkvM1hiJcUHPaF3kEVf3tetBx3du0+LvbPQJs83rbg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5675D385843A 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 59G0Bwli069754 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Oct 2025 20:12:03 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 59G0Bwli069754 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1760573523; bh=QDLYZmyfB7Nyu0xXypZI4ABg2ehlJe23je+o8kO7K/Y=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=Plpv1+ToAwrulCR9PqL0P3LEfmCk6qqV+pib2P5riwSP7Nk/Cqd63E+AzHINwa/Af Qc3imE/EYsmNHRtHZhl8XuhUoPH+BPPVcYKOslla2nUiKmkoydfPrpNXNUOo1mzgKW MlA8Tk9R//T/Q7j2jLL3eHR2t6jDuX0WvjrE/5ZCWYsdtcgO7k2ZKmDYwDFWB64USw h7i+DMeLE5EqSpzXtXb4TnfLpIkzLTjjAonUBazO/8k3RhGMw++03lJx0nNYmZEei2 QnGHGMLOErgImKiwgYOn4L1sB9/g2wM7j1lJiTJj0Ma/OAn5l6qbr/9y7MCMLTErsi rgj4QrX2ts0RA== Received: by simark.ca (Postfix) id CA4D71E0BC; Wed, 15 Oct 2025 20:11:58 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 03/10] gdb: rename find_pc_sect_containing_function -> find_symbol_for_pc_sect_maybe_inline Date: Wed, 15 Oct 2025 20:07:57 -0400 Message-ID: <20251016001154.3969223-4-simon.marchi@polymtl.ca> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20251016001154.3969223-1-simon.marchi@polymtl.ca> References: <20251016001154.3969223-1-simon.marchi@polymtl.ca> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 16 Oct 2025 00:11:58 +0000 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 From: Simon Marchi Use the suffix "maybe_inline" to differentiate it from find_symbol_for_pc_sect. find_symbol_for_pc_sect_maybe_inline can return symbols for inline functions, while find_symbol_for_pc_sect doesn't. Change-Id: I6c4ef961383429ee26c8fcc0cc5df2e4e1e24959 --- gdb/blockframe.c | 2 +- gdb/infcmd.c | 2 +- gdb/linespec.c | 2 +- gdb/symtab.c | 2 +- gdb/symtab.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 9374cb15184f..434208c7e269 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -153,7 +153,7 @@ find_symbol_for_pc (CORE_ADDR pc) /* See symtab.h. */ struct symbol * -find_pc_sect_containing_function (CORE_ADDR pc, struct obj_section *section) +find_symbol_for_pc_sect_maybe_inline (CORE_ADDR pc, struct obj_section *section) { const block *bl = block_for_pc_sect (pc, section); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 7747f03b63b2..bb929240978f 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -1093,7 +1093,7 @@ jump_command (const char *arg, int from_tty) /* See if we are trying to jump to another function. */ fn = get_frame_function (get_current_frame ()); - sfn = find_pc_sect_containing_function (sal.pc, + sfn = find_symbol_for_pc_sect_maybe_inline (sal.pc, find_pc_mapped_section (sal.pc)); if (fn != nullptr && sfn != fn) { diff --git a/gdb/linespec.c b/gdb/linespec.c index fe1fb4c07fb9..b6fe4e170bf3 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -2165,7 +2165,7 @@ convert_address_location_to_sals (struct linespec_state *self, sal.pc = address; sal.section = find_pc_overlay (address); sal.explicit_pc = 1; - sal.symbol = find_pc_sect_containing_function (sal.pc, sal.section); + sal.symbol = find_symbol_for_pc_sect_maybe_inline (sal.pc, sal.section); std::vector sals; add_sal_to_sals (self, sals, sal, core_addr_to_string (address), true); diff --git a/gdb/symtab.c b/gdb/symtab.c index 386107451be3..100e7dbbda14 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3565,7 +3565,7 @@ find_function_start_sal (CORE_ADDR func_addr, bool funfirstline) /* find_function_start_sal_1 does a linetable search, so it finds the symtab and linenumber, but not a symbol. Fill in the function symbol too. */ - sal.symbol = find_pc_sect_containing_function (sal.pc, sal.section); + sal.symbol = find_symbol_for_pc_sect_maybe_inline (sal.pc, sal.section); return sal; } diff --git a/gdb/symtab.h b/gdb/symtab.h index 5d64e2149c0f..f6f25a62d2c4 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2218,7 +2218,7 @@ extern struct symbol *find_symbol_for_pc_sect (CORE_ADDR, struct obj_section *); section. The return value will be the closest enclosing function, which might be an inline function. */ -extern struct symbol *find_pc_sect_containing_function +extern struct symbol *find_symbol_for_pc_sect_maybe_inline (CORE_ADDR pc, struct obj_section *section); /* Find the symbol at the given address. Returns NULL if no symbol -- 2.51.0