Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: simon.marchi@polymtl.ca
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@polymtl.ca>
Subject: [PATCH 04/10] gdb: rename find_pc_compunit_symtab -> find_compunit_symtab_for_pc
Date: Wed, 15 Oct 2025 20:07:58 -0400	[thread overview]
Message-ID: <20251016001154.3969223-5-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20251016001154.3969223-1-simon.marchi@polymtl.ca>

From: Simon Marchi <simon.marchi@polymtl.ca>

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


  parent reply	other threads:[~2025-10-16  0:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-16  0:07 [PATCH 00/10] Rename some symtab find functions simon.marchi
2025-10-16  0:07 ` [PATCH 01/10] gdb: rename find_pc_function -> find_symbol_for_pc simon.marchi
2025-10-16  0:07 ` [PATCH 02/10] gdb: rename find_pc_sect_function -> find_symbol_for_pc_sect simon.marchi
2025-10-16  0:07 ` [PATCH 03/10] gdb: rename find_pc_sect_containing_function -> find_symbol_for_pc_sect_maybe_inline simon.marchi
2025-10-16  0:07 ` simon.marchi [this message]
2025-10-16  0:07 ` [PATCH 05/10] gdb: rename find_pc_sect_compunit_symtab -> find_compunit_symtab_for_pc_sect simon.marchi
2025-10-16  0:08 ` [PATCH 06/10] gdb: rename find_pc_line_pc_range -> find_line_pc_range_for_pc simon.marchi
2025-10-16  0:08 ` [PATCH 07/10] gdb: rename find_pc_line -> find_sal_for_pc simon.marchi
2025-10-16  0:08 ` [PATCH 08/10] gdb: rename find_pc_sect_line -> find_sal_for_pc_sect simon.marchi
2025-10-16  0:08 ` [PATCH 09/10] gdb: rename find_pc_line_symtab -> find_symtab_for_pc simon.marchi
2025-10-16  0:08 ` [PATCH 10/10] gdb: rename find_line_pc_range -> find_pc_range_for_sal simon.marchi
2025-10-19  4:07 ` [PATCH 00/10] Rename some symtab find functions Kevin Buettner
2025-10-20 19:41   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251016001154.3969223-5-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox