[RFA] Fix a compilation failure in rs6000-nat.c

Kevin Buettner kevinb@redhat.com
Wed Jul 2 18:02:00 GMT 2003


On Jun 30,  5:40pm, Joel Brobecker wrote:

> A leftover of the SIZEOF_SECTION_OFFSETS removal saga... Not sure how
> I missed it the last time I tryed building GDB on AiX, but I lack the
> time to investigate further...
> 
> 2003-06-30  Joel Brobecker  <brobecker@gnat.com>
> 
>         * rs6000-nat.c (vmap_symtab): Fix compilation error.
> 
> tested on ppc-aix 4.3.2.0.
> 
> Ok to apply?

Almost...

> I think the gdb6 branch has the same problem :-(. I will double-check.
> If I get the approval for this patch, and it turns out that we need it
> on gdb6, can I apply it there too?
> 
> Index: rs6000-nat.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/rs6000-nat.c,v
> retrieving revision 1.31
> diff -u -p -r1.31 rs6000-nat.c
> --- rs6000-nat.c	10 Jun 2003 20:34:09 -0000	1.31
> +++ rs6000-nat.c	1 Jul 2003 00:31:09 -0000
> @@ -664,7 +664,9 @@ vmap_symtab (struct vmap *vp)
>      /* If symbols are not yet loaded, offsets are not yet valid. */
>      return;
>  
> -  new_offsets = (struct section_offsets *) alloca (SIZEOF_SECTION_OFFSETS);
> +  new_offsets =
> +    (struct section_offsets *) alloca (objfile->num_sections *
> +                                       sizeof (struct section_offsets));

I don't think this is quite right.  After looking at the other
substitutions that were done along these lines[1], I think this should be:

     new_offsets = (struct section_offsets *)
	alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections));

Feel free to adjust the formatting.

If you agree that this is the correct fix, please apply this change
to both the mainline and gdb 6.0 branch.  (But please post an updated
patch showing what you committed.)

Thanks!

Kevin

[1] http://sources.redhat.com/ml/gdb-patches/2003-05/msg00237.html

P.S.  I just noticed that remote-vx.c also still uses
SIZEOF_SECTION_OFFSETS.  You're preapproved to fix this one too if you
want...



More information about the Gdb-patches mailing list