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_
13 #include "lldb/Core/AddressRange.h"
14 #include "lldb/Core/SearchFilter.h"
15 #include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
17 #include <stddef.h> // for size_t
20 namespace lldb_private {
23 namespace lldb_private {
26 namespace lldb_private {
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 //----------------------------------------------------------------------
34 //----------------------------------------------------------------------
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 //----------------------------------------------------------------------
42 class AddressResolver : public Searcher {
44 typedef enum { Exact, Regexp, Glob } MatchType;
48 ~AddressResolver() override;
50 virtual void ResolveAddress(SearchFilter &filter);
52 virtual void ResolveAddressInModules(SearchFilter &filter,
55 void GetDescription(Stream *s) override = 0;
57 std::vector<AddressRange> &GetAddressRanges();
59 size_t GetNumberOfAddresses();
61 AddressRange &GetAddressRangeAtIndex(size_t idx);
64 std::vector<AddressRange> m_address_ranges;
67 DISALLOW_COPY_AND_ASSIGN(AddressResolver);
70 } // namespace lldb_private
72 #endif // liblldb_AddressResolver_h_