LLVM 20.0.0git
Namespaces | Functions
Debuginfod.cpp File Reference

This file contains several definitions for the debuginfod client and server. More...

#include "llvm/Debuginfod/Debuginfod.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/DebugInfo/DWARF/DWARFContext.h"
#include "llvm/DebugInfo/Symbolize/Symbolize.h"
#include "llvm/Debuginfod/HTTPClient.h"
#include "llvm/Object/BuildID.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Support/CachePruning.h"
#include "llvm/Support/Caching.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/xxhash.h"
#include <atomic>
#include <optional>
#include <thread>

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Functions

std::string llvm::getDebuginfodCacheKey (StringRef UrlPath)
 Returns the cache key for a given debuginfod URL path.
 
static std::string llvm::buildIDToString (BuildIDRef ID)
 
bool llvm::canUseDebuginfod ()
 Returns false if a debuginfod lookup can be determined to have no chance of succeeding.
 
SmallVector< StringRef > llvm::getDefaultDebuginfodUrls ()
 Finds default array of Debuginfod server URLs by checking DEBUGINFOD_URLS environment variable.
 
void llvm::setDefaultDebuginfodUrls (const SmallVector< StringRef > &URLs)
 Sets the list of debuginfod server URLs to query.
 
Expected< std::string > llvm::getDefaultDebuginfodCacheDirectory ()
 Finds a default local file caching directory for the debuginfod client, first checking DEBUGINFOD_CACHE_PATH.
 
std::chrono::milliseconds llvm::getDefaultDebuginfodTimeout ()
 Finds a default timeout for debuginfod HTTP requests.
 
std::string llvm::getDebuginfodSourceUrlPath (BuildIDRef ID, StringRef SourceFilePath)
 The following functions fetch a debuginfod artifact to a file in a local cache and return the cached file path.
 
Expected< std::string > llvm::getCachedOrDownloadSource (BuildIDRef ID, StringRef SourceFilePath)
 
std::string llvm::getDebuginfodExecutableUrlPath (BuildIDRef ID)
 
Expected< std::string > llvm::getCachedOrDownloadExecutable (BuildIDRef ID)
 
std::string llvm::getDebuginfodDebuginfoUrlPath (BuildIDRef ID)
 
Expected< std::string > llvm::getCachedOrDownloadDebuginfo (BuildIDRef ID)
 
Expected< std::string > llvm::getCachedOrDownloadArtifact (StringRef UniqueKey, StringRef UrlPath)
 Fetches any debuginfod artifact using the default local cache directory and server URLs.
 
static bool llvm::isHeader (StringRef S)
 
static SmallVector< std::string, 0 > llvm::getHeaders ()
 
Expected< std::string > llvm::getCachedOrDownloadArtifact (StringRef UniqueKey, StringRef UrlPath, StringRef CacheDirectoryPath, ArrayRef< StringRef > DebuginfodUrls, std::chrono::milliseconds Timeout)
 Fetches any debuginfod artifact using the specified local cache directory, server URLs, and request timeout (in milliseconds).
 
static bool llvm::hasELFMagic (StringRef FilePath)
 

Detailed Description

This file contains several definitions for the debuginfod client and server.

For the client, this file defines the fetchInfo function. For the server, this file defines the DebuginfodLogEntry and DebuginfodServer structs, as well as the DebuginfodLog, DebuginfodCollection classes. The fetchInfo function retrieves any of the three supported artifact types: (executable, debuginfo, source file) associated with a build-id from debuginfod servers. If a source file is to be fetched, its absolute path must be specified in the Description argument to fetchInfo. The DebuginfodLogEntry, DebuginfodLog, and DebuginfodCollection are used by the DebuginfodServer to scan the local filesystem for binaries and serve the debuginfod protocol.

Definition in file Debuginfod.cpp.