]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Handle DW_Form constants for DW_AT_data_member_location in readelf.
authorMark Wielaard <mjw@redhat.com>
Wed, 8 Jul 2009 17:18:53 +0000 (19:18 +0200)
committerMark Wielaard <mjw@redhat.com>
Wed, 8 Jul 2009 17:18:53 +0000 (19:18 +0200)
src/ChangeLog
src/readelf.c

index e27494245b60e69ae4bb6519c1caf32432a92ffb..51b3dd8007f54c93a97283ef0c4ca01f67c12ba9 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-08  Mark Wielaard  <mjw@redhat.com>
+
+       * readelf.c (attr_callback): Handle DW_Form constants for
+       DW_AT_data_member_location.
+
 2009-07-06  Roland McGrath  <roland@redhat.com>
 
        * readelf.c (register_info): New function.  Handle unknown register #s.
index c8bb2f08ec32174234ed3d17a1994e6bae3a5025..bc67c31b2412ee322c5b883dbfd74096bf6632ff 100644 (file)
@@ -5135,9 +5135,20 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
       const char *valuestr = NULL;
       switch (attr)
        {
+       /* This case can take either a constant or a loclistptr. */
+       case DW_AT_data_member_location:
+         if (form != DW_FORM_data4 && form != DW_FORM_data8)
+           {
+             printf ("           %*s%-20s %" PRIxMAX "\n",
+                     (int) (level * 2), "", dwarf_attr_string (attr),
+                     (uintmax_t) num);
+             return DWARF_CB_OK;
+           }
+         /* else fallthrough */
+
+       /* These cases always take a loclistptr and no constant. */
        case DW_AT_location:
        case DW_AT_data_location:
-       case DW_AT_data_member_location:
        case DW_AT_vtable_elem_location:
        case DW_AT_string_length:
        case DW_AT_use_location: