ARM: disable stack unwinding using DWARF (#6700)
authorhqueue <hqueue@users.noreply.github.com>
Thu, 11 Aug 2016 16:21:41 +0000 (01:21 +0900)
committerJan Kotas <jkotas@microsoft.com>
Thu, 11 Aug 2016 16:21:41 +0000 (09:21 -0700)
libunwind for ARM does not interpret ARM vfpv3/NEON
registers in DWARF format correctly.

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
src/coreclr/hosts/unixcoreruncommon/coreruncommon.cpp

index b4c54ca..e3f7809 100644 (file)
@@ -285,6 +285,20 @@ int ExecuteManagedAssembly(
     // Indicates failure
     int exitCode = -1;
 
+#ifdef _TARGET_ARM_
+    // libunwind library is used to unwind stack frame, but libunwind for ARM
+    // does not support ARM vfpv3/NEON registers in DWARF format correctly.
+    // Therefore let's disable stack unwinding using DWARF information
+    // See https://github.com/dotnet/coreclr/issues/6698
+    //
+    // libunwind use following methods to unwind stack frame.
+    // UNW_ARM_METHOD_ALL          0xFF
+    // UNW_ARM_METHOD_DWARF        0x01
+    // UNW_ARM_METHOD_FRAME        0x02
+    // UNW_ARM_METHOD_EXIDX        0x04
+    putenv(const_cast<char *>("UNW_ARM_UNWIND_METHOD=6"));
+#endif // _TARGET_ARM_
+
     std::string coreClrDllPath(clrFilesAbsolutePath);
     coreClrDllPath.append("/");
     coreClrDllPath.append(coreClrDll);