diff options
author | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-11 19:40:58 +0300 |
---|---|---|
committer | Alexey Kopytov <Alexey.Kopytov@Sun.com> | 2009-12-11 19:40:58 +0300 |
commit | 72b2943594036ce9f737dbe81cf32505970fd063 (patch) | |
tree | ad3ff84791c35c7d8b2d47a60f0ea4cb409a0a31 /mysys | |
parent | 69cfd5c8ecd20bca0e651efcbb8b5affc24c1af4 (diff) | |
parent | b358f61bc76e79e872c587bda7f953180a01125e (diff) | |
download | mariadb-git-72b2943594036ce9f737dbe81cf32505970fd063.tar.gz |
Manual merge of mysql-5.1-bugteam into mysql-trunk-merge.
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 |