[fpc-devel] debug information for Variant type
marc.weustink at cuperus.nl
Thu Dec 3 15:09:02 CET 2009
Jonas Maebe wrote:
> On 03 Dec 2009, at 14:29, Marc Weustink wrote:
>> Jonas Maebe wrote:
>>> On 01 Dec 2009, at 13:42, Paul Ishenin wrote:
>>>> Jonas Maebe wrote:
>>>>> Would it be enough if the type name were changed to "variant"? It
>>>>> would not be 100% safe (since "variant" is not a reserved word,
>>>>> anyone can declare a variable/type/... with the name "variant"),
>>>>> but I don't immediately see another solution.
>>>> I think yes.
>>> Does the attached patch work for DWARF with Lazarus? "ptype
>>> variantvar" still shows tvardata, but "info variantvar" shows "static
>>> VARIANT V;", and I don't know what the GDB MI will return for the
>>> query that Lazarus uses.
>> the mi version of info var.. is not implemented in gdb, so lazarus
>> uses ptype var
>> So I guess for this case, when a TVarrec is returned we'll inspect
>> further using info.
> It's also possible to create another definition of tvarrec with
> "variant" as name.
In that case I think I prefer a full dwarf variant :)
> It's just slightly less clean to implement. Also note
> that "info var" takes a regular expression, so make sure to use "info
> var ^varname$", otherwise you'll get info about a lot of unrelated matches.
More information about the fpc-devel