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

FIXME: Could we use llvm::sys::Path here?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185322 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2013-07-01 09:51:42 +00:00
parent f04f8b4f77
commit d212db0cac
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);