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
18namespace 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
25public:
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.
41 const 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.
49 RegularExpression func_regex,
50 lldb::LanguageType language, lldb::addr_t offset,
51 bool skip_prologue);
52
55 Status &error);
56
58
59 ~BreakpointResolverName() override = default;
60
62 SymbolContext &context,
63 Address *addr) override;
64
65 lldb::SearchDepth GetDepth() override;
66
67 void GetDescription(Stream *s) override;
68
69 void Dump(Stream *s) const override;
70
71 /// Methods for support type inquiry through isa, cast, and dyn_cast:
72 static inline bool classof(const BreakpointResolverName *) { return true; }
73 static inline bool classof(const BreakpointResolver *V) {
75 }
76
78 CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
79
80protected:
82
83 std::vector<Module::LookupInfo> m_lookups;
89
90 void AddNameLookup(ConstString name,
91 lldb::FunctionNameType name_type_mask);
92};
93
94} // namespace lldb_private
95
96#endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERNAME_H
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address class.
Definition: Address.h:62
"lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on a given function name,...
void AddNameLookup(ConstString name, lldb::FunctionNameType name_type_mask)
std::vector< Module::LookupInfo > m_lookups
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
~BreakpointResolverName() override=default
static bool classof(const BreakpointResolverName *)
Methods for support type inquiry through isa, cast, and dyn_cast:
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
BreakpointResolverName(const lldb::BreakpointSP &bkpt, const char *names[], size_t num_names, lldb::FunctionNameType name_type_mask, lldb::LanguageType language, lldb::addr_t offset, bool skip_prologue)
StructuredData::ObjectSP SerializeToStructuredData() override
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)
static bool classof(const BreakpointResolver *V)
static lldb::BreakpointResolverSP CreateFromStructuredData(const StructuredData::Dictionary &data_dict, Status &error)
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
BreakpointResolverName(const lldb::BreakpointSP &bkpt, const std::vector< std::string > &names, lldb::FunctionNameType name_type_mask, lldb::LanguageType language, lldb::addr_t offset, bool skip_prologue)
General Outline: The BreakpointResolver is a Searcher.
unsigned getResolverID() const
getResolverID - Return an ID for the concrete type of this object.
MatchType
An enum specifying the match style for breakpoint settings.
Definition: Breakpoint.h:88
A uniqued constant string class.
Definition: ConstString.h:40
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:34
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::BreakpointResolver > BreakpointResolverSP
Definition: lldb-forward.h:326
LanguageType
Programming language type.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
Definition: lldb-forward.h:319
uint64_t addr_t
Definition: lldb-types.h:80