Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:45

0001 //===-- FileLineResolver.h --------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef LLDB_CORE_FILELINERESOLVER_H
0010 #define LLDB_CORE_FILELINERESOLVER_H
0011 
0012 #include "lldb/Core/SearchFilter.h"
0013 #include "lldb/Symbol/SymbolContext.h"
0014 #include "lldb/Utility/FileSpec.h"
0015 #include "lldb/lldb-defines.h"
0016 
0017 #include <cstdint>
0018 
0019 namespace lldb_private {
0020 class Address;
0021 class Stream;
0022 
0023 /// \class FileLineResolver FileLineResolver.h "lldb/Core/FileLineResolver.h"
0024 /// This class finds address for source file and line.  Optionally, it will
0025 /// look for inlined instances of the file and line specification.
0026 
0027 class FileLineResolver : public Searcher {
0028 public:
0029   FileLineResolver()
0030       : m_file_spec(),
0031         // Set this to zero for all lines in a file
0032         m_sc_list() {}
0033 
0034   FileLineResolver(const FileSpec &resolver, uint32_t line_no,
0035                    bool check_inlines);
0036 
0037   ~FileLineResolver() override;
0038 
0039   Searcher::CallbackReturn SearchCallback(SearchFilter &filter,
0040                                           SymbolContext &context,
0041                                           Address *addr) override;
0042 
0043   lldb::SearchDepth GetDepth() override;
0044 
0045   void GetDescription(Stream *s) override;
0046 
0047   const SymbolContextList &GetFileLineMatches() { return m_sc_list; }
0048 
0049   void Clear();
0050 
0051   void Reset(const FileSpec &file_spec, uint32_t line, bool check_inlines);
0052 
0053 protected:
0054   FileSpec m_file_spec;   // This is the file spec we are looking for.
0055   uint32_t m_line_number =
0056       UINT32_MAX; // This is the line number that we are looking for.
0057   SymbolContextList m_sc_list;
0058   bool m_inlines = true; // This determines whether the resolver looks for
0059                          // inlined functions or not.
0060 
0061 private:
0062   FileLineResolver(const FileLineResolver &) = delete;
0063   const FileLineResolver &operator=(const FileLineResolver &) = delete;
0064 };
0065 
0066 } // namespace lldb_private
0067 
0068 #endif // LLDB_CORE_FILELINERESOLVER_H