LLDB  mainline
BreakpointResolverAddress.h
Go to the documentation of this file.
1 //===-- BreakpointResolverAddress.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_BREAKPOINT_BREAKPOINTRESOLVERADDRESS_H
10 #define LLDB_BREAKPOINT_BREAKPOINTRESOLVERADDRESS_H
11 
13 #include "lldb/Core/ModuleSpec.h"
14 
15 namespace lldb_private {
16 
17 /// \class BreakpointResolverAddress BreakpointResolverAddress.h
18 /// "lldb/Breakpoint/BreakpointResolverAddress.h" This class sets breakpoints
19 /// on a given Address. This breakpoint only takes once, and then it won't
20 /// attempt to reset itself.
21 
23 public:
24  BreakpointResolverAddress(const lldb::BreakpointSP &bkpt,
25  const Address &addr);
26 
27  BreakpointResolverAddress(const lldb::BreakpointSP &bkpt,
28  const Address &addr,
29  const FileSpec &module_spec);
30 
31  ~BreakpointResolverAddress() override = default;
32 
33  static BreakpointResolver *
34  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
35  const StructuredData::Dictionary &options_dict,
36  Status &error);
37 
39 
40  void ResolveBreakpoint(SearchFilter &filter) override;
41 
43  ModuleList &modules) override;
44 
46  SymbolContext &context,
47  Address *addr) override;
48 
49  lldb::SearchDepth GetDepth() override;
50 
51  void GetDescription(Stream *s) override;
52 
53  void Dump(Stream *s) const override;
54 
55  /// Methods for support type inquiry through isa, cast, and dyn_cast:
56  static inline bool classof(const BreakpointResolverAddress *) { return true; }
57  static inline bool classof(const BreakpointResolver *V) {
59  }
60 
61  lldb::BreakpointResolverSP
62  CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
63 
64 protected:
65  Address m_addr; // The address - may be Section Offset or
66  // may be just an offset
67  lldb::addr_t m_resolved_addr; // The current value of the resolved load
68  // address for this breakpoint,
69  FileSpec m_module_filespec; // If this filespec is Valid, and m_addr is an
70  // offset, then it will be converted
71  // to a Section+Offset address in this module, whenever that module gets
72  // around to being loaded.
73 private:
76  operator=(const BreakpointResolverAddress &) = delete;
77 };
78 
79 } // namespace lldb_private
80 
81 #endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERADDRESS_H
lldb_private::BreakpointResolverAddress::BreakpointResolverAddress
BreakpointResolverAddress(const lldb::BreakpointSP &bkpt, const Address &addr)
lldb_private::BreakpointResolverAddress::CopyForBreakpoint
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
Definition: BreakpointResolverAddress.cpp:178
lldb_private::StructuredData::Dictionary
Definition: StructuredData.h:352
lldb_private::BreakpointResolverAddress::ResolveBreakpointInModules
void ResolveBreakpointInModules(SearchFilter &filter, ModuleList &modules) override
In response to this method the resolver scans the modules in the module list modules,...
Definition: BreakpointResolverAddress.cpp:107
lldb_private::BreakpointResolverAddress::m_addr
Address m_addr
Definition: BreakpointResolverAddress.h:65
lldb::SearchDepth
SearchDepth
Definition: lldb-enumerations.h:283
ModuleSpec.h
lldb_private::BreakpointResolverAddress::classof
static bool classof(const BreakpointResolverAddress *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: BreakpointResolverAddress.h:56
lldb_private::BreakpointResolver::AddressResolver
@ AddressResolver
Definition: BreakpointResolver.h:129
BreakpointResolver.h
lldb_private::Stream
Definition: Stream.h:28
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::BreakpointResolverAddress::CreateFromStructuredData
static BreakpointResolver * CreateFromStructuredData(const lldb::BreakpointSP &bkpt, const StructuredData::Dictionary &options_dict, Status &error)
Definition: BreakpointResolverAddress.cpp:36
lldb_private::BreakpointResolverAddress::SerializeToStructuredData
StructuredData::ObjectSP SerializeToStructuredData() override
Definition: BreakpointResolverAddress.cpp:66
lldb_private::FileSpec
Definition: FileSpec.h:56
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::BreakpointResolverAddress::Dump
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
Definition: BreakpointResolverAddress.cpp:175
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
lldb_private::BreakpointResolverAddress::operator=
const BreakpointResolverAddress & operator=(const BreakpointResolverAddress &)=delete
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::BreakpointResolverAddress::ResolveBreakpoint
void ResolveBreakpoint(SearchFilter &filter) override
In response to this method the resolver scans all the modules in the breakpoint's target,...
Definition: BreakpointResolverAddress.cpp:92
lldb_private::Searcher::CallbackReturn
CallbackReturn
Definition: SearchFilter.h:44
lldb_private::BreakpointResolverAddress::GetDepth
lldb::SearchDepth GetDepth() override
Definition: BreakpointResolverAddress.cpp:164
lldb_private::BreakpointResolverAddress::classof
static bool classof(const BreakpointResolver *V)
Definition: BreakpointResolverAddress.h:57
lldb_private::BreakpointResolverAddress::m_module_filespec
FileSpec m_module_filespec
Definition: BreakpointResolverAddress.h:69
lldb_private::BreakpointResolver
General Outline: The BreakpointResolver is a Searcher.
Definition: BreakpointResolver.h:35
lldb_private::Status
Definition: Status.h:44
lldb_private::Address
Definition: Address.h:59
lldb_private::BreakpointResolverAddress::GetDescription
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
Definition: BreakpointResolverAddress.cpp:168
lldb_private::BreakpointResolverAddress
Definition: BreakpointResolverAddress.h:22
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::BreakpointResolverAddress::m_resolved_addr
lldb::addr_t m_resolved_addr
Definition: BreakpointResolverAddress.h:67
lldb_private::BreakpointResolverAddress::~BreakpointResolverAddress
~BreakpointResolverAddress() override=default
lldb_private::BreakpointResolverAddress::SearchCallback
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
Definition: BreakpointResolverAddress.cpp:120
lldb_private::BreakpointResolver::getResolverID
unsigned getResolverID() const
getResolverID - Return an ID for the concrete type of this object.
Definition: BreakpointResolver.h:145