1 //===-- BreakpointResolverFileLine.h ----------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_BreakpointResolverFileLine_h_
11 #define liblldb_BreakpointResolverFileLine_h_
12 
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Breakpoint/BreakpointResolver.h"
18 
19 namespace lldb_private {
20 
21 //----------------------------------------------------------------------
22 /// @class BreakpointResolverFileLine BreakpointResolverFileLine.h "lldb/Breakpoint/BreakpointResolverFileLine.h"
23 /// @brief This class sets breakpoints by file and line.  Optionally, it will look for inlined
24 /// instances of the file and line specification.
25 //----------------------------------------------------------------------
26 
27 class BreakpointResolverFileLine :
28     public BreakpointResolver
29 {
30 public:
31     BreakpointResolverFileLine (Breakpoint *bkpt,
32                                 const FileSpec &resolver,
33                                 uint32_t line_no,
34                                 bool check_inlines,
35                                 bool skip_prologue);
36 
37     virtual
38     ~BreakpointResolverFileLine ();
39 
40     virtual Searcher::CallbackReturn
41     SearchCallback (SearchFilter &filter,
42                     SymbolContext &context,
43                     Address *addr,
44                     bool containing);
45 
46     virtual Searcher::Depth
47     GetDepth ();
48 
49     virtual void
50     GetDescription (Stream *s);
51 
52     virtual void
53     Dump (Stream *s) const;
54 
55     /// Methods for support type inquiry through isa, cast, and dyn_cast:
classof(const BreakpointResolverFileLine *)56     static inline bool classof(const BreakpointResolverFileLine *) { return true; }
classof(const BreakpointResolver * V)57     static inline bool classof(const BreakpointResolver *V) {
58         return V->getResolverID() == BreakpointResolver::FileLineResolver;
59     }
60 
61 protected:
62     friend class Breakpoint;
63     FileSpec m_file_spec; // This is the file spec we are looking for.
64     uint32_t m_line_number; // This is the line number that we are looking for.
65     bool m_inlines; // This determines whether the resolver looks for inlined functions or not.
66     bool m_skip_prologue;
67 
68 private:
69     DISALLOW_COPY_AND_ASSIGN(BreakpointResolverFileLine);
70 };
71 
72 } // namespace lldb_private
73 
74 #endif  // liblldb_BreakpointResolverFileLine_h_
75