aboutsummaryrefslogtreecommitdiff
path: root/libbacktrace/internal.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2015-09-08 16:46:16 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-09-08 16:46:16 +0000
commitc478516be7517e20e150150fea4399d60434bfc3 (patch)
treeeae6d20512a5643294e17bfb41e704ab2559be16 /libbacktrace/internal.h
parent2eab96661b6c08679ffd4a084f59f3935cfcddb9 (diff)
downloadgcc-c478516be7517e20e150150fea4399d60434bfc3.zip
gcc-c478516be7517e20e150150fea4399d60434bfc3.tar.gz
gcc-c478516be7517e20e150150fea4399d60434bfc3.tar.bz2
re PR other/67457 (segfault in libbacktrace)
PR other/67457 * backtrace.c: #include "internal.h". (struct backtrace_data): Add can_alloc field. (unwind): If can_alloc is false, don't try to get file/line information. (backtrace_full): Set can_alloc field in bdata. * alloc.c (backtrace_alloc): Don't call error_callback if it is NULL. * mmap.c (backtrace_alloc): Likewise. * internal.h: Update comments for backtrace_alloc and backtrace_free. From-SVN: r227533
Diffstat (limited to 'libbacktrace/internal.h')
-rw-r--r--libbacktrace/internal.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/libbacktrace/internal.h b/libbacktrace/internal.h
index 30f99ca..b139e50 100644
--- a/libbacktrace/internal.h
+++ b/libbacktrace/internal.h
@@ -201,13 +201,15 @@ extern int backtrace_close (int descriptor,
extern void backtrace_qsort (void *base, size_t count, size_t size,
int (*compar) (const void *, const void *));
-/* Allocate memory. This is like malloc. */
+/* Allocate memory. This is like malloc. If ERROR_CALLBACK is NULL,
+ this does not report an error, it just returns NULL. */
extern void *backtrace_alloc (struct backtrace_state *state, size_t size,
backtrace_error_callback error_callback,
void *data) ATTRIBUTE_MALLOC;
-/* Free memory allocated by backtrace_alloc. */
+/* Free memory allocated by backtrace_alloc. If ERROR_CALLBACK is
+ NULL, this does not report an error. */
extern void backtrace_free (struct backtrace_state *state, void *mem,
size_t size,