https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118837
--- Comment #10 from Tom Tromey <tromey at gcc dot gnu.org> ---
(In reply to Simon Marchi from comment #9)
> > The main problem with this approach is that the answer doesn't just depend
> > on the tag or the attribute. It can depend on other DIEs as well, for
> > instance I believe a variant part's discriminant value is sign-extended,
> > or not, depending on the type of the relevant field. This of course is
> > difficult to implement, test, etc.
>
> Regarding variants, DWARF 5 already says:
[...]
Well that maybe wasn't the best example, since it's more clear than
many other places in the standard.
At the same time, this would be simpler for DWARF readers if it were
simply spelled out by the form. Then the reader wouldn't have to
examine some other DIE to try to find out whether sign extension is
needed.
> Maybe another solution would be to introduced fixed-size forms with explicit
> signedness, DW_FORM_udata{1,2,4,8} and DW_FORM_sdata{1,2,4,8}.
This would be a distinct improvement.
The main point would be to simplify reading, at least at some
distant time when we can drop support for older versions of DWARF.