]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Core/FileLineResolver.h
Update our copy of DTS from the ones from Linux 4.14
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Core / FileLineResolver.h
1 //===-- FileLineResolver.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_FileLineResolver_h_
11 #define liblldb_FileLineResolver_h_
12
13 #include "lldb/Core/SearchFilter.h" // for Searcher, Searcher::CallbackR...
14 #include "lldb/Symbol/SymbolContext.h"
15 #include "lldb/Utility/FileSpec.h" // for FileSpec
16 #include "lldb/lldb-defines.h"     // for DISALLOW_COPY_AND_ASSIGN
17
18 #include <stdint.h> // for uint32_t, UINT32_MAX
19
20 namespace lldb_private {
21 class Address;
22 }
23 namespace lldb_private {
24 class Stream;
25 }
26
27 namespace lldb_private {
28
29 //----------------------------------------------------------------------
30 /// @class FileLineResolver FileLineResolver.h "lldb/Core/FileLineResolver.h"
31 /// @brief This class finds address for source file and line.  Optionally, it
32 /// will look for inlined
33 /// instances of the file and line specification.
34 //----------------------------------------------------------------------
35
36 class FileLineResolver : public Searcher {
37 public:
38   FileLineResolver()
39       : m_file_spec(),
40         m_line_number(UINT32_MAX), // Set this to zero for all lines in a file
41         m_sc_list(), m_inlines(true) {}
42
43   FileLineResolver(const FileSpec &resolver, uint32_t line_no,
44                    bool check_inlines);
45
46   ~FileLineResolver() override;
47
48   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
49                                           SymbolContext &context, Address *addr,
50                                           bool containing) override;
51
52   Searcher::Depth GetDepth() override;
53
54   void GetDescription(Stream *s) override;
55
56   const SymbolContextList &GetFileLineMatches() { return m_sc_list; }
57
58   void Clear();
59
60   void Reset(const FileSpec &file_spec, uint32_t line, bool check_inlines);
61
62 protected:
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   SymbolContextList m_sc_list;
66   bool m_inlines; // This determines whether the resolver looks for inlined
67                   // functions or not.
68
69 private:
70   DISALLOW_COPY_AND_ASSIGN(FileLineResolver);
71 };
72
73 } // namespace lldb_private
74
75 #endif // liblldb_FileLineResolver_h_