Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit e11e90a

Browse files
committed
Attempt to fix buildbot after r354972 [#2]. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@355192 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent de23a6b commit e11e90a

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

tools/llvm-symbolizer/llvm-symbolizer.cpp

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,20 @@ static bool parseCommand(StringRef InputString, bool &IsData,
201201
static uint64_t getModuleSectionIndexForAddress(const std::string &ModuleName,
202202
uint64_t Address) {
203203

204-
Expected<OwningBinary<Binary>> BinaryOrErr = createBinary(ModuleName);
204+
// following ModuleName processing was copied from
205+
// LLVMSymbolizer::getOrCreateModuleInfo().
206+
// it needs to be refactored to avoid code duplication.
207+
std::string BinaryName = ModuleName;
208+
size_t ColonPos = ModuleName.find_last_of(':');
209+
// Verify that substring after colon form a valid arch name.
210+
if (ColonPos != std::string::npos) {
211+
std::string ArchStr = ModuleName.substr(ColonPos + 1);
212+
if (Triple(ArchStr).getArch() != Triple::UnknownArch) {
213+
BinaryName = ModuleName.substr(0, ColonPos);
214+
}
215+
}
216+
217+
Expected<OwningBinary<Binary>> BinaryOrErr = createBinary(BinaryName);
205218

206219
if (error(BinaryOrErr))
207220
return object::SectionedAddress::UndefSection;

0 commit comments

Comments
 (0)