32 for (
const auto &
P : *PhdrsOrErr) {
36 for (
auto N : Obj.
notes(
P, Err))
39 return N.getDesc(
P.p_align);
49 if (!tryGetFromHex(Str, Bytes))
58 return ::getBuildID(O->getELFFile());
60 return ::getBuildID(O->getELFFile());
62 return ::getBuildID(O->getELFFile());
64 return ::getBuildID(O->getELFFile());
69 auto GetDebugPath = [&](
StringRef Directory) {
73 llvm::toHex(
BuildID.slice(1),
true));
77 if (DebugFileDirectories.empty()) {
79#
if defined(__NetBSD__)
88 return std::string(Path);
90 for (
const auto &Directory : DebugFileDirectories) {
94 return std::string(Path);
This file declares a library for handling Build IDs and using them to find debug info.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
StringRef - Represent a constant reference to a string, i.e.
virtual std::optional< std::string > fetch(BuildIDRef BuildID) const
Returns the path to the debug file with the given build ID.
iterator_range< Elf_Note_Iterator > notes(const Elf_Phdr &Phdr, Error &Err) const
Get an iterator range over notes of a program header.
Expected< Elf_Phdr_Range > program_headers() const
Iterate over program header table.
This class is the base class for all object file types.
constexpr const char * ELF_NOTE_GNU
SmallVector< uint8_t, 10 > BuildID
A build ID in binary form.
BuildIDRef getBuildID(const ObjectFile *Obj)
Returns the build ID, if any, contained in the given object file.
BuildID parseBuildID(StringRef Str)
Parses a build ID from a hex string.
bool exists(const basic_file_status &status)
Does file exist?
void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
void consumeError(Error Err)
Consume a Error without doing anything.