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:
77 };
78 
79 } // namespace lldb_private
80 
81 #endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERADDRESS_H
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
Definition: Address.h:59
"lldb/Breakpoint/BreakpointResolverAddress.h" This class sets breakpoints on a given Address.
StructuredData::ObjectSP SerializeToStructuredData() override
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
const BreakpointResolverAddress & operator=(const BreakpointResolverAddress &)=delete
BreakpointResolverAddress(const lldb::BreakpointSP &bkpt, const Address &addr, const FileSpec &module_spec)
~BreakpointResolverAddress() override=default
BreakpointResolverAddress(const BreakpointResolverAddress &)=delete
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
BreakpointResolverAddress(const lldb::BreakpointSP &bkpt, const Address &addr)
static bool classof(const BreakpointResolverAddress *)
Methods for support type inquiry through isa, cast, and dyn_cast:
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
void ResolveBreakpointInModules(SearchFilter &filter, ModuleList &modules) override
In response to this method the resolver scans the modules in the module list modules,...
void ResolveBreakpoint(SearchFilter &filter) override
In response to this method the resolver scans all the modules in the breakpoint's target,...
static bool classof(const BreakpointResolver *V)
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
static BreakpointResolver * CreateFromStructuredData(const lldb::BreakpointSP &bkpt, const StructuredData::Dictionary &options_dict, Status &error)
General Outline: The BreakpointResolver is a Searcher.
unsigned getResolverID() const
getResolverID - Return an ID for the concrete type of this object.
A file utility class.
Definition: FileSpec.h:56
A collection class for Module objects.
Definition: ModuleList.h:71
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:83
An error handling class.
Definition: Status.h:44
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
std::shared_ptr< Object > ObjectSP
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
A class that represents a running process on the host machine.
uint64_t addr_t
Definition: lldb-types.h:83