1 //===-- FileLineResolver.h --------------------------------------*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef liblldb_FileLineResolver_h_
10 #define liblldb_FileLineResolver_h_
12 #include "lldb/Core/SearchFilter.h"
13 #include "lldb/Symbol/SymbolContext.h"
14 #include "lldb/Utility/FileSpec.h"
15 #include "lldb/lldb-defines.h"
19 namespace lldb_private {
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.
27 class FileLineResolver : public Searcher {
31 m_line_number(UINT32_MAX), // Set this to zero for all lines in a file
32 m_sc_list(), m_inlines(true) {}
34 FileLineResolver(const FileSpec &resolver, uint32_t line_no,
37 ~FileLineResolver() override;
39 Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
40 SymbolContext &context, Address *addr,
41 bool containing) override;
43 lldb::SearchDepth GetDepth() override;
45 void GetDescription(Stream *s) override;
47 const SymbolContextList &GetFileLineMatches() { return m_sc_list; }
51 void Reset(const FileSpec &file_spec, uint32_t line, bool check_inlines);
54 FileSpec m_file_spec; // This is the file spec we are looking for.
55 uint32_t m_line_number; // This is the line number that we are looking for.
56 SymbolContextList m_sc_list;
57 bool m_inlines; // This determines whether the resolver looks for inlined
61 DISALLOW_COPY_AND_ASSIGN(FileLineResolver);
64 } // namespace lldb_private
66 #endif // liblldb_FileLineResolver_h_