OSDN Git Service

[CrashRecovery] Use SEH __try instead of VEH when available
authorReid Kleckner <rnk@google.com>
Wed, 17 May 2017 17:02:16 +0000 (17:02 +0000)
committerReid Kleckner <rnk@google.com>
Wed, 17 May 2017 17:02:16 +0000 (17:02 +0000)
commit8d2c1f540ea3e851bd9e331d5cb0199f5c3c2efe
tree6bb6875245be8066d322a690d6243e8e2232cc0d
parente9eda65f4b41f4fcdbcd34faafa410cea931e099
[CrashRecovery] Use SEH __try instead of VEH when available

Summary:
It avoids problems when other libraries raise exceptions. In particular,
OutputDebugString raises an exception that the debugger is supposed to
catch and suppress. VEH kicks in first right now, and that is entirely
incorrect.

Unfortunately, GCC does not support SEH, so I've kept the old buggy VEH
codepath around. We could fix it with SetUnhandledExceptionFilter, but
that is not per-thread, so a well-behaved library shouldn't set it.

Reviewers: zturner

Subscribers: llvm-commits, mgorny

Differential Revision: https://reviews.llvm.org/D33261

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@303274 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Support/CrashRecoveryContext.cpp
unittests/Support/CMakeLists.txt
unittests/Support/CrashRecoveryTest.cpp [new file with mode: 0644]