From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id OcgGOrU88GigbjYAWB0awg (envelope-from ) for ; Wed, 15 Oct 2025 20:30:45 -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=HzbbQtlE; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E23DA1E0BA; Wed, 15 Oct 2025 20:30:45 -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 340511E04C for ; Wed, 15 Oct 2025 20:30:45 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5722E385842E for ; Thu, 16 Oct 2025 00:30:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5722E385842E 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=HzbbQtlE Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id B1FE73858286 for ; Thu, 16 Oct 2025 00:18:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B1FE73858286 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 B1FE73858286 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=1760573887; cv=none; b=Ap9iXAgcqKL51M3RTQF6SrUihJASgjm4glXNzcnK3znOOZfc9EhJj+oDRX+9foweKqtSRveREALDnycOGn3wdkHoylO7dnltcu8NkFv4JwLQ+QEV6hVKuZZCjQjs5tc/LTiHxNJS3hekVKHEX2HLOkkA9B5DluBdFr1kdnACM3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760573887; c=relaxed/simple; bh=WHNA11FRwCwB1DJmnk+k4s9wr/eJjaBwQH5LMsjvUm0=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ehvw8pqplheSlelpt+sejezZ6s+arY3vs5HVVJ3ZbOB9tURGYaL04gRRMXR+pFyETli1upIriSVQN5SPQTMn1FaYmE2opmSIIhcr1QCMmEa7IODN1AVx99Z/PoHv7dMayNO+ErxKLCqOFMRrZYCcIjwnLlX8ln7Pb6qng8szlBk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1FE73858286 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 59G0I1uA071304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Oct 2025 20:18:06 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 59G0I1uA071304 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1760573886; bh=p54ElvjvXljx0EcN509p06/e/P/vpUUGXPb1nTt+Naw=; h=From:To:Cc:Subject:Date:In-Reply-To:From; b=HzbbQtlEt/+MV+7SOSvPTAHMQiD7jJgtER4TIDbc17001Tdh4ahhu10T5Ex/VRORW 288yg38pkcnv2xwvS89ZLqnven/cqDO0+DsArL/mjYuymnIFyL8zyalGF7HgcTmzxh kIMjvgBc5YoNk8/MxoEgu2bBQbQ+8h4w3MAk7TEbACK+mrin+dxBOVv+d5W+5rykQ8 N2eApAEg9ffKCxLIGWetUqx4ecxCFWizrYzmJ5vPnGgN+/p5bDNww9CWqLuv7aDZae pPAPIWZH/ZLKyaU8J3tHizE7qdBxyyuMnVlf+cqSkf9hFTlkUjnUvxH7uR2cYJIrXy J9EKEchJIN/Ew== Received: by simark.ca (Postfix) id EFD011E0FE; Wed, 15 Oct 2025 20:11:58 -0400 (EDT) From: simon.marchi@polymtl.ca To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH 04/10] gdb: rename find_pc_compunit_symtab -> find_compunit_symtab_for_pc Date: Wed, 15 Oct 2025 20:07:58 -0400 Message-ID: <20251016001154.3969223-5-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:18:01 +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 Change-Id: I6eef5db4ae55f3eb0415768207ae3c26b305f773 --- gdb/amd64-tdep.c | 6 +++--- gdb/amdgpu-tdep.c | 2 +- gdb/arm-tdep.c | 2 +- gdb/block.c | 2 +- gdb/compile/compile.c | 2 +- gdb/dwarf2/frame.c | 2 +- gdb/frame.c | 4 ++-- gdb/guile/scm-block.c | 2 +- gdb/i386-tdep.c | 4 ++-- gdb/infrun.c | 4 ++-- gdb/python/py-progspace.c | 2 +- gdb/symtab.c | 6 +++--- gdb/symtab.h | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 9245889210b3..b1021c071c55 100755 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -2850,7 +2850,7 @@ amd64_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); - struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); + struct compunit_symtab *cust = find_compunit_symtab_for_pc (func_addr); /* LLVM backend (Clang/Flang) always emits a line note before the prologue and another one after. We trust clang and newer Intel @@ -3233,7 +3233,7 @@ amd64_stack_frame_destroyed_p_1 (struct gdbarch *gdbarch, CORE_ADDR pc) static int amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) { - struct compunit_symtab *cust = find_pc_compunit_symtab (pc); + struct compunit_symtab *cust = find_compunit_symtab_for_pc (pc); if (cust != nullptr && cust->producer () != nullptr && producer_is_llvm (cust->producer ())) @@ -3255,7 +3255,7 @@ amd64_epilogue_frame_sniffer_1 (const struct frame_unwind *self, return 0; bool unwind_valid_p - = compunit_epilogue_unwind_valid (find_pc_compunit_symtab (pc)); + = compunit_epilogue_unwind_valid (find_compunit_symtab_for_pc (pc)); if (override_p) { if (unwind_valid_p) diff --git a/gdb/amdgpu-tdep.c b/gdb/amdgpu-tdep.c index 26e5a27a749a..07ad307afc18 100644 --- a/gdb/amdgpu-tdep.c +++ b/gdb/amdgpu-tdep.c @@ -1002,7 +1002,7 @@ amdgpu_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); - struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); + struct compunit_symtab *cust = find_compunit_symtab_for_pc (func_addr); /* Clang always emits a line note before the prologue and another one after. We trust clang to emit usable line notes. */ diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index f4c2e0413f19..b03e67b1aa82 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1780,7 +1780,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); - struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); + struct compunit_symtab *cust = find_compunit_symtab_for_pc (func_addr); if (post_prologue_pc) post_prologue_pc diff --git a/gdb/block.c b/gdb/block.c index e09bccdcf862..9ce14849566b 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -219,7 +219,7 @@ call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc) call_site *cs = nullptr; /* -1 as tail call PC can be already after the compilation unit range. */ - cust = find_pc_compunit_symtab (pc - 1); + cust = find_compunit_symtab_for_pc (pc - 1); if (cust != nullptr) cs = cust->find_call_site (pc); diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c index 5d81ec12b714..79c6af157629 100644 --- a/gdb/compile/compile.c +++ b/gdb/compile/compile.c @@ -437,7 +437,7 @@ static const char * get_selected_pc_producer_options (void) { CORE_ADDR pc = get_frame_pc (get_selected_frame (NULL)); - struct compunit_symtab *symtab = find_pc_compunit_symtab (pc); + struct compunit_symtab *symtab = find_compunit_symtab_for_pc (pc); const char *cs; if (symtab == NULL || symtab->producer () == NULL diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 8d0d59fb5671..525b581cf393 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -740,7 +740,7 @@ dwarf2_frame_find_quirks (struct dwarf2_frame_state *fs, { struct compunit_symtab *cust; - cust = find_pc_compunit_symtab (fs->pc); + cust = find_compunit_symtab_for_pc (fs->pc); if (cust == NULL) return; diff --git a/gdb/frame.c b/gdb/frame.c index 5c41dcdc3457..4162a35b7533 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -1991,7 +1991,7 @@ select_frame (const frame_info_ptr &fi) block. */ if (get_frame_address_in_block_if_available (fi, &pc)) { - struct compunit_symtab *cust = find_pc_compunit_symtab (pc); + struct compunit_symtab *cust = find_compunit_symtab_for_pc (pc); if (cust != NULL && cust->language () != current_language->la_language @@ -3143,7 +3143,7 @@ get_frame_language (const frame_info_ptr &frame) if (pc_p) { - struct compunit_symtab *cust = find_pc_compunit_symtab (pc); + struct compunit_symtab *cust = find_compunit_symtab_for_pc (pc); if (cust != NULL) return cust->language (); diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index a4e692b8ccb1..e1b2928df180 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -676,7 +676,7 @@ gdbscm_lookup_block (SCM pc_scm) gdbscm_gdb_exception exc {}; try { - cust = find_pc_compunit_symtab (pc); + cust = find_compunit_symtab_for_pc (pc); if (cust != NULL && cust->objfile () != NULL) block = block_for_pc (pc); diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index d3ad402addc1..e00b3337beaf 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -1803,7 +1803,7 @@ i386_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) { CORE_ADDR post_prologue_pc = skip_prologue_using_sal (gdbarch, func_addr); - struct compunit_symtab *cust = find_pc_compunit_symtab (func_addr); + struct compunit_symtab *cust = find_compunit_symtab_for_pc (func_addr); /* LLVM backend (Clang/Flang) always emits a line note before the prologue and another one after. We trust clang and newer Intel @@ -2197,7 +2197,7 @@ i386_epilogue_frame_sniffer_1 (const struct frame_unwind *self, return 0; bool unwind_valid_p - = compunit_epilogue_unwind_valid (find_pc_compunit_symtab (pc)); + = compunit_epilogue_unwind_valid (find_compunit_symtab_for_pc (pc)); if (override_p) { if (unwind_valid_p) diff --git a/gdb/infrun.c b/gdb/infrun.c index b5d2e43d5361..959393d3e5e7 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -8671,7 +8671,7 @@ handle_step_into_function (struct gdbarch *gdbarch, fill_in_stop_func (gdbarch, ecs); compunit_symtab *cust - = find_pc_compunit_symtab (ecs->event_thread->stop_pc ()); + = find_compunit_symtab_for_pc (ecs->event_thread->stop_pc ()); if (cust != nullptr && cust->language () != language_asm) ecs->stop_func_start = gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start); @@ -8750,7 +8750,7 @@ handle_step_into_function_backward (struct gdbarch *gdbarch, fill_in_stop_func (gdbarch, ecs); - cust = find_pc_compunit_symtab (ecs->event_thread->stop_pc ()); + cust = find_compunit_symtab_for_pc (ecs->event_thread->stop_pc ()); if (cust != nullptr && cust->language () != language_asm) ecs->stop_func_start = gdbarch_skip_prologue_noexcept (gdbarch, ecs->stop_func_start); diff --git a/gdb/python/py-progspace.c b/gdb/python/py-progspace.c index 9f3e45c0cc65..a0afc7b7dba3 100644 --- a/gdb/python/py-progspace.c +++ b/gdb/python/py-progspace.c @@ -515,7 +515,7 @@ pspy_block_for_pc (PyObject *o, PyObject *args) scoped_restore_current_program_space saver; set_current_program_space (self->pspace); - cust = find_pc_compunit_symtab (pc); + cust = find_compunit_symtab_for_pc (pc); if (cust != NULL && cust->objfile () != NULL) block = block_for_pc (pc); diff --git a/gdb/symtab.c b/gdb/symtab.c index 100e7dbbda14..0180c4eadac5 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2825,7 +2825,7 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct obj_section *section) Backward compatibility, no section. */ struct compunit_symtab * -find_pc_compunit_symtab (CORE_ADDR pc) +find_compunit_symtab_for_pc (CORE_ADDR pc) { return find_pc_sect_compunit_symtab (pc, find_pc_mapped_section (pc)); } @@ -4755,7 +4755,7 @@ global_symbol_searcher::expand_symtabs msymbols to the results list, and that requires that the symbols tables are expanded. */ if ((kind & SEARCH_FUNCTION_DOMAIN) != 0 - ? (find_pc_compunit_symtab + ? (find_compunit_symtab_for_pc (msymbol->value_address (objfile)) == NULL) : (lookup_symbol_in_objfile_from_linkage_name (objfile, msymbol->linkage_name (), @@ -4875,7 +4875,7 @@ global_symbol_searcher::add_matching_msymbols /* For functions we can do a quick check of whether the symbol might be found via find_pc_symtab. */ if ((kind & SEARCH_FUNCTION_DOMAIN) == 0 - || (find_pc_compunit_symtab + || (find_compunit_symtab_for_pc (msymbol->value_address (objfile)) == NULL)) { if (lookup_symbol_in_objfile_from_linkage_name diff --git a/gdb/symtab.h b/gdb/symtab.h index f6f25a62d2c4..c8c43b9f7cf4 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2308,7 +2308,7 @@ extern void clear_pc_function_cache (void); /* lookup full symbol table by address. */ -extern struct compunit_symtab *find_pc_compunit_symtab (CORE_ADDR); +extern struct compunit_symtab *find_compunit_symtab_for_pc (CORE_ADDR); /* lookup full symbol table by address and section. */ -- 2.51.0