Commit d5391ed6 authored by Staale Smedseng's avatar Staale Smedseng

Merge from 5.0

parents 42fead10 846c81c7
......@@ -2094,7 +2094,7 @@ AC_CHECK_FUNCS(alarm bcmp bfill bmove bsearch bzero \
sighold sigset sigthreadmask port_create sleep \
snprintf socket stpcpy strcasecmp strerror strsignal strnlen strpbrk strstr \
strtol strtoll strtoul strtoull tell tempnam thr_setconcurrency vidattr \
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd printstack)
#
#
......
......@@ -23,7 +23,7 @@
(defined(__alpha__) && defined(__GNUC__))
#define HAVE_STACKTRACE 1
#endif
#elif defined(__WIN__)
#elif defined(__WIN__) || defined(__sun)
#define HAVE_STACKTRACE 1
#endif
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment