summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/Symbolize
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-07-30 01:34:08 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-07-30 01:34:08 +0000
commite5adb68e044da6733e9ebba7aea913c1ca9618dd (patch)
tree6adf83bda66ffc3c19525d26104077ef61275d65 /llvm/lib/DebugInfo/Symbolize
parent67b0e589d02e4e17815ab6f2e0f72b4b8190b41b (diff)
downloadbcm5719-llvm-e5adb68e044da6733e9ebba7aea913c1ca9618dd.tar.gz
bcm5719-llvm-e5adb68e044da6733e9ebba7aea913c1ca9618dd.zip
DebugInfo: Provide option for explicitly specifying the name of the DWP file
If you've archived the DWP file somewhere it's probably useful to be able to just tell llvm-symbolizer where it is when you're symbolizing stack traces from the binary. This only provides a mechanism for specifying a single DWP file, good if you're symbolizing a program with a single DWP file, but it's likely if the program is dynamically linked that you might have a DWP for each dynamic library - in which case this feature won't help (at least as it's surfaced in llvm-symbolizer for now) - in theory it could be extended to specify a collection of DWP files that could all be consulted for split CU hash resolution. llvm-svn: 309498
Diffstat (limited to 'llvm/lib/DebugInfo/Symbolize')
-rw-r--r--llvm/lib/DebugInfo/Symbolize/Symbolize.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
index 1d8b4321647..7aa55e755d2 100644
--- a/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
+++ b/llvm/lib/DebugInfo/Symbolize/Symbolize.cpp
@@ -53,10 +53,11 @@
namespace llvm {
namespace symbolize {
-Expected<DILineInfo> LLVMSymbolizer::symbolizeCode(const std::string &ModuleName,
- uint64_t ModuleOffset) {
+Expected<DILineInfo>
+LLVMSymbolizer::symbolizeCode(const std::string &ModuleName,
+ uint64_t ModuleOffset, StringRef DWPName) {
SymbolizableModule *Info;
- if (auto InfoOrErr = getOrCreateModuleInfo(ModuleName))
+ if (auto InfoOrErr = getOrCreateModuleInfo(ModuleName, DWPName))
Info = InfoOrErr.get();
else
return InfoOrErr.takeError();
@@ -80,9 +81,9 @@ Expected<DILineInfo> LLVMSymbolizer::symbolizeCode(const std::string &ModuleName
Expected<DIInliningInfo>
LLVMSymbolizer::symbolizeInlinedCode(const std::string &ModuleName,
- uint64_t ModuleOffset) {
+ uint64_t ModuleOffset, StringRef DWPName) {
SymbolizableModule *Info;
- if (auto InfoOrErr = getOrCreateModuleInfo(ModuleName))
+ if (auto InfoOrErr = getOrCreateModuleInfo(ModuleName, DWPName))
Info = InfoOrErr.get();
else
return InfoOrErr.takeError();
@@ -364,7 +365,8 @@ LLVMSymbolizer::getOrCreateObject(const std::string &Path,
}
Expected<SymbolizableModule *>
-LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
+LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName,
+ StringRef DWPName) {
const auto &I = Modules.find(ModuleName);
if (I != Modules.end()) {
return I->second.get();
@@ -409,7 +411,8 @@ LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
}
}
if (!Context)
- Context = DWARFContext::create(*Objects.second);
+ Context = DWARFContext::create(*Objects.second, nullptr,
+ DWARFContext::defaultErrorHandler, DWPName);
assert(Context);
auto InfoOrErr =
SymbolizableObjectFile::create(Objects.first, std::move(Context));
OpenPOWER on IntegriCloud