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 LLDB_CORE_FILELINERESOLVER_H
10 #define LLDB_CORE_FILELINERESOLVER_H
11 
12 #include "lldb/Core/SearchFilter.h"
14 #include "lldb/Utility/FileSpec.h"
15 #include "lldb/lldb-defines.h"
16 
17 #include <cstdint>
18 
19 namespace lldb_private {
20 class Address;
21 class Stream;
22 
23 /// \class FileLineResolver FileLineResolver.h "lldb/Core/FileLineResolver.h"
24 /// This class finds address for source file and line. Optionally, it will
25 /// look for inlined instances of the file and line specification.
26 
27 class FileLineResolver : public Searcher {
28 public:
30  : m_file_spec(),
31  // Set this to zero for all lines in a file
32  m_sc_list() {}
33 
34  FileLineResolver(const FileSpec &resolver, uint32_t line_no,
35  bool check_inlines);
36 
37  ~FileLineResolver() override;
38 
40  SymbolContext &context,
41  Address *addr) override;
42 
43  lldb::SearchDepth GetDepth() override;
44 
45  void GetDescription(Stream *s) override;
46 
48 
49  void Clear();
50 
51  void Reset(const FileSpec &file_spec, uint32_t line, bool check_inlines);
52 
53 protected:
54  FileSpec m_file_spec; // This is the file spec we are looking for.
56  UINT32_MAX; // This is the line number that we are looking for.
58  bool m_inlines = true; // This determines whether the resolver looks for
59  // inlined functions or not.
60 
61 private:
62  FileLineResolver(const FileLineResolver &) = delete;
63  const FileLineResolver &operator=(const FileLineResolver &) = delete;
64 };
65 
66 } // namespace lldb_private
67 
68 #endif // LLDB_CORE_FILELINERESOLVER_H
lldb_private::FileLineResolver::SearchCallback
Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr) override
Definition: FileLineResolver.cpp:35
lldb_private::FileLineResolver::Clear
void Clear()
Definition: FileLineResolver.cpp:76
lldb::SearchDepth
SearchDepth
Definition: lldb-enumerations.h:283
lldb_private::FileLineResolver::Reset
void Reset(const FileSpec &file_spec, uint32_t line, bool check_inlines)
Definition: FileLineResolver.cpp:83
lldb_private::FileLineResolver::m_line_number
uint32_t m_line_number
Definition: FileLineResolver.h:55
lldb_private::FileLineResolver::m_sc_list
SymbolContextList m_sc_list
Definition: FileLineResolver.h:57
lldb-defines.h
lldb_private::SymbolContextList
Definition: SymbolContext.h:379
lldb_private::FileLineResolver::GetDepth
lldb::SearchDepth GetDepth() override
Definition: FileLineResolver.cpp:67
lldb_private::Stream
Definition: Stream.h:28
lldb_private::SymbolContext
Definition: SymbolContext.h:33
lldb_private::FileLineResolver
Definition: FileLineResolver.h:27
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::SearchFilter
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:83
SearchFilter.h
lldb_private::Searcher::CallbackReturn
CallbackReturn
Definition: SearchFilter.h:44
lldb_private::FileLineResolver::FileLineResolver
FileLineResolver()
Definition: FileLineResolver.h:29
lldb_private::FileLineResolver::operator=
const FileLineResolver & operator=(const FileLineResolver &)=delete
lldb_private::FileLineResolver::m_file_spec
FileSpec m_file_spec
Definition: FileLineResolver.h:54
lldb_private::FileLineResolver::m_inlines
bool m_inlines
Definition: FileLineResolver.h:58
uint32_t
lldb_private::Address
Definition: Address.h:59
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb_private::FileLineResolver::GetFileLineMatches
const SymbolContextList & GetFileLineMatches()
Definition: FileLineResolver.h:47
lldb_private::FileLineResolver::~FileLineResolver
~FileLineResolver() override
lldb_private::FileLineResolver::GetDescription
void GetDescription(Stream *s) override
Prints a canonical description for the searcher to the stream s.
Definition: FileLineResolver.cpp:71
SymbolContext.h
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
FileSpec.h
lldb_private::Searcher
General Outline: Provides the callback and search depth for the SearchFilter search.
Definition: SearchFilter.h:42