Patch for setting DW_AT_const_value in identity declaration VAR_DECLs
Mark Wielaard
mark@klomp.org
Tue Sep 22 12:14:56 GMT 2026
Hi Cupertino,
On Tue, 2026-09-22 at 11:08 +0100, Cupertino Miranda wrote:
> Thanks for looking into this patch. ;)
> I guess we were not aware that was actually the use for the
> DW_AT_const_value.
>
> What we will need is to be able to distinguish in GDB from a68 variables
> (var) and identity declarations (ide).
> Identity declarations are constant values, but they might not get the
> constant in the beginning of block but instead at their first modify
> expression.
> At least for that reason they are not traditional C like constants.
>
> Is there any other way in DWARF to flag a DW_TAG_variable such that we
> would be able to distinguish between "var" and "ide"?
> Is DW_TAG_constant Ok for this?
I am not 100% sure, but I believe DW_TAG_constant is the right thing
for this. Ada, D and Fortran use it for CONST_DECL. See gen_decl_die
and gen_const_die in dwarf2out.cc. But I understand you are not using
CONST_DECL for "identity declarations", so they might not be similar to
the Ada, D and Fortran cases.
Cheers,
Mark
More information about the Algol68
mailing list