Move the rust "{" hack
[deliverable/binutils-gdb.git] / gdb / dwarf2 / section.c
index 31cb8b9b2e759faa3b07f16bc4fb67dad0b2eea4..776617911a2ad2a7eeb4e0370906e65f251a51a2 100644 (file)
 #include "complaints.h"
 
 void
-dwarf2_section_buffer_overflow_complaint (struct dwarf2_section_info *section)
+dwarf2_section_info::overflow_complaint () const
 {
   complaint (_("debug info runs off end of %s section"
               " [in module %s]"),
-            section->get_name (),
-            section->get_file_name ());
+            get_name (), get_file_name ());
 }
 
 struct dwarf2_section_info *
@@ -188,3 +187,20 @@ dwarf2_section_info::read (struct objfile *objfile)
             bfd_section_name (sectp), bfd_get_filename (abfd));
     }
 }
+
+const char *
+dwarf2_section_info::read_string (struct objfile *objfile, LONGEST str_offset,
+                                 const char *form_name)
+{
+  read (objfile);
+  if (buffer == NULL)
+    error (_("%s used without %s section [in module %s]"),
+          form_name, get_name (), get_file_name ());
+  if (str_offset >= size)
+    error (_("%s pointing outside of %s section [in module %s]"),
+          form_name, get_name (), get_file_name ());
+  gdb_assert (HOST_CHAR_BIT == 8);
+  if (buffer[str_offset] == '\0')
+    return NULL;
+  return (const char *) (buffer + str_offset);
+}
This page took 0.026705 seconds and 4 git commands to generate.