llvm-symbolizer: Recognize a drive letter on win32. Then "REQUIRES: shell" can be removed.

FIXME: Could we use llvm::sys::Path here?
llvm-svn: 185322
This commit is contained in:
NAKAMURA Takumi 2013-07-01 09:51:42 +00:00
parent bafa6b711a
commit 234acdfdc8
2 changed files with 5 additions and 2 deletions

View File

@ -10,8 +10,6 @@ RUN: echo "%p/Inputs/macho-universal:x86_64 0x100000f05" >> %t.input
RUN: llvm-symbolizer --functions --inlining --demangle=false \
RUN: --default-arch=i386 < %t.input | FileCheck %s
REQUIRES: shell
CHECK: main
CHECK-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16

View File

@ -279,6 +279,11 @@ LLVMSymbolizer::getOrCreateModuleInfo(const std::string &ModuleName) {
std::string BinaryName = ModuleName;
std::string ArchName = Opts.DefaultArch;
size_t ColonPos = ModuleName.find(':');
#if defined(_WIN32)
// Recognize a drive letter on win32.
if (ColonPos == 1 && isalpha(ModuleName[0]))
ColonPos = ModuleName.find(':', 2);
#endif
if (ColonPos != std::string::npos) {
BinaryName = ModuleName.substr(0, ColonPos);
ArchName = ModuleName.substr(ColonPos + 1);