Go to the documentation of this file.
27 BreakpointResolverName::BreakpointResolverName(
const BreakpointSP &bkpt,
28 const char *name_cstr, FunctionNameType name_type_mask,
32 m_match_type(type), m_language(language), m_skip_prologue(skip_prologue) {
39 log->
Warning(
"function name regexp: \"%s\" did not compile.",
43 AddNameLookup(
ConstString(name_cstr), name_type_mask);
48 const BreakpointSP &bkpt,
const char *names[],
size_t num_names,
52 m_match_type(
Breakpoint::Exact), m_language(language),
53 m_skip_prologue(skip_prologue) {
54 for (
size_t i = 0; i < num_names; i++) {
55 AddNameLookup(
ConstString(names[i]), name_type_mask);
60 std::vector<std::string> names,
61 FunctionNameType name_type_mask,
66 m_match_type(
Breakpoint::Exact), m_language(language),
67 m_skip_prologue(skip_prologue) {
69 AddNameLookup(
ConstString(name.c_str(), name.size()), name_type_mask);
79 m_class_name(nullptr), m_regex(std::move(func_regex)),
80 m_match_type(
Breakpoint::Regexp), m_language(language),
81 m_skip_prologue(skip_prologue) {}
87 m_lookups(rhs.m_lookups), m_class_name(rhs.m_class_name),
88 m_regex(rhs.m_regex), m_match_type(rhs.m_match_type),
89 m_language(rhs.m_language), m_skip_prologue(rhs.m_skip_prologue) {}
95 llvm::StringRef language_name;
101 error.SetErrorStringWithFormatv(
"BRN::CFSD: Unknown language: {0}.",
111 error.SetErrorString(
"BRN::CFSD: Missing offset entry.");
119 error.SetErrorString(
"BRN::CFSD: Missing Skip prologue entry.");
123 llvm::StringRef regex_text;
128 language, offset, skip_prologue);
134 error.SetErrorString(
"BRN::CFSD: Missing symbol names entry.");
141 error.SetErrorString(
"BRN::CFSD: Missing symbol names mask entry.");
145 size_t num_elem = names_array->
GetSize();
146 if (num_elem != names_mask_array->
GetSize()) {
147 error.SetErrorString(
148 "BRN::CFSD: names and names mask arrays have different sizes.");
153 error.SetErrorString(
154 "BRN::CFSD: no name entry in a breakpoint by name breakpoint.");
157 std::vector<std::string> names;
158 std::vector<FunctionNameType> name_masks;
159 for (
size_t i = 0; i < num_elem; i++) {
160 llvm::StringRef name;
164 error.SetErrorString(
"BRN::CFSD: name entry is not a string.");
167 std::underlying_type<FunctionNameType>::type fnt;
170 error.SetErrorString(
"BRN::CFSD: name mask entry is not an integer.");
174 name_masks.push_back(
static_cast<FunctionNameType
>(fnt));
178 bkpt, names[0].c_str(), name_masks[0], language,
179 Breakpoint::MatchType::Exact, offset, skip_prologue);
180 for (
size_t i = 1; i < num_elem; i++) {
207 options_dict_sp->AddStringItem(
217 FunctionNameType name_type_mask) {
222 auto add_variant_funcs = [&](
Language *lang) {
224 lang->GetMethodNameVariants(name)) {
226 if (variant.GetType() & lldb::eFunctionNameTypeFull) {
228 lang->GetLanguageType());
237 add_variant_funcs(lang);
259 log->
Warning(
"Class/method function specification not supported yet.\n");
276 const size_t start_func_idx = func_list.
GetSize();
279 lookup.GetNameTypeMask(), function_options, func_list);
281 const size_t end_func_idx = func_list.
GetSize();
283 if (start_func_idx < end_func_idx)
284 lookup.Prune(func_list, start_func_idx);
295 log->
Warning(
"glob is not supported yet.");
301 if (filter_by_cu || filter_by_language) {
304 for (
size_t idx = 0; idx < num_functions; idx++) {
305 bool remove_it =
false;
313 if (filter_by_language) {
343 bool is_reexported =
false;
352 if (prologue_byte_size)
357 const Symbol *actual_symbol =
360 is_reexported =
true;
369 if (prologue_byte_size)
387 BreakpointLocationSP bp_loc_sp(
AddLocation(break_addr, &new_location));
388 bp_loc_sp->SetIsReExported(is_reexported);
389 if (bp_loc_sp && new_location && !breakpoint.
IsInternal()) {
414 for (
size_t i = 0; i < num_names; i++) {
415 s->
Printf(
"%s'%s'", (i == 0 ?
"" :
", "),
428 lldb::BreakpointResolverSP
431 ret_sp->SetBreakpoint(breakpoint);
Address & GetBaseAddress()
Get accessor for the base address of the range.
Block * block
The Block for a given query.
CompileUnit * comp_unit
The CompileUnit for a given query.
bool IsValid() const
Check if the object state is valid.
void Clear()
Clear the object's state.
virtual bool AddressPasses(Address &addr)
Call this method with a Address to see if address passes the filter.
uint32_t GetPrologueByteSize()
const AddressRange & GetAddressRange()
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
lldb::SearchDepth GetDepth() override
Breakpoint::MatchType m_match_type
virtual uint32_t GetFilterRequiredItems()
This determines which items are REQUIRED for the filter to pass.
#define LLDB_LOGF(log,...)
lldb::LanguageType m_language
LanguageType
Programming language type.
void void void void Warning(const char *fmt,...) __attribute__((format(printf
bool GetContextAtIndex(size_t idx, SymbolContext &sc) const
Get accessor for a symbol context at index idx.
StructuredData::ObjectSP SerializeToStructuredData() override
bool include_symbols
Include the symbol table.
void GetDescription(Stream *s) override
Prints a canonical description for the breakpoint to the stream s.
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
bool include_inlines
Include inlined functions.
void AddNameLookup(ConstString name, lldb::FunctionNameType name_type_mask)
static llvm::raw_ostream & error(Stream &strm)
Symbol * symbol
The Symbol for a given query.
std::shared_ptr< String > StringSP
General Outline: Provides the callback and search depth for the SearchFilter search.
bool IsInternal() const
Tell whether this breakpoint is an "internal" breakpoint.
MatchType
An enum specifying the match style for breakpoint settings.
virtual void AdjustBreakpointAddress(const Symbol &func, Address &addr) const
Adjust function breakpoint address, if needed.
std::shared_ptr< Object > ObjectSP
const char * GetData() const
static llvm::StringRef GetName(XcodeSDK::Type type)
Function * function
The Function for a given query.
uint32_t GetSize() const
Get accessor for a symbol context list size.
bool IsValid() const
Test if this object contains a valid regular expression.
void SetLookupName(ConstString name)
std::shared_ptr< Dictionary > DictionarySP
std::vector< Module::LookupInfo > m_lookups
string(SUBSTRING ${p} 10 -1 pStripped) if($
lldb::BreakpointLocationSP AddLocation(Address loc_addr, bool *new_location=nullptr)
Represents a generic declaration context in a program.
static Language * FindPlugin(lldb::LanguageType language)
Options used by Module::FindFunctions.
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)
General Outline: The BreakpointResolver is a Searcher.
StructuredData::DictionarySP WrapOptionsDict(StructuredData::DictionarySP options_dict_sp)
static lldb::LanguageType GetLanguageTypeFromString(const char *string)=delete
Architecture * GetArchitecturePlugin() const
@ eLanguageTypeUnknown
Unknown or invalid language value.
static const char * GetKey(OptionNames enum_value)
uint32_t GetPrologueByteSize()
Get the size of the prologue instructions for this function.
bool GetItemAtIndexAsInteger(size_t idx, IntType &result) const
lldb::ModuleSP module_sp
The Module for a given query.
virtual bool CompUnitPasses(FileSpec &fileSpec)
Call this method with a FileSpec to see if file spec passes the filter as the name of a compilation u...
bool SetOffset(lldb::addr_t offset)
Set accessor for the offset.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
A class that represents a running process on the host machine.
@ eDescriptionLevelVerbose
lldb::LanguageType GetLanguage() const
RegularExpression m_regex
static BreakpointResolver * CreateFromStructuredData(const lldb::BreakpointSP &bkpt, const StructuredData::Dictionary &data_dict, Status &error)
void Dump(Stream *s) const override
Standard "Dump" method. At present it does nothing.
Target & GetTarget()
Accessor for the breakpoint Target.
lldb::addr_t GetOffset() const
Get the section relative offset value.
bool GetStartAddress(Address &addr)
lldb::BreakpointResolverSP CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override
bool GetItemAtIndexAsString(size_t idx, llvm::StringRef &result) const
std::shared_ptr< Array > ArraySP
const InlineFunctionInfo * GetInlinedFunctionInfo() const
Get const accessor for any inlined function information.
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
bool GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const
RegularExpression m_regex
static void ForEach(std::function< bool(Language *)> callback)
llvm::StringRef GetText() const
Access the regular expression text.
static const char * GetNameForLanguageType(lldb::LanguageType language)
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
bool GetValueForKeyAsBoolean(llvm::StringRef key, bool &result) const
lldb::SymbolType GetType() const
std::shared_ptr< Integer > IntegerSP
lldb::BreakpointSP GetBreakpoint() const
This gets the breakpoint for this resolver.
Symbol * ResolveReExportedSymbol(Target &target) const
General Outline: A breakpoint has four main parts, a filter, a resolver, the list of breakpoint locat...
bool RemoveContextAtIndex(size_t idx)
@ eCallbackReturnContinue
Address GetAddress() const
static lldb::LanguageType GetPrimaryLanguage(lldb::LanguageType language)