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 #include <vector> 20 21 namespace llvm { 22 namespace orc { 23 24 /// Register frames in the given eh-frame section with libunwind. 25 Error registerEHFrameSection(const void *EHFrameSectionAddr, 26 size_t EHFrameSectionSize); 27 28 /// Unregister frames in the given eh-frame section with libunwind. 29 Error deregisterEHFrameSection(const void *EHFrameSectionAddr, 30 size_t EHFrameSectionSize); 31 32 } // end namespace orc 33 } // end namespace llvm 34 35 extern "C" llvm::orc::tpctypes::CWrapperFunctionResult 36 llvm_orc_registerEHFrameSectionWrapper(uint8_t *Data, uint64_t Size); 37 38 extern "C" llvm::orc::tpctypes::CWrapperFunctionResult 39 llvm_orc_deregisterEHFrameSectionWrapper(uint8_t *Data, uint64_t Size); 40 41 #endif // LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_REGISTEREHFRAMES_H 42