diff options
author | Staale Smedseng <staale.smedseng@sun.com> | 2009-12-06 19:01:11 +0100 |
---|---|---|
committer | Staale Smedseng <staale.smedseng@sun.com> | 2009-12-06 19:01:11 +0100 |
commit | 7a14bfa52d02ec1340e0418d7da65e6ae73fbf86 (patch) | |
tree | 2b0974d00fabceec7d75bbb169e8135537c75c3a /mysys | |
parent | 24e1b16bc280c21de61287f07c3c02bc89387601 (diff) | |
parent | 63ff2b4c2e7db9872515cec3d897817ac83d109c (diff) | |
download | mariadb-git-7a14bfa52d02ec1340e0418d7da65e6ae73fbf86.tar.gz |
Merge from 5.0
Diffstat (limited to 'mysys')
-rw-r--r-- | mysys/stacktrace.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c index 66a361b5421..75fda93b56e 100644 --- a/mysys/stacktrace.c +++ b/mysys/stacktrace.c @@ -63,7 +63,26 @@ void my_safe_print_str(const char* name, const char* val, int max_len) fputc('\n', stderr); } -#if HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD) +#if defined(HAVE_PRINTSTACK) + +/* Use Solaris' symbolic stack trace routine. */ +#include <ucontext.h> + +void my_print_stacktrace(uchar* stack_bottom __attribute__((unused)), + ulong thread_stack __attribute__((unused))) +{ + if (printstack(fileno(stderr)) == -1) + fprintf(stderr, "Error when traversing the stack, stack appears corrupt.\n"); + else + fprintf(stderr, + "Please read " + "http://dev.mysql.com/doc/refman/5.1/en/resolve-stack-dump.html\n" + "and follow instructions on how to resolve the stack trace.\n" + "Resolved stack trace is much more helpful in diagnosing the\n" + "problem, so please do resolve it\n"); +} + +#elif HAVE_BACKTRACE && (HAVE_BACKTRACE_SYMBOLS || HAVE_BACKTRACE_SYMBOLS_FD) #if BACKTRACE_DEMANGLE |