LLDB  mainline
BreakpointResolverName.h
Go to the documentation of this file.
1 //===-- BreakpointResolverName.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_BREAKPOINTRESOLVERNAME_H
10 #define LLDB_BREAKPOINT_BREAKPOINTRESOLVERNAME_H
11 
12 #include <string>
13 #include <vector>
14 
16 #include "lldb/Core/Module.h"
17 
18 namespace lldb_private {
19 
20 /// \class BreakpointResolverName BreakpointResolverName.h
21 /// "lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on
22 /// a given function name, either by exact match or by regular expression.
23 
25 public:
26  BreakpointResolverName(const lldb::BreakpointSP &bkpt, const char *name,
27  lldb::FunctionNameType name_type_mask,
28  lldb::LanguageType language,
30  bool skip_prologue);
31 
32  // This one takes an array of names. It is always MatchType = Exact.
33  BreakpointResolverName(const lldb::BreakpointSP &bkpt, const char *names[],
34  size_t num_names,
35  lldb::FunctionNameType name_type_mask,
36  lldb::LanguageType language, lldb::addr_t offset,
37  bool skip_prologue);
38 
39  // This one takes a C++ array of names. It is always MatchType = Exact.
40  BreakpointResolverName(const lldb::BreakpointSP &bkpt,
41  std::vector<std::string> names,
42  lldb::FunctionNameType name_type_mask,
43  lldb::LanguageType language, lldb::addr_t offset,
44  bool skip_prologue);
45 
46  // Creates a function breakpoint by regular expression. Takes over control
47  // of the lifespan of func_regex.
48  BreakpointResolverName(const lldb::BreakpointSP &bkpt,
49  RegularExpression func_regex,
50  lldb::LanguageType language, lldb::addr_t offset,
51  bool skip_prologue);
52 
53  static BreakpointResolver *
54  CreateFromStructuredData(const lldb::BreakpointSP &bkpt,
55  const StructuredData::Dictionary &data_dict,
56  Status &error);
57 
59 
60  ~BreakpointResolverName() override = default;
61 
63  SymbolContext &context,
64  Address *addr) override;
65 
66  lldb::SearchDepth GetDepth() override;
67 
68  void GetDescription(Stream *s) override;
69 
70  void Dump(Stream *s) const override;
71 
72  /// Methods for support type inquiry through isa, cast, and dyn_cast:
73  static inline bool classof(const BreakpointResolverName *) { return true; }
74  static inline bool classof(const BreakpointResolver *V) {
76  }
77 
78  lldb::BreakpointResolverSP
79  CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
80 
81 protected:
83 
84  std::vector<Module::LookupInfo> m_lookups;
90 
91  void AddNameLookup(ConstString name,
92  lldb::FunctionNameType name_type_mask);
93 };
94 
95 } // namespace lldb_private
96 
97 #endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERNAME_H
lldb_private::BreakpointResolverName::classof
static bool classof(const BreakpointResolverName *)
Methods for support type inquiry through isa, cast, and dyn_cast:
Definition: BreakpointResolverName.h:73
lldb_private::StructuredData::Dictionary
Definition: StructuredData.h:352
lldb_private::RegularExpression
Definition: RegularExpression.h:18
lldb::SearchDepth
SearchDepth
Definition: lldb-enumerations.h:283
lldb_private::BreakpointResolverName::SearchCallback
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
Definition: BreakpointResolverName.cpp:249
lldb_private::BreakpointResolverName::GetDepth
lldb::SearchDepth GetDepth() override
Definition: BreakpointResolverName.cpp:399
lldb_private::BreakpointResolverName::m_match_type
Breakpoint::MatchType m_match_type
Definition: BreakpointResolverName.h:87
lldb_private::BreakpointResolverName::m_language
lldb::LanguageType m_language
Definition: BreakpointResolverName.h:88
Module.h
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
BreakpointResolver.h
lldb_private::Stream
Definition: Stream.h:28
lldb_private::BreakpointResolverName::SerializeToStructuredData
StructuredData::ObjectSP SerializeToStructuredData() override
Definition: BreakpointResolverName.cpp:187
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::BreakpointResolverName::GetDescription
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
Definition: BreakpointResolverName.cpp:403
lldb_private::BreakpointResolverName::AddNameLookup
void AddNameLookup(ConstString name, lldb::FunctionNameType name_type_mask)
Definition: BreakpointResolverName.cpp:216
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb_private::SearchFilter
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:83
lldb_private::BreakpointResolver::NameResolver
@ NameResolver
Definition: BreakpointResolver.h:130
lldb_private::Breakpoint::MatchType
MatchType
An enum specifying the match style for breakpoint settings.
Definition: Breakpoint.h:86
lldb_private::BreakpointResolverName::m_class_name
ConstString m_class_name
Definition: BreakpointResolverName.h:85
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::Searcher::CallbackReturn
CallbackReturn
Definition: SearchFilter.h:44
lldb_private::BreakpointResolverName::m_lookups
std::vector< Module::LookupInfo > m_lookups
Definition: BreakpointResolverName.h:84
lldb_private::BreakpointResolverName::BreakpointResolverName
BreakpointResolverName(const lldb::BreakpointSP &bkpt, const char *name, lldb::FunctionNameType name_type_mask, lldb::LanguageType language, Breakpoint::MatchType type, lldb::addr_t offset, bool skip_prologue)
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::BreakpointResolverName
Definition: BreakpointResolverName.h:24
lldb_private::BreakpointResolverName::classof
static bool classof(const BreakpointResolver *V)
Definition: BreakpointResolverName.h:74
lldb_private::BreakpointResolverName::~BreakpointResolverName
~BreakpointResolverName() override=default
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb_private::BreakpointResolverName::m_regex
RegularExpression m_regex
Definition: BreakpointResolverName.h:86
lldb_private::BreakpointResolverName::CreateFromStructuredData
static BreakpointResolver * CreateFromStructuredData(const lldb::BreakpointSP &bkpt, const StructuredData::Dictionary &data_dict, Status &error)
Definition: BreakpointResolverName.cpp:91
lldb_private::BreakpointResolverName::Dump
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
Definition: BreakpointResolverName.cpp:424
lldb_private::BreakpointResolverName::CopyForBreakpoint
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
Definition: BreakpointResolverName.cpp:427
lldb_private::BreakpointResolverName::m_skip_prologue
bool m_skip_prologue
Definition: BreakpointResolverName.h:89
lldb_private::BreakpointResolver::getResolverID
unsigned getResolverID() const
getResolverID - Return an ID for the concrete type of this object.
Definition: BreakpointResolver.h:145