From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1826 invoked by alias); 5 Jun 2012 14:14:33 -0000 Received: (qmail 1818 invoked by uid 22791); 5 Jun 2012 14:14:32 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KAM_STOCKGEN,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BJ X-Spam-Check-By: sourceware.org Received: from mail-ey0-f169.google.com (HELO mail-ey0-f169.google.com) (209.85.215.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Jun 2012 14:14:19 +0000 Received: by eaan1 with SMTP id n1so1655931eaa.0 for ; Tue, 05 Jun 2012 07:14:18 -0700 (PDT) MIME-Version: 1.0 Received: by 10.14.97.135 with SMTP id t7mr7637531eef.176.1338905658485; Tue, 05 Jun 2012 07:14:18 -0700 (PDT) Received: by 10.14.100.201 with HTTP; Tue, 5 Jun 2012 07:14:18 -0700 (PDT) In-Reply-To: <87vcj624dl.fsf@garudatw.twitter.com> References: <87vcj624dl.fsf@garudatw.twitter.com> Date: Tue, 05 Jun 2012 14:14:00 -0000 Message-ID: Subject: Re: Fix GDB crash while trying to display the return type of a JIT frame. From: Daniel Jacobowitz To: Kaushik Srenevasan Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2012-06/txt/msg00130.txt.bz2 On Mon, Jun 4, 2012 at 4:45 PM, Kaushik Srenevasan wr= ote: > This patch fixes GDB crashes due to missing function return type on > JIT reader symbols. The approach makes sense. > 2012-06-04 =A0Kaushik Srenevasan =A0 > > =A0 =A0 =A0 =A0* jit.c (finalize_symtab): Set function's return type to '= void' > =A0 =A0 =A0 =A0 =A0by default. Nit: second line should line up with the asterisk, not further in. > > diff --git a/gdb/jit.c b/gdb/jit.c > index f172e41..7bd4a27 100644 > --- a/gdb/jit.c > +++ b/gdb/jit.c > @@ -672,6 +672,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objf= ile *objfile) > =A0 =A0 =A0 SYMBOL_DOMAIN (block_name) =3D VAR_DOMAIN; > =A0 =A0 =A0 SYMBOL_CLASS (block_name) =3D LOC_BLOCK; > =A0 =A0 =A0 SYMBOL_SYMTAB (block_name) =3D symtab; > + =A0 =A0 =A0SYMBOL_TYPE (block_name) =3D lookup_function_type(arch_type(= target_gdbarch, TYPE_CODE_VOID, 1, "void")); Nits: watch out for the coding style, particularly space before open paren and 80 column limit. > =A0 =A0 =A0 SYMBOL_BLOCK_VALUE (block_name) =3D new_block; > > =A0 =A0 =A0 block_name->ginfo.name =3D obsavestring (gdb_block_iter->name, --=20 Thanks, Daniel