Convert read_offset to method on comp_unit_head
[deliverable/binutils-gdb.git] / gdb / dwarf2 / comp-unit.c
index 03e804b7086b72f705e035edb4c6408905034e65..847a148cbd2528a758f4b84a1ad221db43fb2637 100644 (file)
@@ -129,9 +129,8 @@ read_comp_unit_head (struct comp_unit_head *cu_header,
       cu_header->addr_size = read_1_byte (abfd, info_ptr);
       info_ptr += 1;
     }
-  cu_header->abbrev_sect_off = (sect_offset) read_offset (abfd, info_ptr,
-                                                         cu_header,
-                                                         &bytes_read);
+  cu_header->abbrev_sect_off
+    = (sect_offset) cu_header->read_offset (abfd, info_ptr, &bytes_read);
   info_ptr += bytes_read;
   if (cu_header->version < 5)
     {
@@ -157,7 +156,7 @@ read_comp_unit_head (struct comp_unit_head *cu_header,
   if (section_kind == rcuh_kind::TYPE)
     {
       LONGEST type_offset;
-      type_offset = read_offset (abfd, info_ptr, cu_header, &bytes_read);
+      type_offset = cu_header->read_offset (abfd, info_ptr, &bytes_read);
       info_ptr += bytes_read;
       cu_header->type_cu_offset_in_tu = (cu_offset) type_offset;
       if (to_underlying (cu_header->type_cu_offset_in_tu) != type_offset)
@@ -222,16 +221,3 @@ read_and_check_comp_unit_head (struct dwarf2_per_objfile *dwarf2_per_objfile,
 
   return info_ptr;
 }
-
-/* See comp-unit.h.  */
-
-LONGEST
-read_offset (bfd *abfd, const gdb_byte *buf,
-            const struct comp_unit_head *cu_header,
-             unsigned int *bytes_read)
-{
-  LONGEST offset = read_offset (abfd, buf, cu_header->offset_size);
-
-  *bytes_read = cu_header->offset_size;
-  return offset;
-}
This page took 0.040256 seconds and 4 git commands to generate.