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 the
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 be reused later. But for the target modules show-
43 // unwind we want to create brand new UnwindPlans for the function of
44 // interest - so ignore any existing FuncUnwinders for that function and
45 // don't add this new one to our UnwindTable. This FuncUnwinders object does
46 // have a reference to the UnwindTable but the lifetime of this uncached
47 // FuncUnwinders is expected to be short so in practice this will not be a
50 GetUncachedFuncUnwindersContainingAddress(const Address &addr,
53 ArchSpec GetArchitecture();
59 llvm::Optional<AddressRange> GetAddressRange(const Address &addr,
62 typedef std::map<lldb::addr_t, lldb::FuncUnwindersSP> collection;
63 typedef collection::iterator iterator;
64 typedef collection::const_iterator const_iterator;
66 ObjectFile &m_object_file;
69 bool m_initialized; // delay some initialization until ObjectFile is set up
72 std::unique_ptr<DWARFCallFrameInfo> m_eh_frame_up;
73 std::unique_ptr<DWARFCallFrameInfo> m_debug_frame_up;
74 std::unique_ptr<CompactUnwindInfo> m_compact_unwind_up;
75 std::unique_ptr<ArmUnwindInfo> m_arm_unwind_up;
77 DISALLOW_COPY_AND_ASSIGN(UnwindTable);
80 } // namespace lldb_private
82 #endif // liblldb_UnwindTable_h