On Mon, Apr 14, 2014 at 03:48:06PM -0700, Cary Coutant wrote: > >> 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)?
If there is no agreement between producer and consumer what is signed and what is unsigned for DW_FORM_data[1248], then of course that is a problem, I wasn't aware of such disagreements. Anyway, at least DW_FORM_data[1248] values which don't have topmost bit set should be always fine, because they are not ambiguous even if there is disagreement between producer and consumer on if it is signed or unsigned. Jakub