]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/AddressResolver.h
Merge clang trunk r300422 and resolve conflicts.
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / AddressResolver.h
1 //===-- AddressResolver.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 #ifndef liblldb_AddressResolver_h_
11 #define liblldb_AddressResolver_h_
12
13 #include <vector>
14
15 // C Includes
16 // C++ Includes
17 // Other libraries and framework includes
18 // Project includes
19 #include "lldb/Core/Address.h"
20 #include "lldb/Core/AddressRange.h"
21 #include "lldb/Core/ConstString.h"
22 #include "lldb/Core/SearchFilter.h"
23 #include "lldb/Host/FileSpec.h"
24 #include "lldb/lldb-private.h"
25
26 namespace lldb_private {
27
28 //----------------------------------------------------------------------
29 /// @class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h"
30 /// @brief This class works with SearchFilter to resolve function names and
31 /// source file locations to their concrete addresses.
32 //----------------------------------------------------------------------
33
34 //----------------------------------------------------------------------
35 /// General Outline:
36 /// The AddressResolver is a Searcher.  In that protocol,
37 /// the SearchFilter asks the question "At what depth of the symbol context
38 /// descent do you want your callback to get called?" of the filter.  The
39 /// resolver
40 /// answers this question (in the GetDepth method) and provides the resolution
41 /// callback.
42 //----------------------------------------------------------------------
43
44 class AddressResolver : public Searcher {
45 public:
46   typedef enum { Exact, Regexp, Glob } MatchType;
47
48   AddressResolver();
49
50   ~AddressResolver() override;
51
52   virtual void ResolveAddress(SearchFilter &filter);
53
54   virtual void ResolveAddressInModules(SearchFilter &filter,
55                                        ModuleList &modules);
56
57   void GetDescription(Stream *s) override = 0;
58
59   std::vector<AddressRange> &GetAddressRanges();
60
61   size_t GetNumberOfAddresses();
62
63   AddressRange &GetAddressRangeAtIndex(size_t idx);
64
65 protected:
66   std::vector<AddressRange> m_address_ranges;
67
68 private:
69   DISALLOW_COPY_AND_ASSIGN(AddressResolver);
70 };
71
72 } // namespace lldb_private
73
74 #endif // liblldb_AddressResolver_h_