[lldb] [llvm] Debuginfod cache use index cache settings and include real file name (PR #120814)
Greg Clayton via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 10 16:54:48 PST 2025
================
@@ -154,21 +174,29 @@ GetFileForModule(const ModuleSpec &module_spec,
// Grab LLDB's Debuginfod overrides from the
// plugin.symbol-locator.debuginfod.* settings.
PluginProperties &plugin_props = GetGlobalPluginProperties();
- llvm::Expected<std::string> cache_path_or_err = plugin_props.GetCachePath();
- // A cache location is *required*.
- if (!cache_path_or_err)
- return {};
- std::string cache_path = *cache_path_or_err;
+ // Grab the lldb index cache settings from the global module list properties.
+ ModuleListProperties &properties =
+ ModuleList::GetGlobalModuleListProperties();
+ std::string cache_path = properties.GetLLDBIndexCachePath().GetPath();
+
+ llvm::CachePruningPolicy pruning_policy =
+ DataFileCache::GetLLDBIndexCachePolicy();
+
llvm::SmallVector<llvm::StringRef> debuginfod_urls =
llvm::getDefaultDebuginfodUrls();
std::chrono::milliseconds timeout = plugin_props.GetTimeout();
// We're ready to ask the Debuginfod library to find our file.
llvm::object::BuildID build_id(module_uuid.GetBytes());
std::string url_path = UrlBuilder(build_id);
- std::string cache_key = llvm::getDebuginfodCacheKey(url_path);
+ llvm::StringRef file_name = getFileName(module_spec, url_path);
+ std::string cache_file_name = llvm::toHex(build_id, true);
+ if (!file_name.empty()) {
+ cache_file_name += "-" + file_name.str();
+ }
----------------
clayborg wrote:
remove {} from single line if statement per llvm coding guidelines
https://github.com/llvm/llvm-project/pull/120814
More information about the llvm-commits
mailing list