From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9839 invoked by alias); 15 Jun 2009 11:57:14 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 9829 invoked by uid 22791); 15 Jun 2009 11:57:13 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Date: Mon, 15 Jun 2009 11:57:00 -0000 From: Jan Kratochvil To: Joost van der Sluis Cc: archer@sourceware.org Subject: Re: Calculating array length Message-ID: <20090615115701.GA12218@host0.dyn.jankratochvil.net> References: <1244370173.22994.14.camel@wsjoost> <20090607144745.GA21154@host0.dyn.jankratochvil.net> <1244390772.8081.39.camel@wsjoost> <20090607174924.GA4174@host0.dyn.jankratochvil.net> <1244841847.11453.3.camel@wsjoost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1244841847.11453.3.camel@wsjoost> User-Agent: Mutt/1.5.19 (2009-01-05) X-SW-Source: 2009-q2/txt/msg00156.txt.bz2 On Fri, 12 Jun 2009 23:24:07 +0200, Joost van der Sluis wrote: > Sometimes CHECK_TYPEDEF is already called on a type with the wrong > object_addres set. So I have to clear all this information from the > type-definition. How can I do that? Making a new copy of the type > without this information should also be ok. I would rather to fix the code than to try to clear some wrong information. object_address_get_data must not be called before check_typedef as then check_typedef would fail to find the right boundaries and other info. If object_address_get_data is forgotten to be called before accessing the data after check_typedef then one should just call object_address_get_data. I see now that object_address_get_data should be probably just called by check_typedef. check_typedef was not being used by the VLA patch the time object_address_get_data was introduced so thanks for the notice, going to check it more. The real problem is that there should be a different GDB internal C type on input to check_typedef than on its output so the compiler would enforce the GDB developer to call check_typedef exactly at the right time. Another possibility would be to drop check_typedef and instead make all the accessors (like TYPE_LOW_BOUND) evaluating the values on each call (dynamically). But these are outside of the scope of the VLA patch. Thanks, Jan