xref: /aosp_15_r20/external/cronet/base/apple/call_with_eh_frame.h (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1 // Copyright 2015 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BASE_APPLE_CALL_WITH_EH_FRAME_H_
6 #define BASE_APPLE_CALL_WITH_EH_FRAME_H_
7 
8 #include "base/base_export.h"
9 
10 namespace base::apple {
11 
12 // Invokes the specified block in a stack frame with a special exception
13 // handler. This function creates an exception handling stack frame that
14 // specifies a custom C++ exception personality routine, which terminates the
15 // search for an exception handler at this frame.
16 //
17 // The purpose of this function is to prevent a try/catch statement in system
18 // libraries, acting as a global exception handler, from handling exceptions
19 // in such a way that disrupts the generation of useful stack traces.
20 void BASE_EXPORT CallWithEHFrame(void (^block)(void));
21 
22 }  // namespace base::apple
23 
24 #endif  // BASE_APPLE_CALL_WITH_EH_FRAME_H_
25