1 //===-- UnwindTable.h -------------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_UnwindTable_h
10 #define liblldb_UnwindTable_h
15 #include "lldb/lldb-private.h"
17 namespace lldb_private {
19 // A class which holds all the FuncUnwinders objects for a given ObjectFile.
20 // The UnwindTable is populated with FuncUnwinders objects lazily during the
25 /// Create an Unwind table using the data in the given module.
26 explicit UnwindTable(Module &module);
30 lldb_private::DWARFCallFrameInfo *GetEHFrameInfo();
31 lldb_private::DWARFCallFrameInfo *GetDebugFrameInfo();
33 lldb_private::CompactUnwindInfo *GetCompactUnwindInfo();
35 ArmUnwindInfo *GetArmUnwindInfo();
36 SymbolFile *GetSymbolFile();
38 lldb::FuncUnwindersSP GetFuncUnwindersContainingAddress(const Address &addr,
41 bool GetAllowAssemblyEmulationUnwindPlans();
43 // Normally when we create a new FuncUnwinders object we track it in this
44 // UnwindTable so it can be reused later. But for the target modules show-
45 // unwind we want to create brand new UnwindPlans for the function of
46 // interest - so ignore any existing FuncUnwinders for that function and
47 // don't add this new one to our UnwindTable. This FuncUnwinders object does
48 // have a reference to the UnwindTable but the lifetime of this uncached
49 // FuncUnwinders is expected to be short so in practice this will not be a
52 GetUncachedFuncUnwindersContainingAddress(const Address &addr,
55 ArchSpec GetArchitecture();
61 llvm::Optional<AddressRange> GetAddressRange(const Address &addr,
64 typedef std::map<lldb::addr_t, lldb::FuncUnwindersSP> collection;
65 typedef collection::iterator iterator;
66 typedef collection::const_iterator const_iterator;
71 bool m_initialized; // delay some initialization until ObjectFile is set up
74 std::unique_ptr<DWARFCallFrameInfo> m_eh_frame_up;
75 std::unique_ptr<DWARFCallFrameInfo> m_debug_frame_up;
76 std::unique_ptr<CompactUnwindInfo> m_compact_unwind_up;
77 std::unique_ptr<ArmUnwindInfo> m_arm_unwind_up;
79 DISALLOW_COPY_AND_ASSIGN(UnwindTable);
82 } // namespace lldb_private
84 #endif // liblldb_UnwindTable_h