Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- BreakpointResolverScripted.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_BREAKPOINTRESOLVERSCRIPTED_H
0010 #define LLDB_BREAKPOINT_BREAKPOINTRESOLVERSCRIPTED_H
0011 
0012 #include "lldb/Breakpoint/BreakpointResolver.h"
0013 #include "lldb/Core/ModuleSpec.h"
0014 #include "lldb/Core/StructuredDataImpl.h"
0015 #include "lldb/lldb-forward.h"
0016 
0017 namespace lldb_private {
0018 
0019 /// \class BreakpointResolverScripted BreakpointResolverScripted.h
0020 /// "lldb/Breakpoint/BreakpointResolverScripted.h" This class sets breakpoints
0021 /// on a given Address.  This breakpoint only takes once, and then it won't
0022 /// attempt to reset itself.
0023 
0024 class BreakpointResolverScripted : public BreakpointResolver {
0025 public:
0026   BreakpointResolverScripted(const lldb::BreakpointSP &bkpt,
0027                              const llvm::StringRef class_name,
0028                              lldb::SearchDepth depth,
0029                              const StructuredDataImpl &args_data);
0030 
0031   ~BreakpointResolverScripted() override = default;
0032 
0033   static lldb::BreakpointResolverSP
0034   CreateFromStructuredData(const StructuredData::Dictionary &options_dict,
0035                            Status &error);
0036 
0037   StructuredData::ObjectSP SerializeToStructuredData() override;
0038 
0039   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
0040                                           SymbolContext &context,
0041                                           Address *addr) override;
0042 
0043   lldb::SearchDepth GetDepth() override;
0044 
0045   void GetDescription(Stream *s) override;
0046 
0047   void Dump(Stream *s) const override;
0048 
0049   /// Methods for support type inquiry through isa, cast, and dyn_cast:
0050   static inline bool classof(const BreakpointResolverScripted *) { return true; }
0051   static inline bool classof(const BreakpointResolver *V) {
0052     return V->getResolverID() == BreakpointResolver::PythonResolver;
0053   }
0054 
0055   lldb::BreakpointResolverSP
0056   CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
0057 
0058 protected:
0059   void NotifyBreakpointSet() override;
0060 private:
0061   void CreateImplementationIfNeeded(lldb::BreakpointSP bkpt);
0062   ScriptInterpreter *GetScriptInterpreter();
0063   
0064   std::string m_class_name;
0065   lldb::SearchDepth m_depth;
0066   StructuredDataImpl m_args;
0067   StructuredData::GenericSP m_implementation_sp;
0068 
0069   BreakpointResolverScripted(const BreakpointResolverScripted &) = delete;
0070   const BreakpointResolverScripted &
0071   operator=(const BreakpointResolverScripted &) = delete;
0072 };
0073 
0074 } // namespace lldb_private
0075 
0076 #endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERSCRIPTED_H