[fpc-devel] Dwarf type-information for gdb
Joost van der Sluis
joost at cnoc.nl
Mon Jul 20 15:11:09 CEST 2009
Op zondag 19-07-2009 om 21:23 uur [tijdzone +0200], schreef Jonas Maebe:
> On 19 Jul 2009, at 20:57, Joost van der Sluis wrote:
> > The attached patch solves the problem, but I doubt this is the right
> > place to do this, since this way the 'DW_TAG_typedef' entry is always
> > added, and in some cases double.
> > How (and where) to fix this properly?
> I guess by removing the Darwin check at dbgdwarf.pas:1614, and by
> removing the code at dbgdwarf.pas:2263-2274 (i.e., by making all that
> code active for all targets, not just for Darwin).
Yes, that works. It's almost the same as mine patch, only you add it
before appenddef, I did it afterwards. And you removed the code which
adds it as a duplicate.
> > And can someone see if this is a
> > problem within gdb, or is it according to the dwarf-specs that this
> > entry should be there?
> I don't think the DWARF specs say anything particular about this. But
> in a way, it is logical. If you don't have a separate typedef, then it
> is like using something like "var a: record a: longint; end;" in
> Pascal. I.e., there is some kind of inline type definition, but it's
> not defined as a separate entity.
> The difference is that in DWARF you can also associate a name with
> such inline type definitions and you can refer multiple times to it
> (for debug info size reasons), but that in itself does not make them
> independent entities that stand on their own.
So we have to add the typedefs always, and not only for Darwin. Can you
commit it and change the Darwin-essay a bit so that it still holds?
More information about the fpc-devel