Project

General

Profile

Feature #17638 » ruby-cygwin-backtrace.patch

xtkoba (Tee KOBAYASHI), 02/27/2021 10:48 PM

View differences:

configure.ac
AS_IF([test "x$ac_cv_header_execinfo_h" = xyes], [
AC_CHECK_LIB([execinfo], [backtrace])
AC_CHECK_LIB([unwind], [unw_backtrace])
])])
])],
[*-cygwin*], [
AS_IF([test "x$ac_cv_func_sigaltstack" = xno], [
AC_CACHE_CHECK(for CaptureStackBackTrace, rb_cv_have_CaptureStackBackTrace, [
AC_LINK_IFELSE([AC_LANG_SOURCE([[
#include <windows.h>
#define TRACE_SIZE 256
void *trace[TRACE_SIZE];
int
main()
{
CaptureStackBackTrace(0, TRACE_SIZE, trace, NULL);
return 0;
}
]])],
rb_cv_have_CaptureStackBackTrace=yes,
rb_cv_have_CaptureStackBackTrace=no)
])
AS_IF([test "$rb_cv_have_CaptureStackBackTrace" = yes], [
AC_DEFINE(HAVE_CAPTURESTACKBACKTRACE, 1)
])])])
AC_CHECK_FUNCS(backtrace)
AS_IF([test "x$ac_cv_func_backtrace" = xyes], [
-- a/vm_dump.c
++ b/vm_dump.c
......
# undef HAVE_BACKTRACE
# define HAVE_BACKTRACE 0
# endif
#elif defined(__CYGWIN__) && defined(HAVE_CAPTURESTACKBACKTRACE) && \
defined(USE_LIBBACKTRACE)
# define HAVE_BACKTRACE 1
# include <windows.h>
# undef backtrace
# define backtrace(buffer, size) CaptureStackBackTrace(0, size, buffer, NULL)
#else
# define HAVE_BACKTRACE 0
#endif
(3-3/3)