[DebugInfod] Prefix debuginfod cache directory

This prevents the debuginfod client from dumping files directly into the
default cache directory (e.g., ~/.cache). Instead, these files are
placed in a subdirectory (e.g., ~/.cache/llvm-debuginfod/client).
Behavior is unaffected if the cache directory is provided by the
DEBUGINFO_CACHE_PATH environment variable.

Patch By: mysterymath

Differential Revision: https://reviews.llvm.org/D117619
This commit is contained in:
Petr Hosek 2022-01-19 10:08:17 -08:00
parent f2dac557f5
commit fd0782a37b
1 changed files with 1 additions and 0 deletions

View File

@ -52,6 +52,7 @@ Expected<std::string> getDefaultDebuginfodCacheDirectory() {
if (!sys::path::cache_directory(CacheDirectory))
return createStringError(
errc::io_error, "Unable to determine appropriate cache directory.");
sys::path::append(CacheDirectory, "llvm-debuginfod", "client");
return std::string(CacheDirectory);
}