[Ada] Consistently use explicit Entity_Id type instead of alias
[gcc.git] / libbacktrace / internal.h
index 065b9535e8b0f24bfc584fbb21835fad132e85ba..659db9e21e2bf4bfba15e72078d31179e23c27bd 100644 (file)
@@ -1,5 +1,5 @@
 /* internal.h -- Internal header file for stack backtrace library.
-   Copyright (C) 2012-2019 Free Software Foundation, Inc.
+   Copyright (C) 2012-2020 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 Redistribution and use in source and binary forms, with or without
@@ -56,6 +56,14 @@ POSSIBILITY OF SUCH DAMAGE.  */
 # endif
 #endif
 
+#ifndef ATTRIBUTE_FALLTHROUGH
+# if (GCC_VERSION >= 7000)
+#  define ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+# else
+#  define ATTRIBUTE_FALLTHROUGH
+# endif
+#endif
+
 #ifndef HAVE_SYNC_FUNCTIONS
 
 /* Define out the sync functions.  These should never be called if
@@ -286,28 +294,71 @@ extern int backtrace_initialize (struct backtrace_state *state,
                                 void *data,
                                 fileline *fileline_fn);
 
+/* An enum for the DWARF sections we care about.  */
+
+enum dwarf_section
+{
+  DEBUG_INFO,
+  DEBUG_LINE,
+  DEBUG_ABBREV,
+  DEBUG_RANGES,
+  DEBUG_STR,
+  DEBUG_ADDR,
+  DEBUG_STR_OFFSETS,
+  DEBUG_LINE_STR,
+  DEBUG_RNGLISTS,
+
+  DEBUG_MAX
+};
+
+/* Data for the DWARF sections we care about.  */
+
+struct dwarf_sections
+{
+  const unsigned char *data[DEBUG_MAX];
+  size_t size[DEBUG_MAX];
+};
+
+/* DWARF data read from a file, used for .gnu_debugaltlink.  */
+
 struct dwarf_data;
 
 /* Add file/line information for a DWARF module.  */
 
 extern int backtrace_dwarf_add (struct backtrace_state *state,
                                uintptr_t base_address,
-                               const unsigned char* dwarf_info,
-                               size_t dwarf_info_size,
-                               const unsigned char *dwarf_line,
-                               size_t dwarf_line_size,
-                               const unsigned char *dwarf_abbrev,
-                               size_t dwarf_abbrev_size,
-                               const unsigned char *dwarf_ranges,
-                               size_t dwarf_range_size,
-                               const unsigned char *dwarf_str,
-                               size_t dwarf_str_size,
+                               const struct dwarf_sections *dwarf_sections,
                                int is_bigendian,
                                struct dwarf_data *fileline_altlink,
                                backtrace_error_callback error_callback,
                                void *data, fileline *fileline_fn,
                                struct dwarf_data **fileline_entry);
 
+/* A data structure to pass to backtrace_syminfo_to_full.  */
+
+struct backtrace_call_full
+{
+  backtrace_full_callback full_callback;
+  backtrace_error_callback full_error_callback;
+  void *full_data;
+  int ret;
+};
+
+/* A backtrace_syminfo_callback that can call into a
+   backtrace_full_callback, used when we have a symbol table but no
+   debug info.  */
+
+extern void backtrace_syminfo_to_full_callback (void *data, uintptr_t pc,
+                                               const char *symname,
+                                               uintptr_t symval,
+                                               uintptr_t symsize);
+
+/* An error callback that corresponds to
+   backtrace_syminfo_to_full_callback.  */
+
+extern void backtrace_syminfo_to_full_error_callback (void *, const char *,
+                                                     int);
+
 /* A test-only hook for elf_uncompress_zdebug.  */
 
 extern int backtrace_uncompress_zdebug (struct backtrace_state *,
@@ -317,4 +368,13 @@ extern int backtrace_uncompress_zdebug (struct backtrace_state *,
                                        unsigned char **uncompressed,
                                        size_t *uncompressed_size);
 
+/* A test-only hook for elf_uncompress_lzma.  */
+
+extern int backtrace_uncompress_lzma (struct backtrace_state *,
+                                     const unsigned char *compressed,
+                                     size_t compressed_size,
+                                     backtrace_error_callback, void *data,
+                                     unsigned char **uncompressed,
+                                     size_t *uncompressed_size);
+
 #endif