Change two more functions to be methods on die_info
[deliverable/binutils-gdb.git] / gdb / dwarf2 / die.h
index 3a265b7df03ec3d4bb0f932b2f1890d9be508cb4..c3586645bd60eb37031ebea4e6c7ef7826702ea8 100644 (file)
@@ -33,6 +33,32 @@ 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 ()
+  {
+    struct attribute *attr = this->attr (DW_AT_addr_base);
+    if (attr == nullptr)
+      attr = this->attr (DW_AT_GNU_addr_base);
+    if (attr == nullptr)
+      return gdb::optional<ULONGEST> ();
+    return DW_UNSND (attr);
+  }
+
+  /* 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 ()
+  {
+    struct attribute *attr = this->attr (DW_AT_rnglists_base);
+    if (attr == nullptr)
+      attr = this->attr (DW_AT_GNU_ranges_base);
+    if (attr == nullptr)
+      return 0;
+    return DW_UNSND (attr);
+  }
+
 
   /* DWARF-2 tag for this DIE.  */
   ENUM_BITFIELD(dwarf_tag) tag : 16;
This page took 0.035346 seconds and 4 git commands to generate.