1 //===-- Symtab.h ------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_UnwindTable_h
11 #define liblldb_UnwindTable_h
16 #include "lldb/lldb-private.h"
18 namespace lldb_private {
20 // A class which holds all the FuncUnwinders objects for a given ObjectFile.
21 // The UnwindTable is populated with FuncUnwinders objects lazily during
26 UnwindTable(ObjectFile &objfile);
29 lldb_private::DWARFCallFrameInfo *GetEHFrameInfo();
30 lldb_private::DWARFCallFrameInfo *GetDebugFrameInfo();
32 lldb_private::CompactUnwindInfo *GetCompactUnwindInfo();
34 ArmUnwindInfo *GetArmUnwindInfo();
36 lldb::FuncUnwindersSP GetFuncUnwindersContainingAddress(const Address &addr,
39 bool GetAllowAssemblyEmulationUnwindPlans();
41 // Normally when we create a new FuncUnwinders object we track it in this
42 // UnwindTable so it can
43 // be reused later. But for the target modules show-unwind we want to create
45 // UnwindPlans for the function of interest - so ignore any existing
46 // FuncUnwinders for that
47 // function and don't add this new one to our UnwindTable.
48 // This FuncUnwinders object does have a reference to the UnwindTable but the
50 // uncached FuncUnwinders is expected to be short so in practice this will not
53 GetUncachedFuncUnwindersContainingAddress(const Address &addr,
56 bool GetArchitecture(lldb_private::ArchSpec &arch);
62 llvm::Optional<AddressRange> GetAddressRange(const Address &addr,
65 typedef std::map<lldb::addr_t, lldb::FuncUnwindersSP> collection;
66 typedef collection::iterator iterator;
67 typedef collection::const_iterator const_iterator;
69 ObjectFile &m_object_file;
72 bool m_initialized; // delay some initialization until ObjectFile is set up
75 std::unique_ptr<DWARFCallFrameInfo> m_eh_frame_up;
76 std::unique_ptr<DWARFCallFrameInfo> m_debug_frame_up;
77 std::unique_ptr<CompactUnwindInfo> m_compact_unwind_up;
78 std::unique_ptr<ArmUnwindInfo> m_arm_unwind_up;
80 DISALLOW_COPY_AND_ASSIGN(UnwindTable);
83 } // namespace lldb_private
85 #endif // liblldb_UnwindTable_h