Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Joel Brobecker <brobecker@gnat.com>, gdb-patches@sources.redhat.com
Subject: Re: [RFA] Fix a compilation failure in rs6000-nat.c
Date: Wed, 02 Jul 2003 18:02:00 -0000	[thread overview]
Message-ID: <1030702180245.ZM1441@localhost.localdomain> (raw)
In-Reply-To: Joel Brobecker <brobecker@gnat.com> "Re: [RFA] Fix a compilation failure in rs6000-nat.c" (Jun 30,  5:40pm)

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...


  reply	other threads:[~2003-07-02 18:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01  0:37 Joel Brobecker
2003-07-01  0:40 ` Joel Brobecker
2003-07-02 18:02   ` Kevin Buettner [this message]
2003-07-04 16:49     ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1030702180245.ZM1441@localhost.localdomain \
    --to=kevinb@redhat.com \
    --cc=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox