gdb: remove FIELD_TYPE macro
[deliverable/binutils-gdb.git] / gdb / dwarf2 / die.h
index 3a265b7df03ec3d4bb0f932b2f1890d9be508cb4..5522ebdf3114f013b70184811c930db8d90be194 100644 (file)
@@ -33,6 +33,36 @@ struct die_info
     return NULL;
   }
 
+  /* Return the address base of the compile unit, which, if exists, is
+     stored either at the attribute DW_AT_GNU_addr_base, or
+     DW_AT_addr_base.  */
+  gdb::optional<ULONGEST> addr_base ()
+  {
+    for (unsigned i = 0; i < num_attrs; ++i)
+      if (attrs[i].name == DW_AT_addr_base
+         || attrs[i].name == DW_AT_GNU_addr_base)
+       {
+         /* If both exist, just use the first one.  */
+         return DW_UNSND (&attrs[i]);
+       }
+    return gdb::optional<ULONGEST> ();
+  }
+
+  /* Return range lists base of the compile unit, which, if exists, is
+     stored either at the attribute DW_AT_rnglists_base or
+     DW_AT_GNU_ranges_base.  */
+  ULONGEST ranges_base ()
+  {
+    for (unsigned i = 0; i < num_attrs; ++i)
+      if (attrs[i].name == DW_AT_rnglists_base
+         || attrs[i].name == DW_AT_GNU_ranges_base)
+       {
+         /* If both exist, just use the first one.  */
+         return DW_UNSND (&attrs[i]);
+       }
+    return 0;
+  }
+
 
   /* DWARF-2 tag for this DIE.  */
   ENUM_BITFIELD(dwarf_tag) tag : 16;
This page took 0.023995 seconds and 4 git commands to generate.