From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3182 invoked by alias); 5 Jun 2012 21:16:23 -0000 Received: (qmail 3170 invoked by uid 22791); 5 Jun 2012 21:16:22 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KAM_STOCKGEN,KHOP_RCVD_TRUST,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,TW_BJ X-Spam-Check-By: sourceware.org Received: from mail-pz0-f41.google.com (HELO mail-pz0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Jun 2012 21:16:09 +0000 Received: by dakp5 with SMTP id p5so8191213dak.0 for ; Tue, 05 Jun 2012 14:16:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-type:x-gm-message-state; bh=GRNxOKnwSHpuXUPXRNrkdxX4gnNeYj9M2KHUv9S0SoI=; b=G8LqJMg15FIO2Sx9NJ8NasYLeVQKEXN0K+bKCv04rz4xjkjnSgUa1naVL8Pv+yLe8Z R2IEhpPwAbweUPDSzmwMuP0nRnq0A3Vk12l5JYg+wQLa/na+JO8SVfWgAEjvD4GXQlNe iIwdNC13iiL7QIQZYNTa0eePpRiz/KnEjTqbhENN8/nZCw612qo/IUyoPvuFf8tiZUL+ 7uTDBH7YYYBEfPFFtJCpj8I491hCo/zGfjf8p+iPzUQ1sogVUty/MWONQr/cH6iKui0a 1uiTr6xHwsiw/O+odCp9Kz80/3nHifuDAZPPinZD6EPaPAcx8VJXE1T1dyXYvPN7NFWK UBlA== Received: by 10.68.212.138 with SMTP id nk10mr2849305pbc.93.1338930968311; Tue, 05 Jun 2012 14:16:08 -0700 (PDT) Received: from garudatw.twitter.com ([8.25.195.25]) by mx.google.com with ESMTPS id ve6sm3568094pbc.75.2012.06.05.14.16.06 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 05 Jun 2012 14:16:07 -0700 (PDT) From: Kaushik Srenevasan To: daniel.jacobowitz@gmail.com, palves@redhat.com Cc: gdb-patches@sourceware.org Subject: Re: Fix GDB crash while trying to display the return type of a JIT frame. In-Reply-To: (Daniel Jacobowitz's message of "Tue, 5 Jun 2012 10:14:18 -0400") References: <87vcj624dl.fsf@garudatw.twitter.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) Date: Tue, 05 Jun 2012 21:16:00 -0000 Message-ID: <87d35dh36p.fsf@garudatw.twitter.com> MIME-Version: 1.0 Content-Type: text/plain X-Gm-Message-State: ALoCoQmmoB3Ef6ebRCVrA5nl1bo/8ApF2JdIyRMJMJWm5+wS1M0IeByYqs1oHCRmE+uVsdIym3nH 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/msg00158.txt.bz2 Daniel Jacobowitz writes: > Nit: second line should line up with the asterisk, not further in. > > Nits: watch out for the coding style, particularly space before open > paren and 80 column limit. Fixed. Pedro Alves writes: > Pedantically, it'd be better to write 'get_objfile_arch (objfile)' instead > of target_gdbarch, even though the objfile's gdbarch is initialized > to target_gdbarch presently. Fixed. -Kaushik 2012-06-04 Kaushik Srenevasan * jit.c (finalize_symtab): Set function's return type to 'void' by default. diff --git a/gdb/jit.c b/gdb/jit.c index f172e41..568d17b 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -660,6 +660,10 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile) struct block *new_block = allocate_block (&objfile->objfile_obstack); struct symbol *block_name = obstack_alloc (&objfile->objfile_obstack, sizeof (struct symbol)); + struct type *block_type = arch_type (get_objfile_arch (objfile), + TYPE_CODE_VOID, + 1, + "void"); BLOCK_DICT (new_block) = dict_create_linear (&objfile->objfile_obstack, NULL); @@ -672,6 +676,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile) SYMBOL_DOMAIN (block_name) = VAR_DOMAIN; SYMBOL_CLASS (block_name) = LOC_BLOCK; SYMBOL_SYMTAB (block_name) = symtab; + SYMBOL_TYPE (block_name) = lookup_function_type (block_type); SYMBOL_BLOCK_VALUE (block_name) = new_block; block_name->ginfo.name = obsavestring (gdb_block_iter->name,