LLDB  mainline
AddressResolver.h
Go to the documentation of this file.
1 //===-- AddressResolver.h ---------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLDB_CORE_ADDRESSRESOLVER_H
10 #define LLDB_CORE_ADDRESSRESOLVER_H
11 
12 #include "lldb/Core/AddressRange.h"
13 #include "lldb/Core/SearchFilter.h"
14 #include "lldb/lldb-defines.h"
15 
16 #include <cstddef>
17 #include <vector>
18 
19 namespace lldb_private {
20 class ModuleList;
21 class Stream;
22 
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.
26 
27 /// General Outline:
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.
32 
33 class AddressResolver : public Searcher {
34 public:
35  enum MatchType { Exact, Regexp, Glob };
36 
38 
39  ~AddressResolver() override;
40 
41  virtual void ResolveAddress(SearchFilter &filter);
42 
43  virtual void ResolveAddressInModules(SearchFilter &filter,
44  ModuleList &modules);
45 
46  void GetDescription(Stream *s) override = 0;
47 
48  std::vector<AddressRange> &GetAddressRanges();
49 
50  size_t GetNumberOfAddresses();
51 
53 
54 protected:
55  std::vector<AddressRange> m_address_ranges;
56 
57 private:
58  AddressResolver(const AddressResolver &) = delete;
59  const AddressResolver &operator=(const AddressResolver &) = delete;
60 };
61 
62 } // namespace lldb_private
63 
64 #endif // LLDB_CORE_ADDRESSRESOLVER_H
lldb_private::AddressResolver::GetAddressRanges
std::vector< AddressRange > & GetAddressRanges()
Definition: AddressResolver.cpp:33
lldb_private::AddressResolver::m_address_ranges
std::vector< AddressRange > m_address_ranges
Definition: AddressResolver.h:55
lldb_private::AddressResolver::ResolveAddress
virtual void ResolveAddress(SearchFilter &filter)
Definition: AddressResolver.cpp:29
lldb-defines.h
lldb_private::Stream
Definition: Stream.h:28
lldb_private::AddressResolver::operator=
const AddressResolver & operator=(const AddressResolver &)=delete
lldb_private::AddressResolver::~AddressResolver
~AddressResolver() override
lldb_private::AddressResolver::Regexp
@ Regexp
Definition: AddressResolver.h:35
lldb_private::ModuleList
Definition: ModuleList.h:72
lldb_private::SearchFilter
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:83
SearchFilter.h
lldb_private::AddressResolver::AddressResolver
AddressResolver()
lldb_private::AddressResolver::GetAddressRangeAtIndex
AddressRange & GetAddressRangeAtIndex(size_t idx)
Definition: AddressResolver.cpp:41
lldb_private::AddressResolver::GetNumberOfAddresses
size_t GetNumberOfAddresses()
Definition: AddressResolver.cpp:37
lldb_private::AddressRange
Definition: AddressRange.h:25
lldb_private::AddressResolver::MatchType
MatchType
Definition: AddressResolver.h:35
lldb_private::AddressResolver
General Outline: The AddressResolver is a Searcher.
Definition: AddressResolver.h:33
lldb_private::AddressResolver::Exact
@ Exact
Definition: AddressResolver.h:35
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::Searcher
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:42
lldb_private::AddressResolver::GetDescription
void GetDescription(Stream *s) override=0
Prints a canonical description for the searcher to the stream s.
lldb_private::AddressResolver::ResolveAddressInModules
virtual void ResolveAddressInModules(SearchFilter &filter, ModuleList &modules)
Definition: AddressResolver.cpp:24
lldb_private::AddressResolver::Glob
@ Glob
Definition: AddressResolver.h:35
AddressRange.h