This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH] Fix ANOFFSET problems



Dave, please try these fixes.
Sorry about that.

Will commit tomorrow.

Elena


2000-08-25  Elena Zannoni  <ezannoni@kwikemart.cygnus.com>

	* pa64solib.c (pa64_solib_load_symbols): Don't use ANOFFSET as an
 	lvalue.
	* xcoffread.c (xcoff_symfile_offsets): Ditto
	* somsolib.c (som_solib_section_offsets): Ditto.
	* somread.c (som_symfile_offsets): Ditto.
	* rs6000-nat.c (vmap_symtab): Ditto.
	* remote-vx.c (vx_add_symbols): Ditto.
	* remote-os9k.c (rombug_wait): Ditto.

Index: pa64solib.c
===================================================================
RCS file: /cvs/src/src/gdb/pa64solib.c,v
retrieving revision 1.6
diff -c -u -p -r1.6 pa64solib.c
--- pa64solib.c	2000/08/09 20:09:01	1.6
+++ pa64solib.c	2000/08/26 01:25:07
@@ -319,9 +319,9 @@ pa64_solib_load_symbols (struct so_list 
       return;
     }
 
-  ANOFFSET (so->objfile->section_offsets, SECT_OFF_TEXT (so->objfile))
+  (so->objfile->section_offsets)->offsets[SECT_OFF_TEXT (so->objfile)]
     = so->pa64_solib_desc.text_base;
-  ANOFFSET (so->objfile->section_offsets, SECT_OFF_DATA (so->objfile))
+  (so->objfile->section_offsets)->offsets[SECT_OFF_DATA (so->objfile)]
     = so->pa64_solib_desc.data_base;
 
   /* Relocate all the sections based on where they got loaded.  */
Index: remote-os9k.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-os9k.c,v
retrieving revision 1.4
diff -c -u -p -r1.4 remote-os9k.c
--- remote-os9k.c	2000/07/30 01:48:26	1.4
+++ remote-os9k.c	2000/08/26 01:25:07
@@ -493,8 +493,8 @@ rombug_wait (int pid, struct target_wait
 	new_symfile_objfile (obj_sec->objfile, 1, 0);
       offs = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
       memcpy (offs, symfile_objfile->section_offsets, SIZEOF_SECTION_OFFSETS);
-      ANOFFSET (offs, SECT_OFF_DATA (symfile_objfile)) = addr;
-      ANOFFSET (offs, SECT_OFF_BSS (symfile_objfile)) = addr;
+      offs->offsets[SECT_OFF_DATA (symfile_objfile)]  = addr;
+      offs->offsets[SECT_OFF_BSS (symfile_objfile)]  = addr;
 
       objfile_relocate (symfile_objfile, offs);
     }
Index: remote-vx.c
===================================================================
RCS file: /cvs/src/src/gdb/remote-vx.c,v
retrieving revision 1.6
diff -c -u -p -r1.6 remote-vx.c
--- remote-vx.c	2000/08/02 14:52:10	1.6
+++ remote-vx.c	2000/08/26 01:25:08
@@ -685,9 +685,9 @@ vx_add_symbols (char *name, int from_tty
   bfd_map_over_sections (objfile->obfd, find_sect, &ss);
 
   /* Both COFF and b.out frontends use these SECT_OFF_* values.  */
-  ANOFFSET (offs, SECT_OFF_TEXT (objfile)) = text_addr - ss.text_start;
-  ANOFFSET (offs, SECT_OFF_DATA (objfile)) = data_addr - ss.data_start;
-  ANOFFSET (offs, SECT_OFF_BSS (objfile)) = bss_addr - ss.bss_start;
+  offs->offsets[SECT_OFF_TEXT (objfile)]  = text_addr - ss.text_start;
+  offs->offsets[SECT_OFF_DATA (objfile)] = data_addr - ss.data_start;
+  offs->offsets[SECT_OFF_BSS (objfile)] = bss_addr - ss.bss_start;
   objfile_relocate (objfile, offs);
 }
 
Index: rs6000-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
retrieving revision 1.8
diff -c -u -p -r1.8 rs6000-nat.c
--- rs6000-nat.c	2000/08/11 01:30:11	1.8
+++ rs6000-nat.c	2000/08/26 01:25:08
@@ -609,13 +609,13 @@ vmap_symtab (struct vmap *vp)
   new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
 
   for (i = 0; i < objfile->num_sections; ++i)
