public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM]  archer-tromey-multi-inferior: make objfile split work
@ 2010-09-15 18:34 tromey
  0 siblings, 0 replies; only message in thread
From: tromey @ 2010-09-15 18:34 UTC (permalink / raw)
  To: archer-commits

The branch, archer-tromey-multi-inferior has been updated
       via  2525d06a7ec809dedf0c5317839759176ee85eba (commit)
       via  bf57a5071e2083a19617bce7a34a056a0459809f (commit)
       via  f0656879c3e9302b7c1c37d5d466b3150c8e6e4e (commit)
      from  cccfdbdc7c0fdd353e4014d92204e5503e23a108 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit 2525d06a7ec809dedf0c5317839759176ee85eba
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Sep 15 12:33:40 2010 -0600

    make objfile split work

commit bf57a5071e2083a19617bce7a34a056a0459809f
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Sep 15 11:37:01 2010 -0600

    ran rewriting script, then fixed remaining errors
    this compiles but does not actually work

commit f0656879c3e9302b7c1c37d5d466b3150c8e6e4e
Author: Tom Tromey <tromey@redhat.com>
Date:   Wed Sep 15 08:20:11 2010 -0600

    separate out objfile; fix headers; add rewriting script

-----------------------------------------------------------------------

Summary of changes:
 gdb/ada-lang.c            |    8 +-
 gdb/arm-tdep.c            |    8 +-
 gdb/blockframe.c          |    4 +-
 gdb/buildsym.c            |   34 +++---
 gdb/coff-pe-read.c        |    6 +-
 gdb/coffread.c            |   76 ++++++------
 gdb/cp-namespace.c        |   22 ++--
 gdb/cp-support.c          |    4 +-
 gdb/dbxread.c             |  136 ++++++++++----------
 gdb/dwarf2-frame.c        |   20 ++--
 gdb/dwarf2loc.c           |   16 ++--
 gdb/dwarf2read.c          |  238 ++++++++++++++++++------------------
 gdb/elfread.c             |   60 +++++-----
 gdb/expprint.c            |    2 +-
 gdb/gcore.c               |    4 +-
 gdb/gdb-stabs.h           |    2 +-
 gdb/gdbtypes.c            |   14 +-
 gdb/gdbtypes.h            |   11 +-
 gdb/hppa-hpux-tdep.c      |    6 +-
 gdb/hppa-linux-tdep.c     |    2 +-
 gdb/hppa-tdep.c           |   34 +++---
 gdb/hppabsd-tdep.c        |    4 +-
 gdb/jv-lang.c             |   26 ++--
 gdb/linux-thread-db.c     |    6 +-
 gdb/maint.c               |    8 +-
 gdb/mdebugread.c          |  154 ++++++++++++------------
 gdb/minsyms.c             |   74 ++++++------
 gdb/mipsread.c            |    6 +-
 gdb/objc-lang.c           |    2 +-
 gdb/objfiles.c            |  282 ++++++++++++++++++++++---------------------
 gdb/objfiles.h            |   89 ++++++++++---
 gdb/parse.c               |    6 +-
 gdb/printcmd.c            |   14 +-
 gdb/progspace.c           |    2 +-
 gdb/psympriv.h            |    2 +-
 gdb/psymtab.c             |  138 +++++++++++-----------
 gdb/python/py-auto-load.c |    6 +-
 gdb/python/py-objfile.c   |    4 +-
 gdb/python/py-progspace.c |    4 +-
 gdb/remote.c              |   10 +-
 gdb/rewrite-objfile.el    |  143 ++++++++++++++++++++++
 gdb/solib-frv.c           |   12 +-
 gdb/solib-som.c           |   10 +-
 gdb/solib-spu.c           |   16 ++--
 gdb/solib-svr4.c          |   14 +-
 gdb/solib.c               |    6 +-
 gdb/source.c              |   16 ++--
 gdb/spu-multiarch.c       |    4 +-
 gdb/spu-tdep.c            |   32 +++---
 gdb/stabsread.c           |   54 ++++----
 gdb/symfile-mem.c         |    2 +-
 gdb/symfile.c             |  296 ++++++++++++++++++++++----------------------
 gdb/symmisc.c             |   50 ++++----
 gdb/symtab.c              |   70 ++++++------
 gdb/symtab.h              |    2 +-
 gdb/target.c              |   16 ++--
 gdb/xcoffread.c           |  202 +++++++++++++++---------------
 gdb/xstormy16-tdep.c      |    2 +-
 58 files changed, 1342 insertions(+), 1149 deletions(-)
 create mode 100755 gdb/rewrite-objfile.el

