Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:43

0001 //===-- BreakpointResolverName.h --------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_BREAKPOINT_BREAKPOINTRESOLVERNAME_H
0010 #define LLDB_BREAKPOINT_BREAKPOINTRESOLVERNAME_H
0011 
0012 #include <string>
0013 #include <vector>
0014 
0015 #include "lldb/Breakpoint/BreakpointResolver.h"
0016 #include "lldb/Core/Module.h"
0017 
0018 namespace lldb_private {
0019 
0020 /// \class BreakpointResolverName BreakpointResolverName.h
0021 /// "lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on
0022 /// a given function name, either by exact match or by regular expression.
0023 
0024 class BreakpointResolverName : public BreakpointResolver {
0025 public:
0026   BreakpointResolverName(const lldb::BreakpointSP &bkpt, const char *name,
0027                          lldb::FunctionNameType name_type_mask,
0028                          lldb::LanguageType language,
0029                          Breakpoint::MatchType type, lldb::addr_t offset,
0030                          bool skip_prologue);
0031 
0032   // This one takes an array of names.  It is always MatchType = Exact.
0033   BreakpointResolverName(const lldb::BreakpointSP &bkpt, const char *names[],
0034                          size_t num_names,
0035                          lldb::FunctionNameType name_type_mask,
0036                          lldb::LanguageType language, lldb::addr_t offset,
0037                          bool skip_prologue);
0038 
0039   // This one takes a C++ array of names.  It is always MatchType = Exact.
0040   BreakpointResolverName(const lldb::BreakpointSP &bkpt,
0041                          const std::vector<std::string> &names,
0042                          lldb::FunctionNameType name_type_mask,
0043                          lldb::LanguageType language, lldb::addr_t offset,
0044                          bool skip_prologue);
0045 
0046   // Creates a function breakpoint by regular expression.  Takes over control
0047   // of the lifespan of func_regex.
0048   BreakpointResolverName(const lldb::BreakpointSP &bkpt,
0049                          RegularExpression func_regex,
0050                          lldb::LanguageType language, lldb::addr_t offset,
0051                          bool skip_prologue);
0052 
0053   static lldb::BreakpointResolverSP
0054   CreateFromStructuredData(const StructuredData::Dictionary &data_dict,
0055                            Status &error);
0056 
0057   StructuredData::ObjectSP SerializeToStructuredData() override;
0058 
0059   ~BreakpointResolverName() override = default;
0060 
0061   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
0062                                           SymbolContext &context,
0063                                           Address *addr) override;
0064 
0065   lldb::SearchDepth GetDepth() override;
0066 
0067   void GetDescription(Stream *s) override;
0068 
0069   void Dump(Stream *s) const override;
0070 
0071   /// Methods for support type inquiry through isa, cast, and dyn_cast:
0072   static inline bool classof(const BreakpointResolverName *) { return true; }
0073   static inline bool classof(const BreakpointResolver *V) {
0074     return V->getResolverID() == BreakpointResolver::NameResolver;
0075   }
0076 
0077   lldb::BreakpointResolverSP
0078   CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
0079 
0080 protected:
0081   BreakpointResolverName(const BreakpointResolverName &rhs);
0082 
0083   std::vector<Module::LookupInfo> m_lookups;
0084   ConstString m_class_name;
0085   RegularExpression m_regex;
0086   Breakpoint::MatchType m_match_type;
0087   lldb::LanguageType m_language;
0088   bool m_skip_prologue;
0089 
0090   void AddNameLookup(ConstString name,
0091                      lldb::FunctionNameType name_type_mask);
0092 };
0093 
0094 } // namespace lldb_private
0095 
0096 #endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERNAME_H