-    ANOFFSET (new_offsets, i) = ANOFFSET (objfile->section_offsets, i);
+    new_offsets->offsets[i] = ANOFFSET (objfile->section_offsets, i);
 
   /* The symbols in the object file are linked to the VMA of the section,
      relocate them VMA relative.  */
-  ANOFFSET (new_offsets, SECT_OFF_TEXT (objfile)) = vp->tstart - vp->tvma;
-  ANOFFSET (new_offsets, SECT_OFF_DATA (objfile)) = vp->dstart - vp->dvma;
-  ANOFFSET (new_offsets, SECT_OFF_BSS (objfile)) = vp->dstart - vp->dvma;
+  new_offsets->offsets[SECT_OFF_TEXT (objfile)] = vp->tstart - vp->tvma;
+  new_offsets->offsets[SECT_OFF_DATA (objfile)] = vp->dstart - vp->dvma;
+  new_offsets->offsets[SECT_OFF_BSS (objfile)] = vp->dstart - vp->dvma;
 
   objfile_relocate (objfile, new_offsets);
 }
Index: somread.c
===================================================================
RCS file: /cvs/src/src/gdb/somread.c,v
retrieving revision 1.6
diff -c -u -p -r1.6 somread.c
--- somread.c	2000/07/30 01:48:27	1.6
+++ somread.c	2000/08/26 01:25:08
@@ -477,7 +477,7 @@ som_symfile_offsets (struct objfile *obj
       text_addr = addrs->other[i].addr;
 
       for (i = 0; i < SECT_OFF_MAX; i++)
-	ANOFFSET (objfile->section_offsets, i) = text_addr;
+	(objfile->section_offsets)->offsets[i] = text_addr;
     }
 }
 
Index: somsolib.c
===================================================================
RCS file: /cvs/src/src/gdb/somsolib.c,v
retrieving revision 1.5
diff -c -u -p -r1.5 somsolib.c
--- somsolib.c	2000/07/30 01:48:27	1.5
+++ somsolib.c	2000/08/26 01:25:09
@@ -1378,10 +1378,10 @@ som_solib_section_offsets (struct objfil
 	  asection *private_section;
 
 	  /* The text offset is easy.  */
-	  ANOFFSET (offsets, SECT_OFF_TEXT (objfile))
+	  offsets->offsets[SECT_OFF_TEXT (objfile)]
 	    = (so_list->som_solib.text_addr
 	       - so_list->som_solib.text_link_addr);
-	  ANOFFSET (offsets, SECT_OFF_RODATA (objfile))
+	  offsets->offsets[SECT_OFF_RODATA (objfile)]
 	    = ANOFFSET (offsets, SECT_OFF_TEXT (objfile));
 
 	  /* We should look at presumed_dp in the SOM header, but
@@ -1391,13 +1391,13 @@ som_solib_section_offsets (struct objfil
 	  if (!private_section)
 	    {
 	      warning ("Unable to find $PRIVATE$ in shared library!");
-	      ANOFFSET (offsets, SECT_OFF_DATA (objfile)) = 0;
-	      ANOFFSET (offsets, SECT_OFF_BSS (objfile)) = 0;
+	      offsets->offsets[SECT_OFF_DATA (objfile)] = 0;
+	      offsets->offsets[SECT_OFF_BSS (objfile)] = 0;
 	      return 1;
 	    }
-	  ANOFFSET (offsets, SECT_OFF_DATA (objfile))
+	  offsets->offsets[SECT_OFF_DATA (objfile)]
 	    = (so_list->som_solib.data_start - private_section->vma);
-	  ANOFFSET (offsets, SECT_OFF_BSS (objfile))
+	  offsets->offsets[SECT_OFF_BSS (objfile)]
 	    = ANOFFSET (offsets, SECT_OFF_DATA (objfile));
 	  return 1;
 	}
Index: xcoffread.c
===================================================================
RCS file: /cvs/src/src/gdb/xcoffread.c,v
retrieving revision 1.8
diff -c -u -p -r1.8 xcoffread.c
--- xcoffread.c	2000/08/07 15:16:15	1.8
+++ xcoffread.c	2000/08/26 01:25:09
@@ -2744,7 +2744,7 @@ xcoff_symfile_offsets (struct objfile *o
 	 sensibly), so just ignore the addr parameter and use 0.
 	 rs6000-nat.c will set the correct section offsets via
 	 objfile_relocate.  */
-	ANOFFSET (objfile->section_offsets, i) = 0;
+	(objfile->section_offsets)->offsets[i] = 0;
     }
 }
 



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