Skip to content

Commit

Permalink
Add SUPPORT_UNWIND_FORCE_DWARF flag to be compatible with BB
Browse files Browse the repository at this point in the history
  • Loading branch information
omus committed Jan 17, 2021
1 parent a623b91 commit 770b169
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Make.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1022,6 +1022,8 @@ else
ifeq ($(OS),Darwin)
LIBUNWIND:=-lunwind
JCPPFLAGS+=-DLLVMLIBUNWIND
# The BinaryBuilder version of LLVM libunwind currently doesn't have the patch to support forcing DWARF
#JCPPFLAGS+=-DSUPPORT_UNWIND_FORCE_DWARF
else
LIBUNWIND:=-lunwind
endif
Expand Down
4 changes: 4 additions & 0 deletions src/stackwalk.c
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,11 @@ NOINLINE size_t rec_backtrace_ctx_dwarf(jl_bt_element_t *bt_data, size_t maxsize
{
size_t bt_size = 0;
bt_cursor_t cursor;
#ifdef SUPPORT_UNWIND_FORCE_DWARF
if (unw_init_local_dwarf(&cursor, context) != UNW_ESUCCESS)
#else
if (unw_init_local(&cursor, context) != UNW_ESUCCESS)
#endif
return 0;
jl_unw_stepn(&cursor, bt_data, &bt_size, NULL, maxsize, 0, &pgcstack, 1);
return bt_size;
Expand Down

0 comments on commit 770b169

Please sign in to comment.