]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Symbol/UnwindTable.h
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Symbol / UnwindTable.h
1 //===-- Symtab.h ------------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10
11 #ifndef liblldb_UnwindTable_h
12 #define liblldb_UnwindTable_h
13
14 #include <map>
15
16 #include "lldb/lldb-private.h" 
17 #include "lldb/Host/Mutex.h"
18
19 namespace lldb_private {
20
21 // A class which holds all the FuncUnwinders objects for a given ObjectFile.
22 // The UnwindTable is populated with FuncUnwinders objects lazily during
23 // the debug session.
24
25 class UnwindTable
26 {
27 public:
28     UnwindTable(ObjectFile& objfile);
29     ~UnwindTable();
30
31     lldb_private::DWARFCallFrameInfo *
32     GetEHFrameInfo ();
33
34     lldb_private::CompactUnwindInfo *
35     GetCompactUnwindInfo ();
36
37     lldb::FuncUnwindersSP
38     GetFuncUnwindersContainingAddress (const Address& addr, SymbolContext &sc);
39
40 // Normally when we create a new FuncUnwinders object we track it in this UnwindTable so it can
41 // be reused later.  But for the target modules show-unwind we want to create brand new 
42 // UnwindPlans for the function of interest - so ignore any existing FuncUnwinders for that
43 // function and don't add this new one to our UnwindTable.
44 // This FuncUnwinders object does have a reference to the UnwindTable but the lifetime of this
45 // uncached FuncUnwinders is expected to be short so in practice this will not be a problem.
46     lldb::FuncUnwindersSP
47     GetUncachedFuncUnwindersContainingAddress (const Address& addr, SymbolContext &sc);
48
49     bool
50     GetArchitecture (lldb_private::ArchSpec &arch);
51
52 private:
53     void
54     Dump (Stream &s);
55     
56     void Initialize ();
57
58     typedef std::map<lldb::addr_t, lldb::FuncUnwindersSP> collection;
59     typedef collection::iterator iterator;
60     typedef collection::const_iterator const_iterator;
61
62     ObjectFile&         m_object_file;
63     collection          m_unwinds;
64
65     bool                m_initialized;  // delay some initialization until ObjectFile is set up
66     Mutex               m_mutex;
67
68     DWARFCallFrameInfo* m_eh_frame;
69     CompactUnwindInfo  *m_compact_unwind;
70     
71     DISALLOW_COPY_AND_ASSIGN (UnwindTable);
72 };
73
74 } // namespace lldb_private
75
76 #endif  // liblldb_UnwindTable_h