+2009-11-21 Roland McGrath <roland@redhat.com>
+
+ * dwarf_getlocation.c (check_constant_offset): Return 1 for all
+ non-constant forms.
+
2009-10-15 Roland McGrath <roland@redhat.com>
* libdw_form.c (__libdw_form_val_len): Grok DW_FORM_sec_offset,
check_constant_offset (Dwarf_Attribute *attr,
Dwarf_Op **llbuf, size_t *listlen)
{
- if (attr->code != DW_AT_data_member_location
- || attr->form == DW_FORM_data4
- || attr->form == DW_FORM_data8)
+ if (attr->code != DW_AT_data_member_location)
return 1;
+ switch (attr->form)
+ {
+ /* Punt for any non-constant form. */
+ default:
+ return 1;
+
+ case DW_FORM_data1:
+ case DW_FORM_data2:
+ case DW_FORM_sdata:
+ case DW_FORM_udata:
+ break;
+
+ case DW_FORM_data4:
+ case DW_FORM_data8:
+ /* These are loclistptr, not constants.
+ XXX check cu->version > 3???
+ */
+ return 1;
+ }
+
/* Check whether we already cached this location. */
struct loc_s fake = { .addr = attr->valp };
struct loc_s **found = tfind (&fake, &attr->cu->locs, loc_compare);