]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h
Restructure libz, place vendor files in contrib/zlib like other third
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Breakpoint / BreakpointResolverAddress.h
1 //===-- BreakpointResolverAddress.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_BreakpointResolverAddress_h_
11 #define liblldb_BreakpointResolverAddress_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Breakpoint/BreakpointResolver.h"
18 #include "lldb/Core/ModuleSpec.h"
19
20 namespace lldb_private {
21
22 //----------------------------------------------------------------------
23 /// @class BreakpointResolverAddress BreakpointResolverAddress.h "lldb/Breakpoint/BreakpointResolverAddress.h"
24 /// @brief This class sets breakpoints on a given Address.  This breakpoint only takes
25 /// once, and then it won't attempt to reset itself.
26 //----------------------------------------------------------------------
27
28 class BreakpointResolverAddress:
29     public BreakpointResolver
30 {
31 public:
32     BreakpointResolverAddress (Breakpoint *bkpt,
33                        const Address &addr);
34
35     BreakpointResolverAddress (Breakpoint *bkpt,
36                        const Address &addr,
37                        const FileSpec &module_spec);
38
39     ~BreakpointResolverAddress() override;
40
41     void
42     ResolveBreakpoint (SearchFilter &filter) override;
43
44     void
45     ResolveBreakpointInModules (SearchFilter &filter,
46                                 ModuleList &modules) override;
47
48     Searcher::CallbackReturn
49     SearchCallback (SearchFilter &filter,
50                     SymbolContext &context,
51                     Address *addr,
52                     bool containing) override;
53
54     Searcher::Depth
55     GetDepth () override;
56
57     void
58     GetDescription (Stream *s) override;
59
60     void
61     Dump (Stream *s) const override;
62
63     /// Methods for support type inquiry through isa, cast, and dyn_cast:
64     static inline bool classof(const BreakpointResolverAddress *) { return true; }
65     static inline bool classof(const BreakpointResolver *V) {
66         return V->getResolverID() == BreakpointResolver::AddressResolver;
67     }
68
69     lldb::BreakpointResolverSP
70     CopyForBreakpoint (Breakpoint &breakpoint) override;
71
72 protected:
73     Address      m_addr;     // The address - may be Section Offset or may be just an offset
74     lldb::addr_t m_resolved_addr; // The current value of the resolved load address for this breakpoint,
75     FileSpec     m_module_filespec; // If this filespec is Valid, and m_addr is an offset, then it will be converted
76                                     // to a Section+Offset address in this module, whenever that module gets around to
77                                     // being loaded.
78 private:
79     DISALLOW_COPY_AND_ASSIGN(BreakpointResolverAddress);
80 };
81
82 } // namespace lldb_private
83
84 #endif // liblldb_BreakpointResolverAddress_h_