This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: Calculating array length
Op zondag 07-06-2009 om 19:49 uur [tijdzone +0200], schreef Jan
Kratochvil:
> On Sun, 07 Jun 2009 18:06:12 +0200, Joost van der Sluis wrote:
> > only problems I still have is with all the
> > calls to all sort of properties of the type, while the object-address is
> > pointing to something different, so that the sizes don't match.
>
> I agree it is "unfortunate" GDB currently does not distinguish much between
> the object-address and data-address and accesses them interchangeably.
>
> There should be both VALUE_ADDRESS and some "VALUE_DATA_ADDRESS" kept around.
>
> To make the VLA patch maintainable separately there is currently a function
> object_address_get_data which is called at the right moment when GDB starts to
> deal with the data themselves instead of the value object in general.
> object_address_get_data currently switches the VALUE_ADDRESS content+meaning
> to that hypothetical VALUE_DATA_ADDRESS.
Yes, I found that function and used it a lot. I still have one question,
though. Once CHECK_TYPEDEF is called on a type, all kind of information
is stored/cached into the type-definition. Among others the bounds if
it's an array.
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.
Regards,
Joost van der Sluis