[llvm] r355192 - Attempt to fix buildbot after r354972 [#2]. NFCI.
Alexey Lapshin via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 1 02:15:18 PST 2019
Author: avl
Date: Fri Mar 1 02:15:18 2019
New Revision: 355192
URL: http://llvm.org/viewvc/llvm-project?rev=355192&view=rev
Log:
Attempt to fix buildbot after r354972 [#2]. NFCI.
Modified:
llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
Modified: llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp?rev=355192&r1=355191&r2=355192&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp (original)
+++ llvm/trunk/tools/llvm-symbolizer/llvm-symbolizer.cpp Fri Mar 1 02:15:18 2019
@@ -201,7 +201,20 @@ static bool parseCommand(StringRef Input
static uint64_t getModuleSectionIndexForAddress(const std::string &ModuleName,
uint64_t Address) {
- Expected<OwningBinary<Binary>> BinaryOrErr = createBinary(ModuleName);
+ // following ModuleName processing was copied from
+ // LLVMSymbolizer::getOrCreateModuleInfo().
+ // it needs to be refactored to avoid code duplication.
+ std::string BinaryName = ModuleName;
+ size_t ColonPos = ModuleName.find_last_of(':');
+ // Verify that substring after colon form a valid arch name.
+ if (ColonPos != std::string::npos) {
+ std::string ArchStr = ModuleName.substr(ColonPos + 1);
+ if (Triple(ArchStr).getArch() != Triple::UnknownArch) {
+ BinaryName = ModuleName.substr(0, ColonPos);
+ }
+ }
+
+ Expected<OwningBinary<Binary>> BinaryOrErr = createBinary(BinaryName);
if (error(BinaryOrErr))
return object::SectionedAddress::UndefSection;
More information about the llvm-commits
mailing list