]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix shape selection for *ptr class.
authorRoland McGrath <roland@redhat.com>
Wed, 8 Jul 2009 19:36:43 +0000 (12:36 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 8 Jul 2009 19:36:43 +0000 (12:36 -0700)
libdw/c++/output-shape.cc

index fdc40aed84bb7f758c608867ffff5a56d673e4ef..839361c428ce440c059d547ba87ea8254204799e 100644 (file)
@@ -76,17 +76,22 @@ attr_form (int tag, const dwarf_output::attribute &attr)
       /* Fall through.  */
 
     case dwarf::VS_dwarf_constant:
-    case dwarf::VS_lineptr:
-    case dwarf::VS_macptr:
-    case dwarf::VS_rangelistptr:
     case dwarf::VS_source_line:
     case dwarf::VS_source_column:
       return DW_FORM_udata;
 
     case dwarf::VS_location:
-      return (attr.second.location ().is_list ()
-             ? DW_FORM_udata : DW_FORM_block);
+      if (!attr.second.location ().is_list ())
+       return DW_FORM_block;
+      /* Fall through.  */
 
+    case dwarf::VS_lineptr:
+    case dwarf::VS_macptr:
+    case dwarf::VS_rangelistptr:
+      /* For class *ptr (including loclistptr), the one of data[48] that
+        matches offset_size is the only form encoding to use.  Other data*
+        forms can mean the attribute is class constant instead.  */
+      return DW_FORM_data4;
 
     case dwarf::VS_source_file:
       switch (attr.first)