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
14#include "lldb/lldb-defines.h"
15
16#include <cstddef>
17#include <vector>
18
19namespace lldb_private {
20class ModuleList;
21class 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
33class AddressResolver : public Searcher {
34public:
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
54protected:
55 std::vector<AddressRange> m_address_ranges;
56
57private:
59 const AddressResolver &operator=(const AddressResolver &) = delete;
60};
61
62} // namespace lldb_private
63
64#endif // LLDB_CORE_ADDRESSRESOLVER_H
A section + offset based address range class.
Definition: AddressRange.h:25
General Outline: The AddressResolver is a Searcher.
std::vector< AddressRange > & GetAddressRanges()
const AddressResolver & operator=(const AddressResolver &)=delete
virtual void ResolveAddressInModules(SearchFilter &filter, ModuleList &modules)
void GetDescription(Stream *s) override=0
Prints a canonical description for the searcher to the stream s.
virtual void ResolveAddress(SearchFilter &filter)
std::vector< AddressRange > m_address_ranges
AddressResolver(const AddressResolver &)=delete
AddressRange & GetAddressRangeAtIndex(size_t idx)
A collection class for Module objects.
Definition: ModuleList.h:103
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:83
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:42
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
A class that represents a running process on the host machine.
Definition: SBAttachInfo.h:14