1 //===-- BreakpointResolverFileLine.h ----------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_BreakpointResolverFileLine_h_
10 #define liblldb_BreakpointResolverFileLine_h_
12 #include "lldb/Breakpoint/BreakpointResolver.h"
14 namespace lldb_private {
16 /// \class BreakpointResolverFileLine BreakpointResolverFileLine.h
17 /// "lldb/Breakpoint/BreakpointResolverFileLine.h" This class sets breakpoints
18 /// by file and line. Optionally, it will look for inlined instances of the
19 /// file and line specification.
21 class BreakpointResolverFileLine : public BreakpointResolver {
23 BreakpointResolverFileLine(Breakpoint *bkpt, const FileSpec &resolver,
24 uint32_t line_no, uint32_t column,
25 lldb::addr_t m_offset, bool check_inlines,
26 bool skip_prologue, bool exact_match);
28 static BreakpointResolver *
29 CreateFromStructuredData(Breakpoint *bkpt,
30 const StructuredData::Dictionary &data_dict,
33 StructuredData::ObjectSP SerializeToStructuredData() override;
35 ~BreakpointResolverFileLine() override;
37 Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
38 SymbolContext &context,
39 Address *addr) override;
41 lldb::SearchDepth GetDepth() override;
43 void GetDescription(Stream *s) override;
45 void Dump(Stream *s) const override;
47 /// Methods for support type inquiry through isa, cast, and dyn_cast:
48 static inline bool classof(const BreakpointResolverFileLine *) {
51 static inline bool classof(const BreakpointResolver *V) {
52 return V->getResolverID() == BreakpointResolver::FileLineResolver;
55 lldb::BreakpointResolverSP CopyForBreakpoint(Breakpoint &breakpoint) override;
58 void FilterContexts(SymbolContextList &sc_list, bool is_relative);
60 friend class Breakpoint;
61 FileSpec m_file_spec; ///< This is the file spec we are looking for.
62 uint32_t m_line_number; ///< This is the line number that we are looking for.
63 uint32_t m_column; ///< This is the column that we are looking for.
64 bool m_inlines; ///< This determines whether the resolver looks for inlined
65 ///< functions or not.
70 DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileLine);
73 } // namespace lldb_private
75 #endif // liblldb_BreakpointResolverFileLine_h_