summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authorunknown <davi@mysql.com/endora.local>2008-02-07 19:58:06 -0200
committerunknown <davi@mysql.com/endora.local>2008-02-07 19:58:06 -0200
commitd9831ae5329d6916667ee9beb885c3e4c35c4018 (patch)
tree8ec03724213bdbbf26572c207c4b29a76055757f /configure.in
parentee0b7f38567bf8661d89500b67d115d8a1cb53f8 (diff)
downloadmariadb-git-d9831ae5329d6916667ee9beb885c3e4c35c4018.tar.gz
Bug#31891 Meaningful stack trace
On crashes generate a user-friendly resolved and demangled stack trace when libc provides the necessary functions (newer libc on i386, x86_64, powerpc, ia64, alpha and s390). Otherwise print a numeric stack trace as before, relying on resolve_stack_dump utility. configure.in: Add check for backtrace headers, backtrace functions and if __cxa_demangle (libstdc++) is available at link time. sql/mysqld.cc: Print the value of the THD::killed variable when dumping. In some circumstances knowing if the thread was killed makes debugging easier. sql/stacktrace.c: Use the glibc backtrace function when available and demangle C++ function names if the __cxa_demangle function is available. sql/stacktrace.h: Locally export and wrap in C linkage the C++ function __cxa_demangle if available.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in21
1 files changed, 18 insertions, 3 deletions
diff --git a/configure.in b/configure.in
index 1346a87c35a..2e623aacaf7 100644
--- a/configure.in
+++ b/configure.in
@@ -813,8 +813,8 @@ AC_CHECK_HEADERS(fcntl.h float.h floatingpoint.h ieeefp.h limits.h \
sys/timeb.h sys/types.h sys/un.h sys/vadvise.h sys/wait.h term.h \
unistd.h utime.h sys/utime.h termio.h termios.h sched.h crypt.h alloca.h \
sys/ioctl.h malloc.h sys/malloc.h sys/ipc.h sys/shm.h linux/config.h \
- sys/prctl.h \
- sys/resource.h sys/param.h port.h ieeefp.h)
+ sys/prctl.h sys/resource.h sys/param.h port.h ieeefp.h \
+ execinfo.h)
AC_CHECK_HEADERS([xfs/xfs.h])
@@ -2041,7 +2041,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)
+ posix_fallocate backtrace backtrace_symbols backtrace_symbols_fd)
#
#
@@ -2331,6 +2331,21 @@ then
fi
AC_MSG_RESULT("$netinet_inc")
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_CHECK_HEADERS(cxxabi.h)
+AC_CACHE_CHECK([checking for abi::__cxa_demangle], mysql_cv_cxa_demangle,
+[AC_TRY_LINK([#include <cxxabi.h>], [
+ char *foo= 0; int bar= 0;
+ foo= abi::__cxa_demangle(foo, foo, 0, &bar);
+], [mysql_cv_cxa_demangle=yes], [mysql_cv_cxa_demangle=no])])
+AC_LANG_RESTORE
+
+if test "x$mysql_cv_cxa_demangle" = xyes; then
+ AC_DEFINE(HAVE_ABI_CXA_DEMANGLE, 1,
+ [Define to 1 if you have the `abi::__cxa_demangle' function.])
+fi
+
#--------------------------------------------------------------------
# Check for requested features
#--------------------------------------------------------------------