First 500 lines of diff:
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index d95be1d..4e22856 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -1221,7 +1221,7 @@ ada_decode_symbol (const struct general_symbol_info *gsymbol)
 	  struct objfile *objf = gsymbol->obj_section->objfile;
 
 	  *resultp = obsavestring (decoded, strlen (decoded),
-				   &objf->objfile_obstack);
+				   &OBJFILE_OBJFILE_OBSTACK (objf));
         }
       /* Sometimes, we can't find a corresponding objfile, in which
          case, we put the result on the heap.  Since we only decode
@@ -4679,8 +4679,8 @@ ada_add_non_local_symbols (struct obstack *obstackp, const char *name,
 
   ALL_OBJFILES (iter, objfile)
   {
-    if (objfile->sf)
-      objfile->sf->qf->map_ada_symtabs (objfile, wild_match, is_name_suffix,
+    if (OBJFILE_SF (objfile))
+      OBJFILE_SF (objfile)->qf->map_ada_symtabs (objfile, wild_match, is_name_suffix,
 					ada_add_psyms, name,
 					global, domain,
 					is_wild_match, &data);
@@ -10322,7 +10322,7 @@ is_known_support_routine (struct frame_info *frame)
       if (re_exec (sal.symtab->filename))
         return 1;
       if (sal.symtab->objfile != NULL
-          && re_exec (sal.symtab->objfile->name))
+          && re_exec (OBJFILE_NAME (sal.symtab->objfile)))
         return 1;
     }
 
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 31f17f1..816b8e0 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -6163,7 +6163,7 @@ arm_objfile_data_free (struct objfile *objfile, void *arg)
   struct arm_per_objfile *data = arg;
   unsigned int i;
 
-  for (i = 0; i < objfile->obfd->section_count; i++)
+  for (i = 0; i < OBJFILE_OBFD (objfile)->section_count; i++)
     VEC_free (arm_mapping_symbol_s, data->section_maps[i]);
 }
 
@@ -6183,11 +6183,11 @@ arm_record_special_symbol (struct gdbarch *gdbarch, struct objfile *objfile,
   data = objfile_data (objfile, arm_objfile_data_key);
   if (data == NULL)
     {
-      data = OBSTACK_ZALLOC (&objfile->objfile_obstack,
+      data = OBSTACK_ZALLOC (&OBJFILE_OBJFILE_OBSTACK (objfile),
 			     struct arm_per_objfile);
       set_objfile_data (objfile, arm_objfile_data_key, data);
-      data->section_maps = OBSTACK_CALLOC (&objfile->objfile_obstack,
-					   objfile->obfd->section_count,
+      data->section_maps = OBSTACK_CALLOC (&OBJFILE_OBJFILE_OBSTACK (objfile),
+					   OBJFILE_OBFD (objfile)->section_count,
 					   VEC(arm_mapping_symbol_s) *);
     }
   map_p = &data->section_maps[bfd_get_section (sym)->index];
diff --git a/gdb/blockframe.c b/gdb/blockframe.c
index 38590c6..3efc87c 100644
--- a/gdb/blockframe.c
+++ b/gdb/blockframe.c
@@ -216,8 +216,8 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address,
   msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section);
   ALL_OBJFILES (iter, objfile)
   {
-    if (objfile->sf)
-      symtab = objfile->sf->qf->find_pc_sect_symtab (objfile, msymbol,
+    if (OBJFILE_SF (objfile))
+      symtab = OBJFILE_SF (objfile)->qf->find_pc_sect_symtab (objfile, msymbol,
 						     mapped_pc, section, 0);
     if (symtab)
       break;
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
index e690a0c..f61342b 100644
--- a/gdb/buildsym.c
+++ b/gdb/buildsym.c
@@ -241,16 +241,16 @@ finish_block (struct symbol *symbol, struct pending **listhead,
   struct pending_block *pblock;
   struct pending_block *opblock;
 
-  block = allocate_block (&objfile->objfile_obstack);
+  block = allocate_block (&OBJFILE_OBJFILE_OBSTACK (objfile));
 
   if (symbol)
     {
-      BLOCK_DICT (block) = dict_create_linear (&objfile->objfile_obstack,
+      BLOCK_DICT (block) = dict_create_linear (&OBJFILE_OBJFILE_OBSTACK (objfile),
 					       *listhead);
     }
   else
     {
-      BLOCK_DICT (block) = dict_create_hashed (&objfile->objfile_obstack,
+      BLOCK_DICT (block) = dict_create_hashed (&OBJFILE_OBJFILE_OBSTACK (objfile),
 					       *listhead);
     }
 
@@ -386,7 +386,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
       opblock = pblock;
     }
 
-  block_set_using (block, using_directives, &objfile->objfile_obstack);
+  block_set_using (block, using_directives, &OBJFILE_OBJFILE_OBSTACK (objfile));
   using_directives = NULL;
 
   record_pending_block (objfile, block, opblock);
@@ -409,7 +409,7 @@ record_pending_block (struct objfile *objfile, struct block *block,
   struct pending_block *pblock;
 
   pblock = (struct pending_block *)
-    obstack_alloc (&objfile->objfile_obstack, sizeof (struct pending_block));
+    obstack_alloc (&OBJFILE_OBJFILE_OBSTACK (objfile), sizeof (struct pending_block));
   pblock->block = block;
   if (opblock)
     {
@@ -469,7 +469,7 @@ make_blockvector (struct objfile *objfile)
     }
 
   blockvector = (struct blockvector *)
-    obstack_alloc (&objfile->objfile_obstack,
+    obstack_alloc (&OBJFILE_OBJFILE_OBSTACK (objfile),
 		   (sizeof (struct blockvector)
 		    + (i - 1) * sizeof (struct block *)));
 
@@ -491,7 +491,7 @@ make_blockvector (struct objfile *objfile)
      blockvector.  */
   if (pending_addrmap && pending_addrmap_interesting)
     BLOCKVECTOR_MAP (blockvector)
-      = addrmap_create_fixed (pending_addrmap, &objfile->objfile_obstack);
+      = addrmap_create_fixed (pending_addrmap, &OBJFILE_OBJFILE_OBSTACK (objfile));
   else
     BLOCKVECTOR_MAP (blockvector) = 0;
         
@@ -964,7 +964,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
 
   /* Reordered executables may have out of order pending blocks; if
      OBJF_REORDERED is true, then sort the pending blocks.  */
-  if ((objfile->flags & OBJF_REORDERED) && pending_blocks)
+  if ((OBJFILE_FLAGS (objfile) & OBJF_REORDERED) && pending_blocks)
     {
       unsigned count = 0;
       struct pending_block *pb;
@@ -1025,8 +1025,8 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
     }
 
   /* Read the line table if it has to be read separately.  */
-  if (objfile->sf->sym_read_linetable != NULL)
-    objfile->sf->sym_read_linetable ();
+  if (OBJFILE_SF (objfile)->sym_read_linetable != NULL)
+    OBJFILE_SF (objfile)->sym_read_linetable ();
 
   /* Handle the case where the debug info specifies a different path
      for the main source file.  It can cause us to lose track of its
@@ -1053,7 +1053,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
 	      /* Like the pending blocks, the line table may be
 	         scrambled in reordered executables.  Sort it if
 	         OBJF_REORDERED is true.  */
-	      if (objfile->flags & OBJF_REORDERED)
+	      if (OBJFILE_FLAGS (objfile) & OBJF_REORDERED)
 		qsort (subfile->line_vector->item,
 		       subfile->line_vector->nitems,
 		     sizeof (struct linetable_entry), compare_line_numbers);
