This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch +const 1/2] Add const to many struct objfile *


2014-12-03  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Add const to struct objfile *.
	* minsyms.c, minsyms.h, symtab.c, symtab.h: In these files.

diff --git a/gdb/minsyms.c b/gdb/minsyms.c
index 2463be4..8057fda 100644
--- a/gdb/minsyms.c
+++ b/gdb/minsyms.c
@@ -404,7 +404,7 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf)
 
 struct minimal_symbol *
 lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name,
-				  struct objfile *objf)
+				  const struct objfile *objf)
 {
   struct objfile *objfile;
   struct minimal_symbol *msymbol;
diff --git a/gdb/minsyms.h b/gdb/minsyms.h
index 807e5ee..5e52367 100644
--- a/gdb/minsyms.h
+++ b/gdb/minsyms.h
@@ -206,7 +206,7 @@ struct bound_minimal_symbol lookup_minimal_symbol_solib_trampoline
    symbol that matches, or NULL if no match is found.  */
 
 struct minimal_symbol *lookup_minimal_symbol_by_pc_name
-    (CORE_ADDR, const char *, struct objfile *);
+    (CORE_ADDR, const char *, const struct objfile *);
 
 /* Search through the minimal symbol table for each objfile and find
    the symbol whose address is the largest address that is still less
diff --git a/gdb/symtab.c b/gdb/symtab.c
index a52f7c0..79035f6 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1061,7 +1061,7 @@ expand_symtab_containing_pc (CORE_ADDR pc, struct obj_section *section)
 
 void
 fixup_section (struct general_symbol_info *ginfo,
-	       CORE_ADDR addr, struct objfile *objfile)
+	       CORE_ADDR addr, const struct objfile *objfile)
 {
   struct minimal_symbol *msym;
 
@@ -1141,7 +1141,7 @@ fixup_section (struct general_symbol_info *ginfo,
 }
 
 struct symbol *
-fixup_symbol_section (struct symbol *sym, struct objfile *objfile)
+fixup_symbol_section (struct symbol *sym, const struct objfile *objfile)
 {
   CORE_ADDR addr;
 
@@ -1561,7 +1561,7 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile,
 	  if (sym)
 	    {
 	      block_found = block;
-	      return fixup_symbol_section (sym, (struct objfile *)objfile);
+	      return fixup_symbol_section (sym, objfile);
 	    }
 	}
 
@@ -1580,8 +1580,9 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile,
    static symbols.  */
 
 static struct symbol *
-lookup_symbol_in_objfile_symtabs (struct objfile *objfile, int block_index,
-				  const char *name, const domain_enum domain)
+lookup_symbol_in_objfile_symtabs (const struct objfile *objfile,
+                                  int block_index, const char *name,
+				  const domain_enum domain)
 {
   struct compunit_symtab *cust;
 
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 57d234d..82ca77f 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1426,7 +1426,7 @@ extern CORE_ADDR skip_prologue_using_sal (struct gdbarch *gdbarch,
 					  CORE_ADDR func_addr);
 
 extern struct symbol *fixup_symbol_section (struct symbol *,
-					    struct objfile *);
+					    const struct objfile *);
 
 /* Symbol searching */
 /* Note: struct symbol_search, search_symbols, et.al. are declared here,
@@ -1484,7 +1484,7 @@ extern struct symbol *
 int producer_is_realview (const char *producer);
 
 void fixup_section (struct general_symbol_info *ginfo,
-		    CORE_ADDR addr, struct objfile *objfile);
+		    CORE_ADDR addr, const struct objfile *objfile);
 
 /* Look up objfile containing BLOCK.  */
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]