Skip to content

Commit

Permalink
Import patches for old macOS from MacPorts
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Sep 25, 2024
1 parent 80e483a commit 6363e17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
5 changes: 3 additions & 2 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
set startup-with-shell off

define hook-run
set $color_type = 0
set $color_highlite = 0
Expand Down Expand Up @@ -1345,3 +1343,6 @@ define print_flags
end

source -s misc/gdb.py

# Moved from beginning, since it fails on older gdbs
set startup-with-shell off
3 changes: 2 additions & 1 deletion signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ check_stack_overflow(int sig, const uintptr_t addr, const ucontext_t *ctx)
const greg_t bp = mctx->gregs[REG_EBP];
# endif
# elif defined __APPLE__
# if __DARWIN_UNIX03
# include <AvailabilityMacros.h>
# if defined(MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
# define MCTX_SS_REG(reg) __ss.__##reg
# else
# define MCTX_SS_REG(reg) ss.reg
Expand Down
6 changes: 4 additions & 2 deletions vm_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,8 @@ rb_vmdebug_thread_dump_state(FILE *errout, VALUE self)
}

#if defined __APPLE__
# if __DARWIN_UNIX03
# include <AvailabilityMacros.h>
# if defined(MAC_OS_X_VERSION_10_5) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
# define MCTX_SS_REG(reg) __ss.__##reg
# else
# define MCTX_SS_REG(reg) ss.reg
Expand All @@ -502,7 +503,8 @@ rb_vmdebug_thread_dump_state(FILE *errout, VALUE self)
# ifdef HAVE_LIBUNWIND
# undef backtrace
# define backtrace unw_backtrace
# elif defined(__APPLE__) && defined(HAVE_LIBUNWIND_H)
# elif defined(__APPLE__) && defined(HAVE_LIBUNWIND_H) \
&& defined(MAC_OS_X_VERSION_10_6) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
# define UNW_LOCAL_ONLY
# include <libunwind.h>
# include <sys/mman.h>
Expand Down

0 comments on commit 6363e17

Please sign in to comment.