[PATCH] D95232: Symbolizer - Teach symbolizer to work directly on object file.
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 16 12:59:06 PST 2021
MaskRay added a comment.
The issues with the `const std::string &` `symbolize*` API:
- The LLVMSymbolizer instance needs to construct `ObjectFile`, which may be a duplicate if the application has an `ObjectFile` as well.
- The file reading error is buried in the API. The user may want to handle the IO error themselves.
- It does magic things (oepning an auxiliary file) which may be of security concern for some usage: it constructs a .dsym path for a Mach-O file; it constructs a path from build ID for an ELF file; it constructs a `.gnu_debuglink` path if the section is present in an ELF file; it constructs a PDB path for a PE file.
The `const ObjectFile &` `symbolize*` does not have the ability to open magic auxiliary files. If we want to keep just one set of `symbolize*` overloads and go for `const ObjectFile &`, we perhaps need to store `ObjectFile` handles instead of `StringRef` handles for LLVMSymbolizer's internal maps, and make `Expected<SymbolizableModule *> LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName)` public.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D95232/new/
https://reviews.llvm.org/D95232
More information about the llvm-commits
mailing list