From 4af50e13a035804b80551e4649cc2b055588ffc8 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Fri, 8 Feb 2019 09:49:06 +0000 Subject: [libbacktrace] Declare external backtrace fns noinline The backtrace functions backtrace_full, backtrace_print and backtrace_simple walk the call stack, but make sure to skip the first entry, in order to skip over the functions themselves, and start the backtrace at the caller of the functions. When compiling with -flto, the functions may be inlined, causing them to skip over the caller instead. Fix this by declaring the functions with __attribute__((noinline)). 2019-02-08 Tom de Vries * backtrace.c (backtrace_full): Declare with __attribute__((noinline)). * print.c (backtrace_print): Same. * simple.c (backtrace_simple): Same. From-SVN: r268668 --- libbacktrace/backtrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libbacktrace/backtrace.c') diff --git a/libbacktrace/backtrace.c b/libbacktrace/backtrace.c index 29204c6..c579e80 100644 --- a/libbacktrace/backtrace.c +++ b/libbacktrace/backtrace.c @@ -98,7 +98,7 @@ unwind (struct _Unwind_Context *context, void *vdata) /* Get a stack backtrace. */ -int +int __attribute__((noinline)) backtrace_full (struct backtrace_state *state, int skip, backtrace_full_callback callback, backtrace_error_callback error_callback, void *data) -- cgit v1.1