>> Also note that size_of_die and value_format will still choose >> DW_FORM_data[1248] for dw_val_class_unsigned_const in most cases. >> Don't you really want to use DW_FORM_udata? > > DW_FORM_data[1248] is in many cases smaller than DW_FORM_udata (though, one > has to take into account possibly larger .debug_abbrev size).
Yes, but it's up to the consumer to deduce from context whether the value is signed or unsigned. If it's still true that GDB will interpret DW_FORM_data[1248] as signed (as the deleted comment said), and you output a value between 128 and 255 using DW_FORM_data1, this isn't going to work. Maybe that comment only applies to DW_FORM_data[48] (whichever matches HOST_WIDE_INT)? At the very least, you should replace the comment block you removed with one that explains why GDB will interpret the values correctly. Keep in mind that the DWARF standard "strongly" encourages producers to use DW_FORM_udata and DW_FORM_sdata. -cary