Sha256: 3115310ef4724877b29c96699899d88b251b5f4dcffb9f4be4c6f6e79530091a
Contents?: true
Size: 1.85 KB
Versions: 2
Compression:
Stored size: 1.85 KB
Contents
dnl Copyright (C) 2009 Sun Microsystems, Inc. dnl This file is free software; Sun Microsystems, Inc. dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Try to define a macro to dump the current callstack. AC_DEFUN([PANDORA_PRINT_CALLSTACK],[ AC_CHECK_HEADERS([ucontext.h]) AS_IF([test "x$ac_cv_header_ucontext_h" = "xyes"], [ AC_CHECK_FUNCS([printstack]) ]) AS_IF([ test "x$ac_cv_func_printstack" != "xyes"], [ AC_CHECK_HEADERS([dlfcn.h]) AC_CHECK_HEADERS([execinfo.h]) AC_CHECK_FUNCS([backtrace]) AC_CHECK_FUNCS([backtrace_symbols_fd]) ]) AH_BOTTOM([ #ifdef __cplusplus #include <cstdio> #define PANDORA_PRINTSTACK_STD_PREFIX std:: #else #include <stdio.h> #define PANDORA_PRINTSTACK_STD_PREFIX #endif #if defined(HAVE_UCONTEXT_H) && defined(HAVE_PRINTSTACK) #include <ucontext.h> #define pandora_print_callstack(a) \ printstack(PANDORA_PRINTSTACK_STD_PREFIX fileno(a)) #elif defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS_FD) #include <execinfo.h> #define pandora_print_callstack(a) \ { \ void *stack[100]; \ int depth = backtrace(stack, 100); \ backtrace_symbols_fd(stack, depth, PANDORA_PRINTSTACK_STD_PREFIX fileno(a)); \ } #elif defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS) && !defined(HAVE_BACKTRACE_SYMBOLS_FD) #include <execinfo.h> #define pandora_print_callstack(a) \ { \ void *stack[100]; \ int depth= backtrace(stack, 100); \ char **symbol= backtrace_symbols(stack, depth); \ for (int x= 0; x < size; ++x) \ PANDORA_PRINTSTACK_STD_PREFIX fprintf(a, "%s\n", symbol[x]); \ } #else #define pandora_print_callstack(a) \ PANDORA_PRINTSTACK_STD_PREFIX fprintf(a, \ "Stackdump not supported for this platform\n"); #endif ]) ])
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
couchbase-memcached-1.2.9 | ext/libmemcached-0.50/m4/pandora_print_callstack.m4 |
couchbase-memcached-1.2.8 | ext/libmemcached-0.50/m4/pandora_print_callstack.m4 |