Lines Matching +full:string +full:- +full:support

1 //===-- llvm/Debuginfod/Debuginfod.cpp - Debuginfod client library --------===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
16 /// debuginfo, source file) associated with a build-id from debuginfod servers.
22 //===----------------------------------------------------------------------===//
33 #include "llvm/Support/CachePruning.h"
34 #include "llvm/Support/Caching.h"
35 #include "llvm/Support/Errc.h"
36 #include "llvm/Support/Error.h"
37 #include "llvm/Support/FileUtilities.h"
38 #include "llvm/Support/MemoryBuffer.h"
39 #include "llvm/Support/Path.h"
40 #include "llvm/Support/ThreadPool.h"
41 #include "llvm/Support/xxhash.h"
57 std::string getDebuginfodCacheKey(llvm::StringRef S) { in getDebuginfodCacheKey()
61 // Returns a binary BuildID as a normalized hex string.
63 static std::string buildIDToString(BuildIDRef ID) { in buildIDToString()
81 .split(DebuginfodUrls.value(), " ", -1, false); in getDefaultDebuginfodUrls()
97 Expected<std::string> getDefaultDebuginfodCacheDirectory() { in getDefaultDebuginfodCacheDirectory()
105 sys::path::append(CacheDirectory, "llvm-debuginfod", "client"); in getDefaultDebuginfodCacheDirectory()
106 return std::string(CacheDirectory); in getDefaultDebuginfodCacheDirectory()
123 std::string getDebuginfodSourceUrlPath(BuildIDRef ID, in getDebuginfodSourceUrlPath()
129 return std::string(UrlPath); in getDebuginfodSourceUrlPath()
132 Expected<std::string> getCachedOrDownloadSource(BuildIDRef ID, in getCachedOrDownloadSource()
134 std::string UrlPath = getDebuginfodSourceUrlPath(ID, SourceFilePath); in getCachedOrDownloadSource()
138 std::string getDebuginfodExecutableUrlPath(BuildIDRef ID) { in getDebuginfodExecutableUrlPath()
142 return std::string(UrlPath); in getDebuginfodExecutableUrlPath()
145 Expected<std::string> getCachedOrDownloadExecutable(BuildIDRef ID) { in getCachedOrDownloadExecutable()
146 std::string UrlPath = getDebuginfodExecutableUrlPath(ID); in getCachedOrDownloadExecutable()
150 std::string getDebuginfodDebuginfoUrlPath(BuildIDRef ID) { in getDebuginfodDebuginfoUrlPath()
154 return std::string(UrlPath); in getDebuginfodDebuginfoUrlPath()
157 Expected<std::string> getCachedOrDownloadDebuginfo(BuildIDRef ID) { in getCachedOrDownloadDebuginfo()
158 std::string UrlPath = getDebuginfodDebuginfoUrlPath(ID); in getCachedOrDownloadDebuginfo()
163 Expected<std::string> getCachedOrDownloadArtifact(StringRef UniqueKey, in getCachedOrDownloadArtifact()
167 Expected<std::string> CacheDirOrErr = getDefaultDebuginfodCacheDirectory(); in getCachedOrDownloadArtifact()
209 *FileStream->OS << BodyChunk; in handleBodyChunk()
213 // An over-accepting simplification of the HTTP RFC 7230 spec.
224 static SmallVector<std::string, 0> getHeaders() { in getHeaders()
233 SmallVector<std::string, 0> Headers; in getHeaders()
235 for (StringRef Line : llvm::split((*HeadersFile)->getBuffer(), '\n')) { in getHeaders()
251 Expected<std::string> getCachedOrDownloadArtifact( in getCachedOrDownloadArtifact()
256 "llvmcache-" + UniqueKey); in getCachedOrDownloadArtifact()
259 localCache("Debuginfod-client", ".debuginfod-client", CacheDirectoryPath); in getCachedOrDownloadArtifact()
271 return std::string(AbsCachedArtifactPath); in getCachedOrDownloadArtifact()
314 return std::string(AbsCachedArtifactPath); in getCachedOrDownloadArtifact()
364 for (const std::string &Path : Paths) { in update()
420 IteratorGroup.async([&, this]() -> void { in findBinaries()
421 std::string FilePath; in findBinaries()
430 FilePath = I->path(); in findBinaries()
446 if (!Bin->isObject()) in findBinaries()
449 // TODO: Support non-ELF binaries in findBinaries()
459 std::string IDString = buildIDToString(ID); in findBinaries()
460 if (Object->hasDebugInfo()) { in findBinaries()
477 Expected<std::optional<std::string>>
483 std::string Path = Loc->getValue(); in getBinaryPath()
489 Expected<std::optional<std::string>>
495 std::string Path = Loc->getValue(); in getDebugBinaryPath()
501 Expected<std::string> DebuginfodCollection::findBinaryPath(BuildIDRef ID) { in findBinaryPath()
503 // Check collection; perform on-demand update if stale. in findBinaryPath()
504 Expected<std::optional<std::string>> PathOrErr = getBinaryPath(ID); in findBinaryPath()
507 std::optional<std::string> Path = *PathOrErr; in findBinaryPath()
525 Expected<std::string> PathOrErr = getCachedOrDownloadExecutable(ID); in findBinaryPath()
533 Expected<std::string> DebuginfodCollection::findDebugBinaryPath(BuildIDRef ID) { in findDebugBinaryPath()
534 // Check collection; perform on-demand update if stale. in findDebugBinaryPath()
535 Expected<std::optional<std::string>> PathOrErr = getDebugBinaryPath(ID); in findDebugBinaryPath()
538 std::optional<std::string> Path = *PathOrErr; in findDebugBinaryPath()
564 std::string IDString; in DebuginfodServer()
567 {404, "text/plain", "Build ID is not a hex string\n"}); in DebuginfodServer()
571 Expected<std::string> PathOrErr = Collection.findDebugBinaryPath(ID); in DebuginfodServer()
582 std::string IDString; in DebuginfodServer()
585 {404, "text/plain", "Build ID is not a hex string\n"}); in DebuginfodServer()
589 Expected<std::string> PathOrErr = Collection.findBinaryPath(ID); in DebuginfodServer()