summaryrefslogtreecommitdiffstats
path: root/3rdparty/libbacktrace/libbacktrace/internal.h
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/libbacktrace/libbacktrace/internal.h')
-rw-r--r--3rdparty/libbacktrace/libbacktrace/internal.h76
1 files changed, 60 insertions, 16 deletions
diff --git a/3rdparty/libbacktrace/libbacktrace/internal.h b/3rdparty/libbacktrace/libbacktrace/internal.h
index 73728da3..a9c66882 100644
--- a/3rdparty/libbacktrace/libbacktrace/internal.h
+++ b/3rdparty/libbacktrace/libbacktrace/internal.h
@@ -1,5 +1,5 @@
/* internal.h -- Internal header file for stack backtrace library.
- Copyright (C) 2012-2016 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
@@ -7,13 +7,13 @@ modification, are permitted provided that the following conditions are
met:
(1) Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
+ notice, this list of conditions and the following disclaimer.
(2) Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
- distribution.
-
+ distribution.
+
(3) The name of the author may not be used to
endorse or promote products derived from this software without
specific prior written permission.
@@ -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
@@ -268,27 +280,59 @@ extern int backtrace_vector_release (struct backtrace_state *state,
appropriate one. */
extern int backtrace_initialize (struct backtrace_state *state,
+ const char *filename,
int descriptor,
backtrace_error_callback error_callback,
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);
+ 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