File indexing completed on 2026-05-10 08:43:52
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_UNWINDINFOMANAGER_H
0015 #define LLVM_EXECUTIONENGINE_ORC_TARGETPROCESS_UNWINDINFOMANAGER_H
0016
0017 #include "llvm/ExecutionEngine/Orc/Shared/ExecutorAddress.h"
0018 #include "llvm/Support/Error.h"
0019 #include <map>
0020 #include <mutex>
0021
0022 namespace llvm::orc {
0023
0024 class UnwindInfoManager {
0025 public:
0026
0027
0028 struct UnwindSections {
0029 uintptr_t dso_base;
0030 uintptr_t dwarf_section;
0031 size_t dwarf_section_length;
0032 uintptr_t compact_unwind_section;
0033 size_t compact_unwind_section_length;
0034 };
0035
0036 UnwindInfoManager(UnwindInfoManager &&) = delete;
0037 UnwindInfoManager &operator=(UnwindInfoManager &&) = delete;
0038 ~UnwindInfoManager();
0039
0040
0041
0042
0043
0044 static bool TryEnable();
0045
0046 static void addBootstrapSymbols(StringMap<ExecutorAddr> &M);
0047
0048 static Error registerSections(ArrayRef<orc::ExecutorAddrRange> CodeRanges,
0049 orc::ExecutorAddr DSOBase,
0050 orc::ExecutorAddrRange DWARFEHFrame,
0051 orc::ExecutorAddrRange CompactUnwind);
0052
0053 static Error deregisterSections(ArrayRef<orc::ExecutorAddrRange> CodeRanges);
0054
0055 private:
0056 UnwindInfoManager() = default;
0057
0058 int findSectionsImpl(uintptr_t Addr, UnwindSections *Info);
0059 static int findSections(uintptr_t Addr, UnwindSections *Info);
0060
0061 Error registerSectionsImpl(ArrayRef<orc::ExecutorAddrRange> CodeRanges,
0062 orc::ExecutorAddr DSOBase,
0063 orc::ExecutorAddrRange DWARFEHFrame,
0064 orc::ExecutorAddrRange CompactUnwind);
0065
0066 Error deregisterSectionsImpl(ArrayRef<orc::ExecutorAddrRange> CodeRanges);
0067
0068 std::mutex M;
0069 std::map<uintptr_t, UnwindSections> UWSecs;
0070 };
0071
0072 }
0073
0074 #endif