Back to home page

EIC code displayed by LXR

 
 

    


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

0001 //===-- BreakpointResolverFileLine.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_BREAKPOINTRESOLVERFILELINE_H
0010 #define LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILELINE_H
0011 
0012 #include "lldb/Breakpoint/BreakpointResolver.h"
0013 #include "lldb/Core/SourceLocationSpec.h"
0014 #include <optional>
0015 
0016 namespace lldb_private {
0017 
0018 /// \class BreakpointResolverFileLine BreakpointResolverFileLine.h
0019 /// "lldb/Breakpoint/BreakpointResolverFileLine.h" This class sets breakpoints
0020 /// by file and line.  Optionally, it will look for inlined instances of the
0021 /// file and line specification.
0022 
0023 class BreakpointResolverFileLine : public BreakpointResolver {
0024 public:
0025   BreakpointResolverFileLine(
0026       const lldb::BreakpointSP &bkpt, lldb::addr_t offset, bool skip_prologue,
0027       const SourceLocationSpec &location_spec,
0028       std::optional<llvm::StringRef> removed_prefix_opt = std::nullopt);
0029 
0030   static lldb::BreakpointResolverSP
0031   CreateFromStructuredData(const StructuredData::Dictionary &data_dict,
0032                            Status &error);
0033 
0034   StructuredData::ObjectSP SerializeToStructuredData() override;
0035 
0036   ~BreakpointResolverFileLine() override = default;
0037 
0038   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
0039                                           SymbolContext &context,
0040                                           Address *addr) override;
0041 
0042   lldb::SearchDepth GetDepth() override;
0043 
0044   void GetDescription(Stream *s) override;
0045 
0046   void Dump(Stream *s) const override;
0047 
0048   /// Methods for support type inquiry through isa, cast, and dyn_cast:
0049   static inline bool classof(const BreakpointResolverFileLine *) {
0050     return true;
0051   }
0052   static inline bool classof(const BreakpointResolver *V) {
0053     return V->getResolverID() == BreakpointResolver::FileLineResolver;
0054   }
0055 
0056   lldb::BreakpointResolverSP
0057   CopyForBreakpoint(lldb::BreakpointSP &breakpoint) override;
0058 
0059 protected:
0060   void FilterContexts(SymbolContextList &sc_list);
0061   void DeduceSourceMapping(const SymbolContextList &sc_list);
0062 
0063   friend class Breakpoint;
0064   SourceLocationSpec m_location_spec;
0065   bool m_skip_prologue;
0066   // Any previously removed file path prefix by reverse source mapping.
0067   // This is used to auto deduce source map if needed.
0068   std::optional<llvm::StringRef> m_removed_prefix_opt;
0069 
0070 private:
0071   BreakpointResolverFileLine(const BreakpointResolverFileLine &) = delete;
0072   const BreakpointResolverFileLine &
0073   operator=(const BreakpointResolverFileLine &) = delete;
0074 };
0075 
0076 } // namespace lldb_private
0077 
0078 #endif // LLDB_BREAKPOINT_BREAKPOINTRESOLVERFILELINE_H