]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Grok exprloc, flag_present, sec_offset in dwarf::attr_value::what_space.
authorRoland McGrath <roland@redhat.com>
Wed, 30 Sep 2009 07:28:52 +0000 (00:28 -0700)
committerRoland McGrath <roland@redhat.com>
Wed, 30 Sep 2009 07:28:52 +0000 (00:28 -0700)
libdw/ChangeLog
libdw/c++/values.cc

index b598bfe49464572219bf2d7acb6e359def6baa6f..e6546ee1ad2f616fca858d1db4734bf284f0ad84 100644 (file)
@@ -1,5 +1,8 @@
 2009-09-30  Roland McGrath  <roland@redhat.com>
 
+       * c++/values.cc (dwarf::attr_value::what_space):
+       Grok exprloc, flag_present, sec_offset.
+
        * c++/values.cc (dwarf::attr_value::what_space): Fix data[48] case
        to favor constants when expected.
 
index bc1bbf73b455c8dd6fd0dac811d15167b5887eb0..097d2cf107b90f4ef503a106364b80e260a1442c 100644 (file)
@@ -78,6 +78,7 @@ dwarf::attr_value::what_space () const
   switch (dwarf_whatform (thisattr ()))
     {
     case DW_FORM_flag:
+    case DW_FORM_flag_present:
       return VS_flag;
 
     case DW_FORM_addr:
@@ -89,10 +90,13 @@ dwarf::attr_value::what_space () const
     case DW_FORM_block4:
       /* Location expression or target constant.  */
       possible = VS(location) | VS(constant);
-      if ((expected & possible) == possible)
+      if ((expected & possible) != possible)
        /* When both are expected, a block is a location expression.  */
-       return VS_location;
-      break;
+       break;
+      /* Fall through.  */
+
+    case DW_FORM_exprloc:
+      return VS_location;
 
     case DW_FORM_data1:
     case DW_FORM_data2:
@@ -108,8 +112,11 @@ dwarf::attr_value::what_space () const
       // If a constant is not expected, these can be *ptr instead.
       possible = (VS(dwarf_constant) | VS(constant)
                  | VS(source_file) | VS(source_line) | VS(source_column));
-      if ((expected & possible) == 0)
-       possible = VS(location) | VS(lineptr) | VS(macptr) | VS(rangelistptr);
+      if (expected & possible)
+       break;
+
+    case DW_FORM_sec_offset:
+      possible = VS(location) | VS(lineptr) | VS(macptr) | VS(rangelistptr);
       break;
 
     case DW_FORM_string:
@@ -124,8 +131,7 @@ dwarf::attr_value::what_space () const
     case DW_FORM_ref4:
     case DW_FORM_ref8:
     case DW_FORM_ref_udata:
-      possible = VS(reference);
-      break;
+      return VS_reference;
 
     default:
       throw std::runtime_error ("XXX bad form");