diff mbox

expand_symtab_containing_pc: Renamed from find_pc_sect_symtab_via_partial

Message ID m3vbmo0zar.fsf@sspiff.org
State New
Headers show

Commit Message

Doug Evans Nov. 9, 2014, 10:44 p.m. UTC
Hi.

This patch just renames one function.
Its only caller is in stack.c where we're printing a backtrace
with non-zero info_verbose and we want to make sure all the needed
symtabs are expanded before printing the backtrace
so that debug symbol reading messages don't pollute the backtrace.

I think the new name of the function makes clearer to the reader
what is going on.

2014-11-09  Doug Evans  <xdje42@gmail.com>

	* symtab.c (expand_symtab_containing_pc): Renamed from
	find_pc_sect_symtab_via_partial.  All callers updated.

Comments

Doug Evans Nov. 15, 2014, 4:20 p.m. UTC | #1
On Sun, Nov 9, 2014 at 2:44 PM, Doug Evans <xdje42@gmail.com> wrote:
> Hi.
>
> This patch just renames one function.
> Its only caller is in stack.c where we're printing a backtrace
> with non-zero info_verbose and we want to make sure all the needed
> symtabs are expanded before printing the backtrace
> so that debug symbol reading messages don't pollute the backtrace.
>
> I think the new name of the function makes clearer to the reader
> what is going on.
>
> 2014-11-09  Doug Evans  <xdje42@gmail.com>
>
>         * symtab.c (expand_symtab_containing_pc): Renamed from
>         find_pc_sect_symtab_via_partial.  All callers updated.

Committed.
diff mbox

Patch

diff --git a/gdb/stack.c b/gdb/stack.c
index 4b34e0b..35f491d 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1776,7 +1776,7 @@  backtrace_command_1 (char *count_exp, int show_locals, int no_filters,
 
 	  QUIT;
 	  pc = get_frame_address_in_block (fi);
-	  find_pc_sect_symtab_via_partial (pc, find_pc_mapped_section (pc));
+	  expand_symtab_containing_pc (pc, find_pc_mapped_section (pc));
 	}
     }
 
diff --git a/gdb/symtab.c b/gdb/symtab.c
index df974bf..7ee4ea2 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1050,8 +1050,10 @@  matching_obj_sections (struct obj_section *obj_first,
   return 0;
 }
 
-struct symtab *
-find_pc_sect_symtab_via_partial (CORE_ADDR pc, struct obj_section *section)
+/* See symtab.h.  */
+
+void
+expand_symtab_containing_pc (CORE_ADDR pc, struct obj_section *section)
 {
   struct objfile *objfile;
   struct bound_minimal_symbol msymbol;
@@ -1066,20 +1068,18 @@  find_pc_sect_symtab_via_partial (CORE_ADDR pc, struct obj_section *section)
 	  || MSYMBOL_TYPE (msymbol.minsym) == mst_abs
 	  || MSYMBOL_TYPE (msymbol.minsym) == mst_file_data
 	  || MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss))
-    return NULL;
+    return;
 
   ALL_OBJFILES (objfile)
   {
-    struct symtab *result = NULL;
+    struct symtab *s = NULL;
 
     if (objfile->sf)
-      result = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol,
-						     pc, section, 0);
-    if (result)
-      return result;
+      s = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol,
+						pc, section, 0);
+    if (s != NULL)
+      return;
   }
-
-  return NULL;
 }
 
 /* Debug symbols usually don't have section information.  We need to dig that
diff --git a/gdb/symtab.h b/gdb/symtab.h
index d78b832..d69fbcf 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1163,10 +1163,9 @@  extern int find_pc_partial_function (CORE_ADDR, const char **, CORE_ADDR *,
 
 extern void clear_pc_function_cache (void);
 
-/* lookup partial symbol table by address and section.  */
+/* Expand symtab containing PC, SECTION if not already expanded.  */
 
-extern struct symtab *find_pc_sect_symtab_via_partial (CORE_ADDR,
-						       struct obj_section *);
+extern void expand_symtab_containing_pc (CORE_ADDR, struct obj_section *);
 
 /* lookup full symbol table by address.  */