1 //===-- AddressResolver.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_AddressResolver_h_
11 #define liblldb_AddressResolver_h_
17 // Other libraries and framework 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"
26 namespace lldb_private {
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 //----------------------------------------------------------------------
34 //----------------------------------------------------------------------
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
40 /// answers this question (in the GetDepth method) and provides the resolution
42 //----------------------------------------------------------------------
44 class AddressResolver : public Searcher {
46 typedef enum { Exact, Regexp, Glob } MatchType;
50 ~AddressResolver() override;
52 virtual void ResolveAddress(SearchFilter &filter);
54 virtual void ResolveAddressInModules(SearchFilter &filter,
57 void GetDescription(Stream *s) override = 0;
59 std::vector<AddressRange> &GetAddressRanges();
61 size_t GetNumberOfAddresses();
63 AddressRange &GetAddressRangeAtIndex(size_t idx);
66 std::vector<AddressRange> m_address_ranges;
69 DISALLOW_COPY_AND_ASSIGN(AddressResolver);
72 } // namespace lldb_private
74 #endif // liblldb_AddressResolver_h_