From 7ff059d0e0fc5d52b9118a759cddc58af55acfa9 Mon Sep 17 00:00:00 2001 From: Dan Olson Date: Mon, 1 Feb 2016 21:35:36 -0800 Subject: [PATCH] Cache ARM EABI exception data Update ARM_EABI_UNWINDER eh personality so it caches handler data found during phase 1. The cache is not used yet, but personality did not function correctly without it. --- src/ldc/eh/libunwind.d | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ldc/eh/libunwind.d b/src/ldc/eh/libunwind.d index a1f1499520..3b21591dc7 100644 --- a/src/ldc/eh/libunwind.d +++ b/src/ldc/eh/libunwind.d @@ -247,7 +247,17 @@ struct NativeContext debug(EH_personality) printf(" - Found catch clause for %p\n", exception_struct); if (actions & _Unwind_Action.SEARCH_PHASE) + { + // Cache phase 1 data (TODO: take advantage of cache) + version (ARM_EABI_UNWINDER) with (exception_struct.unwind_info) + { + barrier_cache.sp = _Unwind_GetGR(context, UNWIND_STACK_REG); + barrier_cache.bitpattern[1] = ti_offset; + barrier_cache.bitpattern[3] = landingPadAddr; + } + return _Unwind_Reason_Code.HANDLER_FOUND; + } if (!(actions & _Unwind_Action.CLEANUP_PHASE)) fatalerror("Unknown phase");