Re: [RFC patch]: Adjust the use of 'long' type in dwarf2.h header

Jakub Jelinek
2011-02-17T19:17:43Z

On Thu, Feb 17, 2011 at 08:06:53PM +0100, Kai Tietz wrote:
> > I'd prefer if we could move those binutils specific internal implementation
> > details out of the dwarf2.h header, keep it really just for the stuff
> > defined in the standard, and add a new binutils specific header somewhere
> > else which would contain binutils specific details.
>
> Well, so we make dwarf2.h in include just host-specific and isn't able
> to cover things for foreign target, like 32-bit host can't use this
> header for 64-bit dwarf2 information. I am fine by this, but
> nevertheless is then the use of 'unsigned long' type within this
> header still an issue. Here should be used instead then 'intptr_t'. As
> on LLP64 unsigned long isn't wide-enough.

I mean that none of the DWARF2_Internal types should be in the
include/dwarf2.h headers (that's implementation specific stuff),
and the DWARF2_External types are questionable too, to me they look
very much like implementation detail too. E.g. DWARF2_External_LineInfo
type is dubious, because it might somehow describe version 2 or 3
.debug_line header, but version 4 looks differently, etc.
So IMHO the DWARF2_External stuff should be moved too.
And the guard should be probably renamed from _ELF_DWARF2_H to _DWARF2_H,
I don't see anything ELF specific in the header.

Jakub