LLDB  mainline
FileLineResolver.h
Go to the documentation of this file.
1 //===-- FileLineResolver.h --------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef liblldb_FileLineResolver_h_
10 #define liblldb_FileLineResolver_h_
11 
12 #include "lldb/Core/SearchFilter.h"
14 #include "lldb/Utility/FileSpec.h"
15 #include "lldb/lldb-defines.h"
16 
17 #include <stdint.h>
18 
19 namespace lldb_private {
20 class Address;
21 }
22 namespace lldb_private {
23 class Stream;
24 }
25 
26 namespace lldb_private {
27 
28 /// \class FileLineResolver FileLineResolver.h "lldb/Core/FileLineResolver.h"
29 /// This class finds address for source file and line. Optionally, it will
30 /// look for inlined instances of the file and line specification.
31 
32 class FileLineResolver : public Searcher {
33 public:
35  : m_file_spec(),
36  m_line_number(UINT32_MAX), // Set this to zero for all lines in a file
37  m_sc_list(), m_inlines(true) {}
38 
39  FileLineResolver(const FileSpec &resolver, uint32_t line_no,
40  bool check_inlines);
41 
42  ~FileLineResolver() override;
43 
45  SymbolContext &context, Address *addr,
46  bool containing) override;
47 
48  lldb::SearchDepth GetDepth() override;
49 
50  void GetDescription(Stream *s) override;
51 
53 
54  void Clear();
55 
56  void Reset(const FileSpec &file_spec, uint32_t line, bool check_inlines);
57 
58 protected:
59  FileSpec m_file_spec; // This is the file spec we are looking for.
60  uint32_t m_line_number; // This is the line number that we are looking for.
62  bool m_inlines; // This determines whether the resolver looks for inlined
63  // functions or not.
64 
65 private:
66  DISALLOW_COPY_AND_ASSIGN(FileLineResolver);
67 };
68 
69 } // namespace lldb_private
70 
71 #endif // liblldb_FileLineResolver_h_
Defines a list of symbol context objects.
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
void GetDescription(Stream *s) override
Prints a canonical description for the searcher to the stream s.
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:33
A file utility class.
Definition: FileSpec.h:55
lldb::SearchDepth GetDepth() override
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr, bool containing) override
#define UINT32_MAX
Definition: lldb-defines.h:31
const SymbolContextList & GetFileLineMatches()
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:101
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:60
A section + offset based address class.
Definition: Address.h:80
void Reset(const FileSpec &file_spec, uint32_t line, bool check_inlines)
This class finds address for source file and line.