Project

General

Profile

Feature #17752 ยป ruby-USE_BACKTRACE.patch

Define `USE_BACKTRACE` instead of abusing `HAVE_BACKTRACE` - xtkoba (Tee KOBAYASHI), 03/27/2021 12:20 PM

View differences:

vm_dump.c
470 470
#endif
471 471

  
472 472
#if defined(HAVE_BACKTRACE)
473
# define USE_BACKTRACE 1
473 474
# ifdef HAVE_LIBUNWIND
474 475
#  undef backtrace
475 476
#  define backtrace unw_backtrace
......
572 573
    return n;
573 574
}
574 575
# elif defined(BROKEN_BACKTRACE)
575
#  undef HAVE_BACKTRACE
576
#  define HAVE_BACKTRACE 0
576
#  undef USE_BACKTRACE
577
#  define USE_BACKTRACE 0
577 578
# endif
578 579
#else
579
# define HAVE_BACKTRACE 0
580
# define USE_BACKTRACE 0
580 581
#endif
581 582

  
582
#if HAVE_BACKTRACE
583
#if USE_BACKTRACE
583 584
# include <execinfo.h>
584 585
#elif defined(_WIN32)
585 586
# include <imagehlp.h>
......
752 753
void
753 754
rb_print_backtrace(void)
754 755
{
755
#if HAVE_BACKTRACE
756
#if USE_BACKTRACE
756 757
#define MAX_NATIVE_TRACE 1024
757 758
    static void *trace[MAX_NATIVE_TRACE];
758 759
    int n = (int)backtrace(trace, MAX_NATIVE_TRACE);
......
1037 1038

  
1038 1039
    rb_dump_machine_register(ctx);
1039 1040

  
1040
#if HAVE_BACKTRACE || defined(_WIN32)
1041
#if USE_BACKTRACE || defined(_WIN32)
1041 1042
    fprintf(stderr, "-- C level backtrace information "
1042 1043
	    "-------------------------------------------\n");
1043 1044
    rb_print_backtrace();
1044 1045

  
1045 1046

  
1046 1047
    fprintf(stderr, "\n");
1047
#endif /* HAVE_BACKTRACE */
1048
#endif /* USE_BACKTRACE */
1048 1049

  
1049 1050
    if (other_runtime_info || vm) {
1050 1051
	fprintf(stderr, "-- Other runtime information "