[PATCH 4/5] Altera Nios II: dwarf generation fix
Cary Coutant
ccoutant@google.com
Mon Apr 22 18:53:00 GMT 2013
> We should really be emitting unsigned constants using add_AT_unsigned:
>
> if (TYPE_UNSIGNED (TREE_TYPE (value)))
> {
> if (host_integerp (value, 1))
> add_AT_unsigned (enum_die, DW_AT_const_value, TREE_INT_CST_LOW (value));
> else
> add_AT_unsigned_double (enum_die, DW_AT_const_value,
> TREE_INT_CST_HIGH (value),
> TREE_INT_CST_LOW (value));
> }
> else
> {
> if (host_integerp (value, 0))
> add_AT_int (enum_die, DW_AT_const_value, TREE_INT_CST_LOW (value));
> else
> add_AT_double (enum_die, DW_AT_const_value,
> TREE_INT_CST_HIGH (value), TREE_INT_CST_LOW (value));
> }
>
> add_AT_unsigned_double would be new, and would need a new
> dw_val_class_unsigned_const_double enum.
>
> size_of_die() and value_format() will need to be changed to force the
> use of DW_FORM_udata for dw_val_class_unsigned_const and
> dw_val_class_unsigned_const_double. Given that GDB always treats
> DW_FORM_data{1,2,4,8} as signed, we can leave signed values as they
> are, but DW_FORM_sdata could also be used in cases where it would save
> space.
Since this is well beyond the scope of your series of patches, I'll
take this on as a TODO for myself, and give an OK to your original
patch. (Just be aware in your toolchain that I might be changing GCC
to emit DW_FORM_udata at some point.)
-cary
More information about the Gcc-patches
mailing list