Indent labels
[deliverable/binutils-gdb.git] / binutils / dwarf.h
index 8272de857b5b9d1dff825d5640f5463ad2c08637..69566926769b35a1565d5ccf95b3ab90831d99ac 100644 (file)
@@ -1,5 +1,5 @@
 /* dwarf.h - DWARF support header file
-   Copyright (C) 2005-2019 Free Software Foundation, Inc.
+   Copyright (C) 2005-2020 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
@@ -228,12 +228,6 @@ extern int dwarf_check;
 extern void init_dwarf_regnames_by_elf_machine_code (unsigned int);
 extern void init_dwarf_regnames_by_bfd_arch_and_mach (enum bfd_architecture arch,
                                                      unsigned long mach);
-extern void init_dwarf_regnames_i386 (void);
-extern void init_dwarf_regnames_iamcu (void);
-extern void init_dwarf_regnames_x86_64 (void);
-extern void init_dwarf_regnames_aarch64 (void);
-extern void init_dwarf_regnames_s390 (void);
-extern void init_dwarf_regnames_riscv (void);
 
 extern bfd_boolean  load_debug_section (enum dwarf_section_display_enum, void *);
 extern void         free_debug_section (enum dwarf_section_display_enum);
@@ -254,9 +248,69 @@ extern void * xcalloc2 (size_t, size_t);
 extern void * xcmalloc (size_t, size_t);
 extern void * xcrealloc (void *, size_t, size_t);
 
-extern dwarf_vma read_leb128 (unsigned char *, unsigned int *, bfd_boolean, const unsigned char * const);
-
 /* A callback into the client.  Returns TRUE if there is a
    relocation against the given debug section at the given
    offset.  */
 extern bfd_boolean reloc_at (struct dwarf_section *, dwarf_vma);
+
+extern dwarf_vma read_leb128 (unsigned char *, const unsigned char *const,
+                             bfd_boolean, unsigned int *, int *);
+
+#if HAVE_LIBDEBUGINFOD
+extern unsigned char * get_build_id (void *);
+#endif
+
+static inline void
+report_leb_status (int status)
+{
+  if ((status & 1) != 0)
+    error (_("LEB end of data\n"));
+  else if ((status & 2) != 0)
+    error (_("LEB value too large\n"));
+}
+
+#define SKIP_ULEB(start, end)                                  \
+  do                                                           \
+    {                                                          \
+      unsigned int _len;                                       \
+      read_leb128 (start, end, FALSE, &_len, NULL);            \
+      start += _len;                                           \
+    } while (0)
+
+#define SKIP_SLEB(start, end)                                  \
+  do                                                           \
+    {                                                          \
+      unsigned int _len;                                       \
+      read_leb128 (start, end, TRUE, &_len, NULL);             \
+      start += _len;                                           \
+    } while (0)
+
+#define READ_ULEB(var, start, end)                             \
+  do                                                           \
+    {                                                          \
+      dwarf_vma _val;                                          \
+      unsigned int _len;                                       \
+      int _status;                                             \
+                                                               \
+      _val = read_leb128 (start, end, FALSE, &_len, &_status); \
+      start += _len;                                           \
+      (var) = _val;                                            \
+      if ((var) != _val)                                       \
+       _status |= 2;                                           \
+      report_leb_status (_status);                             \
+    } while (0)
+
+#define READ_SLEB(var, start, end)                             \
+  do                                                           \
+    {                                                          \
+      dwarf_signed_vma _val;                                   \
+      unsigned int _len;                                       \
+      int _status;                                             \
+                                                               \
+      _val = read_leb128 (start, end, TRUE, &_len, &_status);  \
+      start += _len;                                           \
+      (var) = _val;                                            \
+      if ((var) != _val)                                       \
+       _status |= 2;                                           \
+      report_leb_status (_status);                             \
+    } while (0)
This page took 0.025738 seconds and 4 git commands to generate.