gdb: remove FIELD_TYPE macro
[deliverable/binutils-gdb.git] / gdb / dwarf2 / leb.c
index ef7314ed2b37952417c3dcc843f3f260abc2b4ad..02faaa9954ddd136438bb6e985ea7fa857d9969d 100644 (file)
@@ -110,3 +110,27 @@ read_initial_length (bfd *abfd, const gdb_byte *buf, unsigned int *bytes_read,
 
   return length;
 }
+
+/* See leb.h.  */
+
+LONGEST
+read_offset (bfd *abfd, const gdb_byte *buf, unsigned int offset_size)
+{
+  LONGEST retval = 0;
+
+  switch (offset_size)
+    {
+    case 4:
+      retval = bfd_get_32 (abfd, buf);
+      break;
+    case 8:
+      retval = bfd_get_64 (abfd, buf);
+      break;
+    default:
+      internal_error (__FILE__, __LINE__,
+                     _("read_offset_1: bad switch [in module %s]"),
+                     bfd_get_filename (abfd));
+    }
+
+  return retval;
+}
This page took 0.024924 seconds and 4 git commands to generate.