File indexing completed on 2026-05-10 08:42:58
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_UTILITY_REALPATHPREFIXES_H
0010 #define LLDB_UTILITY_REALPATHPREFIXES_H
0011
0012 #include "lldb/lldb-forward.h"
0013 #include "llvm/ADT/IntrusiveRefCntPtr.h"
0014 #include "llvm/Support/VirtualFileSystem.h"
0015
0016 #include <optional>
0017 #include <string>
0018 #include <vector>
0019
0020 namespace lldb_private {
0021
0022 class RealpathPrefixes {
0023 public:
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 explicit RealpathPrefixes(const FileSpecList &file_spec_list,
0034 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> fs =
0035 llvm::vfs::getRealFileSystem());
0036
0037 std::optional<FileSpec> ResolveSymlinks(const FileSpec &file_spec);
0038
0039
0040
0041
0042 void IncreaseSourceRealpathAttemptCount() {
0043 ++m_source_realpath_attempt_count;
0044 }
0045 uint32_t GetSourceRealpathAttemptCount() const {
0046 return m_source_realpath_attempt_count;
0047 }
0048 void IncreaseSourceRealpathCompatibleCount() {
0049 ++m_source_realpath_compatible_count;
0050 }
0051 uint32_t GetSourceRealpathCompatibleCount() const {
0052 return m_source_realpath_compatible_count;
0053 }
0054
0055 private:
0056
0057
0058
0059
0060
0061
0062 std::vector<std::string> m_prefixes;
0063
0064
0065 llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> m_fs;
0066
0067
0068 lldb::TargetWP m_target;
0069
0070
0071 uint32_t m_source_realpath_attempt_count = 0;
0072 uint32_t m_source_realpath_compatible_count = 0;
0073 };
0074
0075 }
0076
0077 #endif