Workaround lack of libunwind in WatchOS.
authortriton <joao@tritao.eu>
Wed, 23 Sep 2015 20:20:12 +0000 (21:20 +0100)
committertriton <joao@tritao.eu>
Wed, 23 Sep 2015 20:20:12 +0000 (21:20 +0100)
This is a temporary workaround until get correct fix is properly tested on device.

This makes us be able to compile the runtime with the latest Xcode SDK.

mono/utils/mono-context.h

index dc53e857aae60158bae7474d76c8a662dcdd8465..6faaedf14aa57923cb1ad81259136ab09f2ecb39 100644 (file)
 #include <signal.h>
 #endif
 
-#if defined (HOST_WATCHOS) || defined (HOST_APPLETVOS)
-#include <libunwind.h>
-#endif
-
 /*
  * General notes about mono-context.
  * Each arch defines a MonoContext struct with all GPR regs + IP/PC.
@@ -256,26 +252,6 @@ typedef struct {
 #if defined(HOST_WATCHOS)
 
 #define MONO_CONTEXT_GET_CURRENT(ctx) do { \
-       unw_context_t uctx; \
-       unw_cursor_t c; \
-       unw_word_t data; \
-       g_assert (unw_getcontext (&uctx) == 0); \
-       g_assert (unw_init_local (&c, &uctx) == 0); \
-       for (int reg = 0; reg < 13; ++reg) { \
-               unw_get_reg (&c, (unw_regnum_t) UNW_ARM_R0 + reg, &data); \
-               ctx.regs[reg] = data; \
-       } \
-       unw_get_reg (&c, UNW_ARM_SP, &data); \
-       ctx.regs[ARMREG_SP] = data; \
-       unw_get_reg (&c, UNW_ARM_LR, &data); \
-       ctx.regs[ARMREG_LR] = data; \
-       unw_get_reg (&c, UNW_ARM_IP, &data); \
-       ctx.regs[ARMREG_PC] = data; \
-       ctx.pc = ctx.regs[ARMREG_PC]; \
-       for (int reg = 0; reg < 16; ++reg) { \
-               unw_get_reg (&c, (unw_regnum_t) UNW_ARM_D0 + reg, &data); \
-               ctx.fregs[reg] = data; \
-       } \
 } while (0);
 
 #else