]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/AddressResolver.h
Upgrade to OpenSSH 7.3p1.
[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/lldb-private.h"
20 #include "lldb/Core/Address.h"
21 #include "lldb/Core/AddressRange.h"
22 #include "lldb/Host/FileSpec.h"
23 #include "lldb/Core/SearchFilter.h"
24 #include "lldb/Core/ConstString.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 resolver
39 /// answers this question (in the GetDepth method) and provides the resolution callback.
40 //----------------------------------------------------------------------
41
42 class AddressResolver :
43    public Searcher
44 {
45 public:
46
47     typedef enum
48     {
49         Exact,
50         Regexp,
51         Glob
52     } MatchType;
53
54
55     AddressResolver ();
56
57     ~AddressResolver () override;
58
59     virtual void
60     ResolveAddress (SearchFilter &filter);
61
62     virtual void
63     ResolveAddressInModules (SearchFilter &filter,
64                              ModuleList &modules);
65
66     void
67     GetDescription (Stream *s) override = 0;
68
69     std::vector<AddressRange> &
70     GetAddressRanges ();
71
72     size_t
73     GetNumberOfAddresses ();
74
75     AddressRange &
76     GetAddressRangeAtIndex (size_t idx);
77
78 protected:
79
80     std::vector<AddressRange> m_address_ranges;
81
82 private:
83     DISALLOW_COPY_AND_ASSIGN(AddressResolver);
84 };
85
86 } // namespace lldb_private
87
88 #endif // liblldb_AddressResolver_h_