@@ -1072,7 +1072,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
 	    {
 	      /* Reallocate the line table on the symbol obstack */
 	      symtab->linetable = (struct linetable *)
-		obstack_alloc (&objfile->objfile_obstack, linetablesize);
+		obstack_alloc (&OBJFILE_OBJFILE_OBSTACK (objfile), linetablesize);
 	      memcpy (symtab->linetable, subfile->line_vector, linetablesize);
 	    }
 	  else
@@ -1084,7 +1084,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
 	    {
 	      /* Reallocate the dirname on the symbol obstack */
 	      symtab->dirname = (char *)
-		obstack_alloc (&objfile->objfile_obstack,
+		obstack_alloc (&OBJFILE_OBJFILE_OBSTACK (objfile),
 			       strlen (subfile->dirname) + 1);
 	      strcpy (symtab->dirname, subfile->dirname);
 	    }
@@ -1108,14 +1108,14 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
 	    {
 	      symtab->debugformat = obsavestring (subfile->debugformat,
 					      strlen (subfile->debugformat),
-						  &objfile->objfile_obstack);
+						  &OBJFILE_OBJFILE_OBSTACK (objfile));
 	    }
 
 	  /* Similarly for the producer.  */
 	  if (subfile->producer != NULL)
 	    symtab->producer = obsavestring (subfile->producer,
 					     strlen (subfile->producer),
-					     &objfile->objfile_obstack);
+					     &OBJFILE_OBJFILE_OBSTACK (objfile));
 
 	  /* All symtabs for the main file and the subfiles share a
 	     blockvector, so we need to clear primary for everything
@@ -1137,8 +1137,8 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section)
                  on the objfile obstack.  */
               struct symtab *s;
 
-              if (objfile->symtabs == subfile->symtab)
-                objfile->symtabs = objfile->symtabs->next;
+              if (OBJFILE_SYMTABS (objfile) == subfile->symtab)
+                OBJFILE_SYMTABS (objfile) = OBJFILE_SYMTABS (objfile)->next;
               else
                 ALL_OBJFILE_SYMTABS (objfile, s)
                   if (s->next == subfile->symtab)
diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
index 3e2b89c..9f13663 100644
--- a/gdb/coff-pe-read.c
+++ b/gdb/coff-pe-read.c
@@ -183,7 +183,7 @@ pe_as32 (void *ptr)
 void
 read_pe_exported_syms (struct objfile *objfile)
 {
-  bfd *dll = objfile->obfd;
+  bfd *dll = OBJFILE_OBFD (objfile);
   unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
   unsigned long export_rva, export_size, nsections, secptr, expptr;
   unsigned long exp_funcbase;
@@ -204,7 +204,7 @@ read_pe_exported_syms (struct objfile *objfile)
 
   struct cleanup *back_to = 0;
 
-  char const *target = bfd_get_target (objfile->obfd);
+  char const *target = bfd_get_target (OBJFILE_OBFD (objfile));
 
   is_pe64 = (strcmp (target, "pe-x86-64") == 0
 	     || strcmp (target, "pei-x86-64") == 0);
@@ -322,7 +322,7 @@ read_pe_exported_syms (struct objfile *objfile)
   for (i = 0; i < PE_SECTION_TABLE_SIZE; i++)
     {
       section_data[i].vma_offset
-	+= ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+	+= ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
     }
 
   /* Truncate name at first dot. Should maybe also convert to all
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 9232fc1..48d3ce8 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -276,7 +276,7 @@ cs_to_bfd_section (struct coff_symbol *cs, struct objfile *objfile)
 
   args.targ_index = cs->c_secnum;
   args.resultp = &sect;
-  bfd_map_over_sections (objfile->obfd, find_targ_sec, &args);
+  bfd_map_over_sections (OBJFILE_OBFD (objfile), find_targ_sec, &args);
   return sect;
 }
 
@@ -445,21 +445,21 @@ static void
 coff_symfile_init (struct objfile *objfile)
 {
   /* Allocate struct to keep track of stab reading. */
-  objfile->deprecated_sym_stab_info = (struct dbx_symfile_info *)
+  OBJFILE_DEPRECATED_SYM_STAB_INFO (objfile) = (struct dbx_symfile_info *)
     xmalloc (sizeof (struct dbx_symfile_info));
 
-  memset (objfile->deprecated_sym_stab_info, 0,
+  memset (OBJFILE_DEPRECATED_SYM_STAB_INFO (objfile), 0,
 	  sizeof (struct dbx_symfile_info));
 
   /* Allocate struct to keep track of the symfile */
-  objfile->deprecated_sym_private = xmalloc (sizeof (struct coff_symfile_info));
+  OBJFILE_DEPRECATED_SYM_PRIVATE (objfile) = xmalloc (sizeof (struct coff_symfile_info));
 
-  memset (objfile->deprecated_sym_private, 0, sizeof (struct coff_symfile_info));
+  memset (OBJFILE_DEPRECATED_SYM_PRIVATE (objfile), 0, sizeof (struct coff_symfile_info));
 
   /* COFF objects may be reordered, so set OBJF_REORDERED.  If we
      find this causes a significant slowdown in gdb then we could
      set it in the debug symbol readers only when necessary.  */
-  objfile->flags |= OBJF_REORDERED;
+  OBJFILE_FLAGS (objfile) |= OBJF_REORDERED;
 
   init_entry_point_info (objfile);
 }
@@ -509,7 +509,7 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
 {
   struct coff_symfile_info *info;
   struct dbx_symfile_info *dbxinfo;
-  bfd *abfd = objfile->obfd;
+  bfd *abfd = OBJFILE_OBFD (objfile);
   coff_data_type *cdata = coff_data (abfd);
   char *name = bfd_get_filename (abfd);
   int val;
@@ -519,8 +519,8 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
   struct cleanup *back_to, *cleanup_minimal_symbols;
   int stabstrsize;
   
-  info = (struct coff_symfile_info *) objfile->deprecated_sym_private;
-  dbxinfo = objfile->deprecated_sym_stab_info;
+  info = (struct coff_symfile_info *) OBJFILE_DEPRECATED_SYM_PRIVATE (objfile);
+  dbxinfo = OBJFILE_DEPRECATED_SYM_STAB_INFO (objfile);
   symfile_bfd = abfd;		/* Kludge for swap routines */
 
 /* WARNING WILL ROBINSON!  ACCESSING BFD-PRIVATE DATA HERE!  FIXME!  */
@@ -552,8 +552,8 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
      FIXME: We should use BFD to read the symbol table, and thus avoid
      this problem.  */
   pe_file =
-    strncmp (bfd_get_target (objfile->obfd), "pe", 2) == 0
-    || strncmp (bfd_get_target (objfile->obfd), "epoc-pe", 7) == 0;
+    strncmp (bfd_get_target (OBJFILE_OBFD (objfile)), "pe", 2) == 0
+    || strncmp (bfd_get_target (OBJFILE_OBFD (objfile)), "epoc-pe", 7) == 0;
 
 /* End of warning */
 
@@ -671,9 +671,9 @@ coff_new_init (struct objfile *ignore)
 static void
 coff_symfile_finish (struct objfile *objfile)
 {
-  if (objfile->deprecated_sym_private != NULL)
+  if (OBJFILE_DEPRECATED_SYM_PRIVATE (objfile) != NULL)
     {
-      xfree (objfile->deprecated_sym_private);
+      xfree (OBJFILE_DEPRECATED_SYM_PRIVATE (objfile));
     }
 
   /* Let stabs reader clean up */
@@ -731,15 +731,15 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
      FIXME: Find out if this has been reported to Sun, whether it has
      been fixed in a later release, etc.  */
 
-  bfd_seek (objfile->obfd, 0, 0);
+  bfd_seek (OBJFILE_OBFD (objfile), 0, 0);
 
   /* Position to read the symbol table. */
-  val = bfd_seek (objfile->obfd, (long) symtab_offset, 0);
+  val = bfd_seek (OBJFILE_OBFD (objfile), (long) symtab_offset, 0);
   if (val < 0)
-    perror_with_name (objfile->name);
+    perror_with_name (OBJFILE_NAME (objfile));
 
   current_objfile = objfile;
-  nlist_bfd_global = objfile->obfd;
+  nlist_bfd_global = OBJFILE_OBFD (objfile);
   nlist_nsyms_global = nsyms;
   last_source_file = NULL;
   memset (opaque_type_chain, 0, sizeof opaque_type_chain);
@@ -786,7 +786,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 	  /* Record all functions -- external and static -- in minsyms. */
 	  int section = cs_to_section (cs, objfile);
 
-	  tmpaddr = cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+	  tmpaddr = cs->c_value + ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
 	  record_minimal_symbol (cs, tmpaddr, mst_text, section, objfile);
 
 	  fcn_line_ptr = main_aux.x_sym.x_fcnary.x_fcn.x_lnnoptr;
@@ -852,7 +852,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 		     followed by a later file with no symbols.  */
 		  if (in_source_file)
 		    complete_symtab (filestring,
-		    cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)),
+		    cs->c_value + ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile)),
 				     main_aux.x_scn.x_scnlen);
 		  in_source_file = 0;
 		}
