Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:44

0001 //===-- AddressResolver.h ---------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_CORE_ADDRESSRESOLVER_H
0010 #define LLDB_CORE_ADDRESSRESOLVER_H
0011 
0012 #include "lldb/Core/AddressRange.h"
0013 #include "lldb/Core/SearchFilter.h"
0014 #include "lldb/lldb-defines.h"
0015 
0016 #include <cstddef>
0017 #include <vector>
0018 
0019 namespace lldb_private {
0020 class ModuleList;
0021 class Stream;
0022 
0023 /// \class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h"
0024 /// This class works with SearchFilter to resolve function names and source
0025 /// file locations to their concrete addresses.
0026 
0027 /// General Outline:
0028 /// The AddressResolver is a Searcher.  In that protocol, the SearchFilter
0029 /// asks the question "At what depth of the symbol context descent do you want
0030 /// your callback to get called?" of the filter.  The resolver answers this
0031 /// question (in the GetDepth method) and provides the resolution callback.
0032 
0033 class AddressResolver : public Searcher {
0034 public:
0035   enum MatchType { Exact, Regexp, Glob };
0036 
0037   AddressResolver();
0038 
0039   ~AddressResolver() override;
0040 
0041   virtual void ResolveAddress(SearchFilter &filter);
0042 
0043   virtual void ResolveAddressInModules(SearchFilter &filter,
0044                                        ModuleList &modules);
0045 
0046   void GetDescription(Stream *s) override = 0;
0047 
0048   std::vector<AddressRange> &GetAddressRanges();
0049 
0050   size_t GetNumberOfAddresses();
0051 
0052   AddressRange &GetAddressRangeAtIndex(size_t idx);
0053 
0054 protected:
0055   std::vector<AddressRange> m_address_ranges;
0056 
0057 private:
0058   AddressResolver(const AddressResolver &) = delete;
0059   const AddressResolver &operator=(const AddressResolver &) = delete;
0060 };
0061 
0062 } // namespace lldb_private
0063 
0064 #endif // LLDB_CORE_ADDRESSRESOLVER_H