1 //===-- AddressResolver.h ---------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_AddressResolver_h_
10 #define liblldb_AddressResolver_h_
12 #include "lldb/Core/AddressRange.h"
13 #include "lldb/Core/SearchFilter.h"
14 #include "lldb/lldb-defines.h"
19 namespace lldb_private {
23 /// \class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h"
24 /// This class works with SearchFilter to resolve function names and source
25 /// file locations to their concrete addresses.
28 /// The AddressResolver is a Searcher. In that protocol, the SearchFilter
29 /// asks the question "At what depth of the symbol context descent do you want
30 /// your callback to get called?" of the filter. The resolver answers this
31 /// question (in the GetDepth method) and provides the resolution callback.
33 class AddressResolver : public Searcher {
35 enum MatchType { Exact, Regexp, Glob };
39 ~AddressResolver() override;
41 virtual void ResolveAddress(SearchFilter &filter);
43 virtual void ResolveAddressInModules(SearchFilter &filter,
46 void GetDescription(Stream *s) override = 0;
48 std::vector<AddressRange> &GetAddressRanges();
50 size_t GetNumberOfAddresses();
52 AddressRange &GetAddressRangeAtIndex(size_t idx);
55 std::vector<AddressRange> m_address_ranges;
58 DISALLOW_COPY_AND_ASSIGN(AddressResolver);
61 } // namespace lldb_private
63 #endif // liblldb_AddressResolver_h_