]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: rename find_line_pc_range -> find_pc_range_for_sal
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 16 Oct 2025 00:08:04 +0000 (20:08 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Mon, 20 Oct 2025 19:12:41 +0000 (15:12 -0400)
Change-Id: Ibd1692292dfcad088ae74b797c38a483080f2ec1
Approved-by: Kevin Buettner <kevinb@redhat.com>
gdb/breakpoint.c
gdb/mi/mi-cmd-disas.c
gdb/mi/mi-main.c
gdb/source.c
gdb/symtab.c
gdb/symtab.h
gdb/tracepoint.c
gdb/tui/tui-disasm.c
gdb/tui/tui-source.c
gdb/tui/tui-winsource.c

index a2c326b9f3fe5f3f9562a4a70948d91ca0bf414a..494a1773e16b04fe338c4e0764ad2a0e6528257e 100644 (file)
@@ -9482,7 +9482,7 @@ resolve_sal_pc (struct symtab_and_line *sal)
 
   if (sal->pc == 0 && sal->symtab != NULL)
     {
-      if (!find_line_pc (sal->symtab, sal->line, &pc))
+      if (!find_pc_for_line (sal->symtab, sal->line, &pc))
        error (_("No line %d in file \"%s\"."),
               sal->line, symtab_to_filename_for_display (sal->symtab));
       sal->pc = pc;
@@ -9735,11 +9735,11 @@ find_breakpoint_range_end (struct symtab_and_line sal)
       int ret;
       CORE_ADDR start;
 
-      ret = find_line_pc_range (sal, &start, &end);
+      ret = find_pc_range_for_sal (sal, &start, &end);
       if (!ret)
        error (_("Could not find location of the end of the range."));
 
-      /* find_line_pc_range returns the start of the next line.  */
+      /* find_pc_range_for_sal returns the start of the next line.  */
       end--;
     }
 
@@ -12851,7 +12851,7 @@ update_static_tracepoint (tracepoint *tp, struct symtab_and_line sal)
 
   pc = sal.pc;
   if (sal.line)
-    find_line_pc (sal.symtab, sal.line, &pc);
+    find_pc_for_line (sal.symtab, sal.line, &pc);
 
   if (target_static_tracepoint_marker_at (pc, &marker))
     {
index cb839e742ff6e8682f07e22a26d7bd6b9e4b8efe..6051cbadefc96bc8a2b4362e2d6d2b69a3e880c5 100644 (file)
@@ -248,7 +248,7 @@ mi_cmd_disassemble (const char *command, const char *const *argv, int argc)
       s = lookup_symtab (current_program_space, file_string);
       if (s == NULL)
        error (_("-data-disassemble: Invalid filename."));
-      if (!find_line_pc (s, line_num, &start))
+      if (!find_pc_for_line (s, line_num, &start))
        error (_("-data-disassemble: Invalid line number"));
       if (find_pc_partial_function (start, NULL, &low, &high) == 0)
        error (_("-data-disassemble: "
index bf1070030e279998ea99a5c0b075ef8c2aa5e3ef..2d91bb1667bf47e1084d704cb9aa228bcf554f8c 100644 (file)
@@ -2355,7 +2355,7 @@ mi_cmd_trace_find (const char *command, const char *const *argv, int argc)
        error (_("Could not find the specified line"));
 
       CORE_ADDR start_pc, end_pc;
-      if (sal.line > 0 && find_line_pc_range (sal, &start_pc, &end_pc))
+      if (sal.line > 0 && find_pc_range_for_sal (sal, &start_pc, &end_pc))
        tfind_1 (tfind_range, 0, start_pc, end_pc - 1, 0);
       else
        error (_("Could not find the specified line"));
index 1018d2ce6be34663e7ca0bf13105ab8f45501f6e..27fa657afb819499149931585f75524c57d10c11 100644 (file)
@@ -1574,7 +1574,7 @@ info_line_command (const char *arg, int from_tty)
          gdb_printf ("\n");
        }
       else if (sal.line > 0
-              && find_line_pc_range (sal, &start_pc, &end_pc))
+              && find_pc_range_for_sal (sal, &start_pc, &end_pc))
        {
          gdbarch *gdbarch = sal.symtab->compunit ()->objfile ()->arch ();
 
index bb17276102f9605b3157772cb3f352364eb217a8..fdba441ec5413dd8240bf07c3090960cfb6ff6e4 100644 (file)
@@ -3390,7 +3390,7 @@ find_pcs_for_symtab_line (struct symtab *symtab, int line,
    The source file is specified with a struct symtab.  */
 
 bool
-find_line_pc (struct symtab *symtab, int line, CORE_ADDR *pc)
+find_pc_for_line (struct symtab *symtab, int line, CORE_ADDR *pc)
 {
   const struct linetable *l;
   int ind;
@@ -3417,14 +3417,14 @@ find_line_pc (struct symtab *symtab, int line, CORE_ADDR *pc)
    Returns false if could not find the specified line.  */
 
 bool
-find_line_pc_range (struct symtab_and_line sal, CORE_ADDR *startptr,
+find_pc_range_for_sal (struct symtab_and_line sal, CORE_ADDR *startptr,
                    CORE_ADDR *endptr)
 {
   CORE_ADDR startaddr;
   struct symtab_and_line found_sal;
 
   startaddr = sal.pc;
-  if (startaddr == 0 && !find_line_pc (sal.symtab, sal.line, &startaddr))
+  if (startaddr == 0 && !find_pc_for_line (sal.symtab, sal.line, &startaddr))
     return false;
 
   /* This whole function is based on address.  For example, if line 10 has
index 3a2088cb6af3d8d52d3637736c758b07e065f1a1..6c19f138c2f4b5ad3430b8c110cec4ec33ae1f84 100644 (file)
@@ -2434,10 +2434,10 @@ extern struct symtab *find_symtab_for_pc (CORE_ADDR);
 
 /* Given a symtab and line number, return the pc there.  */
 
-extern bool find_line_pc (struct symtab *, int, CORE_ADDR *);
+extern bool find_pc_for_line (struct symtab *, int, CORE_ADDR *);
 
-extern bool find_line_pc_range (struct symtab_and_line, CORE_ADDR *,
-                               CORE_ADDR *);
+extern bool find_pc_range_for_sal (struct symtab_and_line, CORE_ADDR *,
+                                  CORE_ADDR *);
 
 extern void resolve_sal_pc (struct symtab_and_line *);
 
index c0db7c8e6fa45e60ed15cba9f3c1cdfc0a91dc78..9b84fbe384ab584d2ed8d84eb9e6bfefca986aeb 100644 (file)
@@ -2347,7 +2347,7 @@ tfind_line_command (const char *args, int from_tty)
     error (_("No line number information available."));
 
   CORE_ADDR start_pc, end_pc;
-  if (sal.line > 0 && find_line_pc_range (sal, &start_pc, &end_pc))
+  if (sal.line > 0 && find_pc_range_for_sal (sal, &start_pc, &end_pc))
     {
       if (start_pc == end_pc)
        {
@@ -2362,7 +2362,7 @@ tfind_line_command (const char *args, int from_tty)
          gdb_printf (" but contains no code.\n");
          sal = find_sal_for_pc (start_pc, 0);
          if (sal.line > 0
-             && find_line_pc_range (sal, &start_pc, &end_pc)
+             && find_pc_range_for_sal (sal, &start_pc, &end_pc)
              && start_pc != end_pc)
            gdb_printf ("Attempting to find line %ps instead.\n",
                        styled_string (line_number_style.style (),
index 07453b4ea5e7ccda0e36692269c801b079d67330..b49a33b8413620ad76f01ed8159a88b62d8b6afe 100644 (file)
@@ -401,7 +401,7 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
            = get_current_source_symtab_and_line (current_program_space);
 
          if (sal.symtab != nullptr)
-           find_line_pc (sal.symtab, sal.line, &addr);
+           find_pc_for_line (sal.symtab, sal.line, &addr);
        }
 
       if (addr == 0)
index 9485ad960022fe69f8c4787956d58bb6ebe5a8ec..4a2f42352739722bc44dc2ff739639c8d4b2d650 100644 (file)
@@ -172,7 +172,7 @@ tui_source_window::do_scroll_vertical (int num_to_scroll)
        line_no = m_start_line_or_addr.u.line_no;
 
       cursal.line = line_no;
-      find_line_pc (cursal.symtab, cursal.line, &cursal.pc);
+      find_pc_for_line (cursal.symtab, cursal.line, &cursal.pc);
       for (struct tui_source_window_base *win_info : tui_source_windows ())
        win_info->update_source_window_as_is (arch, cursal);
     }
@@ -238,7 +238,7 @@ tui_source_window::display_start_addr (struct gdbarch **gdbarch_p,
   symtab_and_line cursal = get_current_source_symtab_and_line (current_program_space);
 
   *gdbarch_p = m_gdbarch;
-  find_line_pc (cursal.symtab, m_start_line_or_addr.u.line_no, addr_p);
+  find_pc_for_line (cursal.symtab, m_start_line_or_addr.u.line_no, addr_p);
 }
 
 /* See tui-winsource.h.  */
index 27f682b7ea80a579a9b607b9c3dfda1005c30aa3..e6bbe1535a3061e2e4915778f464a5ab1e2a1d1e 100644 (file)
@@ -208,7 +208,7 @@ tui_update_source_windows_with_line (struct symtab_and_line sal)
   struct gdbarch *gdbarch = nullptr;
   if (sal.symtab != nullptr)
     {
-      find_line_pc (sal.symtab, sal.line, &sal.pc);
+      find_pc_for_line (sal.symtab, sal.line, &sal.pc);
       gdbarch = sal.symtab->compunit ()->objfile ()->arch ();
     }