This is the mail archive of the
mailing list for the Archer project.
Re: Calculating array length
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
But these are outside of the scope of the VLA patch.