@@ -924,7 +924,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
  		    || cs->c_sclass == C_THUMBEXTFUNC
  		    || cs->c_sclass == C_THUMBEXT
  		    || (pe_file && (cs->c_sclass == C_STAT)))
-		  tmpaddr += ANOFFSET (objfile->section_offsets, sec);
+		  tmpaddr += ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), sec);
 
 		if (bfd_section->flags & SEC_CODE)
 		  {
@@ -1046,7 +1046,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 			    new->start_addr,
 			    fcn_cs_saved.c_value
 			    + fcn_aux_saved.x_sym.x_misc.x_fsize
-			    + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)),
+			    + ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile)),
 			    objfile
 		);
 	      within_function = 0;
@@ -1057,7 +1057,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 	  if (strcmp (cs->c_name, ".bb") == 0)
 	    {
 	      tmpaddr = cs->c_value;
-	      tmpaddr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+	      tmpaddr += ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
 	      push_context (++depth, tmpaddr);
 	    }
 	  else if (strcmp (cs->c_name, ".eb") == 0)
@@ -1081,7 +1081,7 @@ coff_symtab_read (long symtab_offset, unsigned int nsyms,
 	      if (local_symbols && context_stack_depth > 0)
 		{
 		  tmpaddr =
-		    cs->c_value + ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+		    cs->c_value + ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
 		  /* Make a block for the local symbols within.  */
 		  finish_block (0, &local_symbols, new->old_blocks,
 				new->start_addr, tmpaddr, objfile);
@@ -1132,14 +1132,14 @@ read_one_sym (struct coff_symbol *cs,
   cs->c_symnum = symnum;
   bytes = bfd_bread (temp_sym, local_symesz, nlist_bfd_global);
   if (bytes != local_symesz)
-    error ("%s: error reading symbols", current_objfile->name);
+    error ("%s: error reading symbols", OBJFILE_NAME (current_objfile));
   bfd_coff_swap_sym_in (symfile_bfd, temp_sym, (char *) sym);
   cs->c_naux = sym->n_numaux & 0xff;
   if (cs->c_naux >= 1)
     {
       bytes  = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
       if (bytes != local_auxesz)
-	error ("%s: error reading symbols", current_objfile->name);
+	error ("%s: error reading symbols", OBJFILE_NAME (current_objfile));
       bfd_coff_swap_aux_in (symfile_bfd, temp_aux, sym->n_type, sym->n_sclass,
 			    0, cs->c_naux, (char *) aux);
       /* If more than one aux entry, read past it (only the first aux
@@ -1148,7 +1148,7 @@ read_one_sym (struct coff_symbol *cs,
 	{
 	  bytes = bfd_bread (temp_aux, local_auxesz, nlist_bfd_global);
 	  if (bytes != local_auxesz)
-	    error ("%s: error reading symbols", current_objfile->name);
+	    error ("%s: error reading symbols", OBJFILE_NAME (current_objfile));
 	}
     }
   cs->c_name = getsymname (sym);
@@ -1398,7 +1398,7 @@ enter_linenos (long file_offset, int first_line,
       if (L_LNNO32 (&lptr) && L_LNNO32 (&lptr) <= last_line)
 	{
 	  CORE_ADDR addr = lptr.l_addr.l_paddr;
-	  addr += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+	  addr += ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
 	  record_line (current_subfile, first_line + L_LNNO32 (&lptr),
 		       gdbarch_addr_bits_remove (gdbarch, addr));
 	}
@@ -1507,13 +1507,13 @@ process_coff_symbol (struct coff_symbol *cs,
 		     struct objfile *objfile)
 {
   struct symbol *sym
-    = (struct symbol *) obstack_alloc (&objfile->objfile_obstack,
+    = (struct symbol *) obstack_alloc (&OBJFILE_OBJFILE_OBSTACK (objfile),
 				       sizeof (struct symbol));
   char *name;
 
   memset (sym, 0, sizeof (struct symbol));
   name = cs->c_name;
-  name = EXTERNAL_NAME (name, objfile->obfd);
+  name = EXTERNAL_NAME (name, OBJFILE_OBFD (objfile));
   SYMBOL_LANGUAGE (sym) = current_subfile->language;
   SYMBOL_SET_NAMES (sym, name, strlen (name), 1, objfile);
 
@@ -1524,7 +1524,7 @@ process_coff_symbol (struct coff_symbol *cs,
 
   if (ISFCN (cs->c_type))
     {
-      SYMBOL_VALUE (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+      SYMBOL_VALUE (sym) += ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
       SYMBOL_TYPE (sym) =
 	lookup_function_type (decode_function_type (cs, cs->c_type, aux, objfile));
 
@@ -1554,7 +1554,7 @@ process_coff_symbol (struct coff_symbol *cs,
 	case C_EXT:
 	  SYMBOL_CLASS (sym) = LOC_STATIC;
 	  SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
-	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
 	  add_symbol_to_list (sym, &global_symbols);
 	  break;
 
@@ -1563,7 +1563,7 @@ process_coff_symbol (struct coff_symbol *cs,
 	case C_STAT:
 	  SYMBOL_CLASS (sym) = LOC_STATIC;
 	  SYMBOL_VALUE_ADDRESS (sym) = (CORE_ADDR) cs->c_value;
-	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
+	  SYMBOL_VALUE_ADDRESS (sym) += ANOFFSET (OBJFILE_SECTION_OFFSETS (objfile), SECT_OFF_TEXT (objfile));
 	  if (within_function)
 	    {
 	      /* Static symbol of local scope */
@@ -1958,7 +1958,7 @@ coff_read_struct_type (int index, int length, int lastsym,
     {
       read_one_sym (ms, &sub_sym, &sub_aux);
       name = ms->c_name;
-      name = EXTERNAL_NAME (name, objfile->obfd);
+      name = EXTERNAL_NAME (name, OBJFILE_OBFD (objfile));
 
       switch (ms->c_sclass)
 	{
@@ -1972,7 +1972,7 @@ coff_read_struct_type (int index, int length, int lastsym,
 
 	  /* Save the data.  */
 	  list->field.name =
-	    obsavestring (name, strlen (name), &objfile->objfile_obstack);
+	    obsavestring (name, strlen (name), &OBJFILE_OBJFILE_OBSTACK (objfile));
 	  FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux,
 						  objfile);
 	  SET_FIELD_BITPOS (list->field, 8 * ms->c_value);
@@ -1989,7 +1989,7 @@ coff_read_struct_type (int index, int length, int lastsym,
 
 	  /* Save the data.  */
 	  list->field.name =
-	    obsavestring (name, strlen (name), &objfile->objfile_obstack);


hooks/post-receive
--
Repository for Project Archer.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-09-15 18:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-15 18:34 [SCM] archer-tromey-multi-inferior: make objfile split work tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).