]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libbacktrace/internal.h
libphobos: Fix configure test for backtrace-supported.h
[thirdparty/gcc.git] / libbacktrace / internal.h
index f52d1f94029ac4a20677a30f39cf66851bd522bb..065b9535e8b0f24bfc584fbb21835fad132e85ba 100644 (file)
@@ -1,5 +1,5 @@
 /* internal.h -- Internal header file for stack backtrace library.
-   Copyright (C) 2012-2017 Free Software Foundation, Inc.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
    Written by Ian Lance Taylor, Google.
 
 Redistribution and use in source and binary forms, with or without
@@ -179,7 +179,7 @@ struct backtrace_view
 /* Create a view of SIZE bytes from DESCRIPTOR at OFFSET.  Store the
    result in *VIEW.  Returns 1 on success, 0 on error.  */
 extern int backtrace_get_view (struct backtrace_state *state, int descriptor,
-                              off_t offset, size_t size,
+                              off_t offset, uint64_t size,
                               backtrace_error_callback error_callback,
                               void *data, struct backtrace_view *view);
 
@@ -257,6 +257,18 @@ extern int backtrace_vector_release (struct backtrace_state *state,
                                     backtrace_error_callback error_callback,
                                     void *data);
 
+/* Free the space managed by VEC.  This will reset VEC.  */
+
+static inline void
+backtrace_vector_free (struct backtrace_state *state,
+                      struct backtrace_vector *vec,
+                      backtrace_error_callback error_callback, void *data)
+{
+  vec->alc += vec->size;
+  vec->size = 0;
+  backtrace_vector_release (state, vec, error_callback, data);
+}
+
 /* Read initial debug data from a descriptor, and set the
    fileline_data, syminfo_fn, and syminfo_data fields of STATE.
    Return the fileln_fn field in *FILELN_FN--this is done this way so
@@ -274,6 +286,8 @@ extern int backtrace_initialize (struct backtrace_state *state,
                                 void *data,
                                 fileline *fileline_fn);
 
+struct dwarf_data;
+
 /* Add file/line information for a DWARF module.  */
 
 extern int backtrace_dwarf_add (struct backtrace_state *state,
@@ -289,7 +303,18 @@ extern int backtrace_dwarf_add (struct backtrace_state *state,
                                const unsigned char *dwarf_str,
                                size_t dwarf_str_size,
                                int is_bigendian,
+                               struct dwarf_data *fileline_altlink,
                                backtrace_error_callback error_callback,
-                               void *data, fileline *fileline_fn);
+                               void *data, fileline *fileline_fn,
+                               struct dwarf_data **fileline_entry);
+
+/* A test-only hook for elf_uncompress_zdebug.  */
+
+extern int backtrace_uncompress_zdebug (struct backtrace_state *,
+                                       const unsigned char *compressed,
+                                       size_t compressed_size,
+                                       backtrace_error_callback, void *data,
+                                       unsigned char **uncompressed,
+                                       size_t *uncompressed_size);
 
 #endif