From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17836 invoked by alias); 2 Jul 2003 18:02:53 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17811 invoked from network); 2 Jul 2003 18:02:52 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 2 Jul 2003 18:02:52 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h62I2qH08823 for ; Wed, 2 Jul 2003 14:02:52 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h62I2qI21541; Wed, 2 Jul 2003 14:02:52 -0400 Received: from localhost.localdomain (vpn50-30.rdu.redhat.com [172.16.50.30]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h62I2pE31973; Wed, 2 Jul 2003 14:02:51 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id h62I2jS01442; Wed, 2 Jul 2003 11:02:45 -0700 Date: Wed, 02 Jul 2003 18:02:00 -0000 From: Kevin Buettner Message-Id: <1030702180245.ZM1441@localhost.localdomain> In-Reply-To: Joel Brobecker "Re: [RFA] Fix a compilation failure in rs6000-nat.c" (Jun 30, 5:40pm) References: <20030701003728.GR26149@gnat.com> <20030701004039.GT26149@gnat.com> To: Joel Brobecker , gdb-patches@sources.redhat.com Subject: Re: [RFA] Fix a compilation failure in rs6000-nat.c MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-07/txt/msg00042.txt.bz2 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 > > * 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...