1 //===----- RegisterEHFrames.h -- Register EH frame sections -----*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 // 9 // Support for dynamically registering and deregistering eh-frame sections 10 // in-process via libunwind. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H 15 #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H 16 17 #include "llvm/ExecutionEngine/Orc/Shared/TargetProcessControlTypes.h" 18 #include "llvm/Support/Error.h" 19 20 namespace llvm { 21 namespace orc { 22 23 /// Register frames in the given eh-frame section with libunwind. 24 Error registerEHFrameSection(const void *EHFrameSectionAddr, 25 size_t EHFrameSectionSize); 26 27 /// Unregister frames in the given eh-frame section with libunwind. 28 Error deregisterEHFrameSection(const void *EHFrameSectionAddr, 29 size_t EHFrameSectionSize); 30 31 } // end namespace orc 32 } // end namespace llvm 33 34 extern "C" llvm::orc::tpctypes::CWrapperFunctionResult 35 llvm_orc_registerEHFrameSectionWrapper(uint8_t *Data, uint64_t Size); 36 37 extern "C" llvm::orc::tpctypes::CWrapperFunctionResult 38 llvm_orc_deregisterEHFrameSectionWrapper(uint8_t *Data, uint64_t Size); 39 40 #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H 41