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