[Dwarf-Discuss] Resend Encoding large constant values

John DelSignore John.DelSignore at roguewave.com
Mon Sep 17 12:42:49 PDT 2012

In Fortran if you declare a variable as a "parameter", the compiler creates a named constant. The language allows named constants of any intrinsic type, that is, a numeric (integer, real, or complex) value, a character value (including strings), or a logical value. Given that strings are allowed, arbitrarily long named constant values can be defined.

Other debug formats that I've seen represented large constant values by encoding the constant value a sequence of bytes, in the target platform's byte order. The number of bytes in the constant value is (at least) as long as the length of the type of the named constant. This is very convenient for the debugger because it does not need to figure out if it has to convert the value of the named constant to some other format that matches its type.

So, IMO, it would be nice if there was a DWARF form that allowed the length and the raw bytes of the constant value to be encoded.

Cheers, John D.

Jakub Jelinek wrote:
> On Mon, Sep 17, 2012 at 05:39:38PM +0000, Bishop, John E wrote:
>>> Maybe DWARF needs a DW_FORM_data16.
>> Rather than one-plus to get data16 (soon we'd need data32, etc), I think
>> you should use DW_FORM_block1.  If consumers make invalid assumptions, we
>> shouldn't change DWARF to compensate for that.
> Yeah.  We already need 32-byte constants (e.g. x86_64/i?86 __m256 vectors)
> and for DW_AT_const_value of aggregates pretty much any other size.
> 	Jakub
> _______________________________________________
> Dwarf-Discuss mailing list
> Dwarf-Discuss at lists.dwarfstd.org
> http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org

More information about the Dwarf-Discuss mailing list