File indexing completed on 2026-05-10 08:42:53
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_TARGET_MODULECACHE_H
0010 #define LLDB_TARGET_MODULECACHE_H
0011
0012 #include "lldb/lldb-forward.h"
0013 #include "lldb/lldb-types.h"
0014
0015 #include "lldb/Host/File.h"
0016 #include "lldb/Utility/FileSpec.h"
0017 #include "lldb/Utility/Status.h"
0018
0019 #include <functional>
0020 #include <string>
0021 #include <unordered_map>
0022
0023 namespace lldb_private {
0024
0025 class Module;
0026 class UUID;
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 class ModuleCache {
0048 public:
0049 using ModuleDownloader =
0050 std::function<Status(const ModuleSpec &, const FileSpec &)>;
0051 using SymfileDownloader =
0052 std::function<Status(const lldb::ModuleSP &, const FileSpec &)>;
0053
0054 Status GetAndPut(const FileSpec &root_dir_spec, const char *hostname,
0055 const ModuleSpec &module_spec,
0056 const ModuleDownloader &module_downloader,
0057 const SymfileDownloader &symfile_downloader,
0058 lldb::ModuleSP &cached_module_sp, bool *did_create_ptr);
0059
0060 private:
0061 Status Put(const FileSpec &root_dir_spec, const char *hostname,
0062 const ModuleSpec &module_spec, const FileSpec &tmp_file,
0063 const FileSpec &target_file);
0064
0065 Status Get(const FileSpec &root_dir_spec, const char *hostname,
0066 const ModuleSpec &module_spec, lldb::ModuleSP &cached_module_sp,
0067 bool *did_create_ptr);
0068
0069 std::unordered_map<std::string, lldb::ModuleWP> m_loaded_modules;
0070 };
0071
0072 }
0073
0074 #endif