From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17525 invoked by alias); 21 Apr 2010 15:11:26 -0000 Received: (qmail 17513 invoked by uid 22791); 21 Apr 2010 15:11:25 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 21 Apr 2010 15:11:22 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 618BA2BAC21; Wed, 21 Apr 2010 11:11:20 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id fCA5X3Pti0do; Wed, 21 Apr 2010 11:11:20 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 39A182BAC93; Wed, 21 Apr 2010 11:11:18 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 96E82F5895; Wed, 21 Apr 2010 08:11:17 -0700 (PDT) Date: Wed, 21 Apr 2010 15:11:00 -0000 From: Joel Brobecker To: Pierre Muller Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Fix bug report 11479 Message-ID: <20100421151117.GA13675@adacore.com> References: <000f01cad75b$b53278a0$1f9769e0$@muller@ics-cnrs.unistra.fr> <20100412155453.GW19194@adacore.com> <000001cada5c$49b8e1a0$dd2aa4e0$@muller@ics-cnrs.unistra.fr> <20100413152823.GG19194@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100413152823.GG19194@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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-04/txt/msg00680.txt.bz2 > > But this is the trouble, > > the chain was not cycled before my patch, > > and thus the 'const type' was never resolved and its length > > was still left at zero. > > I didn't really get what the loop line 4465 > > is supposed to do, but it only operates on LOC_TYPEDEF, > > and on the file_symbol level, not at argument list of functions... Pierre - I understand now what you were trying to say. The problem in this situation is that there are no global variable of the type that we need to fix. I think that the proper solution would be to enhance function cleanup_undefined_types_1 to also look at symbols inside function symbols. That way, the problem should be fixed for all kinds of types, not just structs... The following should work: In the loop over file_symbols, check the symbol type: If it is a function, then get the function block, and iterate again on all symbols inside that block. If not a function, then we match the symbol itself. We will probably need to move the symbol matching condition to its own function to avoid duplication... -- Joel