From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28329 invoked by alias); 7 Sep 2009 17:44:24 -0000 Received: (qmail 28303 invoked by uid 22791); 7 Sep 2009 17:44:21 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.45.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Sep 2009 17:44:12 +0000 Received: from spaceape8.eur.corp.google.com (spaceape8.eur.corp.google.com [172.28.16.142]) by smtp-out.google.com with ESMTP id n87Hi9Xo020288; Mon, 7 Sep 2009 10:44:10 -0700 Received: from ywh10 (ywh10.prod.google.com [10.192.8.10]) by spaceape8.eur.corp.google.com with ESMTP id n87Hi6og027763; Mon, 7 Sep 2009 10:44:06 -0700 Received: by ywh10 with SMTP id 10so6412644ywh.7 for ; Mon, 07 Sep 2009 10:44:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.150.125.3 with SMTP id x3mr23069444ybc.349.1252345445484; Mon, 07 Sep 2009 10:44:05 -0700 (PDT) In-Reply-To: <20090907164528.GA6326@host0.dyn.jankratochvil.net> References: <4AA5161D.1020102@oarcorp.com> <20090907164528.GA6326@host0.dyn.jankratochvil.net> Date: Mon, 07 Sep 2009 17:44:00 -0000 Message-ID: Subject: Re: SPARC GDB Failure From: Doug Evans To: Jan Kratochvil Cc: Joel Sherrill , "gdb@sourceware.org" , Ralf Corsepius , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00157.txt.bz2 On Mon, Sep 7, 2009 at 9:45 AM, Jan Kratochvil w= rote: > On Mon, 07 Sep 2009 16:18:05 +0200, Joel Sherrill wrote: >> But sparc/sis core dumps in gdb instantly. > > It looks as the ia64 crash: > =A0 =A0 =A0 =A0http://sourceware.org/ml/gdb-patches/2009-08/msg00221.html > > I grepped it before but not well enough, now used: > =A0 =A0 =A0 =A0$ grep -il 'malloc.*tdep' *.c|xargs grep -il '! *tdep' > =A0 =A0 =A0 =A0m68k-tdep.c > =A0 =A0 =A0 =A0sparc-tdep.c > > I think the patch should go in nonetheless and I even hope it fixes it. > > No testing was made. > > > Thanks, > Jan > > > gdb/ > 2009-09-07 =A0Jan Kratochvil =A0 > > =A0 =A0 =A0 =A0Fix start crash on unitialized memory on m68k and sparc. > =A0 =A0 =A0 =A0* m68k-tdep.c (m68k_gdbarch_init): Allocate TDEP as cleare= d. > =A0 =A0 =A0 =A0* sparc-tdep.c (sparc32_gdbarch_init): Allocate TDEP as cl= eared. > =A0 =A0 =A0 =A0Remove explicit clearing of TDEP fields. > > --- a/gdb/m68k-tdep.c > +++ b/gdb/m68k-tdep.c > @@ -1160,7 +1160,7 @@ m68k_gdbarch_init (struct gdbarch_info info, struct= gdbarch_list *arches) > =A0 =A0 =A0 break; > =A0 =A0 } > > - =A0tdep =3D xmalloc (sizeof (struct gdbarch_tdep)); > + =A0tdep =3D xzalloc (sizeof (struct gdbarch_tdep)); > =A0 gdbarch =3D gdbarch_alloc (&info, tdep); > =A0 tdep->fpregs_present =3D has_fp; > =A0 tdep->flavour =3D flavour; > --- a/gdb/sparc-tdep.c > +++ b/gdb/sparc-tdep.c > @@ -1377,16 +1377,11 @@ sparc32_gdbarch_init (struct gdbarch_info info, s= truct gdbarch_list *arches) > =A0 =A0 return arches->gdbarch; > > =A0 /* Allocate space for the new architecture. =A0*/ > - =A0tdep =3D XMALLOC (struct gdbarch_tdep); > + =A0tdep =3D XZALLOC (struct gdbarch_tdep); > =A0 gdbarch =3D gdbarch_alloc (&info, tdep); > > =A0 tdep->pc_regnum =3D SPARC32_PC_REGNUM; > =A0 tdep->npc_regnum =3D SPARC32_NPC_REGNUM; > - =A0tdep->gregset =3D NULL; > - =A0tdep->sizeof_gregset =3D 0; > - =A0tdep->fpregset =3D NULL; > - =A0tdep->sizeof_fpregset =3D 0; > - =A0tdep->plt_entry_size =3D 0; > =A0 tdep->step_trap =3D sparc_step_trap; > > =A0 set_gdbarch_long_double_bit (gdbarch, 128); > It seems like all alloc's of gdbarch_tdep should be zalloc'd. [But I wouldn't make that a requirement of this patch.] The patch is fine with me. I think, though, the changelog shouldn't claim it fixes something unless that's been verified.