OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/mac/call_with_eh_frame.h" |
| 6 |
| 7 #include <unwind.h> |
| 8 |
| 9 #include "build/build_config.h" |
| 10 |
| 11 namespace base { |
| 12 namespace mac { |
| 13 |
| 14 _Unwind_Reason_Code CxxPersonalityRoutine( |
| 15 int version, |
| 16 _Unwind_Action actions, |
| 17 uint64_t exceptionClass, |
| 18 struct _Unwind_Exception* exceptionObject, |
| 19 struct _Unwind_Context* context) { |
| 20 // Tell libunwind that this is the end of the stack. When it encounters the |
| 21 // CallWithEHFrame, it will stop searching for an exception handler. The |
| 22 // result is that no exception handler has been found higher on the stack, |
| 23 // and any that are lower on the stack (e.g. in CFRunLoopRunSpecific), will |
| 24 // now be skipped. Since this is reporting the end of the stack, and no |
| 25 // exception handler will have been found, std::terminate() will be called. |
| 26 return _URC_END_OF_STACK; |
| 27 } |
| 28 |
| 29 #if defined(OS_IOS) |
| 30 // No iOS assembly implementation exists, so just call the block directly. |
| 31 void CallWithEHFrame(void (^block)(void)) { |
| 32 block(); |
| 33 } |
| 34 #endif |
| 35 |
| 36 } // namespace mac |
| 37 } // namespace base |
OLD | NEW |