Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Side by Side Diff: base/mac/call_with_eh_frame.cc

Issue 1212093002: [Mac] Redo NSException handling, and generate better stacks for C++ exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Align stack Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/mac/call_with_eh_frame.h ('k') | base/mac/call_with_eh_frame_asm.S » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « base/mac/call_with_eh_frame.h ('k') | base/mac/call_with_eh_frame_asm.S » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698