From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14871 invoked by alias); 31 Mar 2010 18:14:49 -0000 Received: (qmail 14861 invoked by uid 22791); 31 Mar 2010 18:14:48 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 31 Mar 2010 18:14:44 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2VIEhQE022369 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 31 Mar 2010 14:14:43 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2VIEevv021984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 31 Mar 2010 14:14:42 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o2VIEeNO004927; Wed, 31 Mar 2010 20:14:40 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o2VIEdl0004926; Wed, 31 Mar 2010 20:14:39 +0200 Date: Wed, 31 Mar 2010 18:14:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix crash on NULL function's TYPE_FIELD_TYPE Message-ID: <20100331181439.GA4272@host0.dyn.jankratochvil.net> References: <20100330083821.GA8227@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) 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: 2010-03/txt/msg01118.txt.bz2 On Tue, 30 Mar 2010 19:00:34 +0200, Tom Tromey wrote: > >>>>> "Jan" == Jan Kratochvil writes: > > Jan> 2010-03-30 Jan Kratochvil > Jan> Fix crash on reading wrong function declaration DWARF. > Jan> * dwarf2read.c (read_subroutine_type): New variable void_type. > Jan> Pre-fill all TYPE_FIELD_TYPEs. Move nparams and iparams initialization > Jan> more close to their use. > > Jan> 2010-03-30 Jan Kratochvil > Jan> * gdb.dwarf2/dw2-bad-parameter-type.exp, > Jan> gdb.dwarf2/dw2-bad-parameter-type.S: New. [..] > This is ok. Checked in: http://sourceware.org/ml/gdb-cvs/2010-03/msg00302.html > I'm not super happy about this change, since it seems so ad hoc. Is it > really only the field type that must be set? Or are there other things > as well? But at the same time it is hard to see what else we could do. This function read_subroutine_type really only sets TYPE_FIELD_TYPE. It also determines the boolean TYPE_FIELD_ARTIFICIAL but it is apparent it can be set either way and nobody cares much after reading debug info has errored out. I understand calling error during debug info reading is very fragile operation but whether there are / are not bugs in other code regarding such error recovery / cleanup is outside of the scope of this patch as it can equally affect also other read_*_type functions IMO. Thanks, Jan