diff --git a/test/DebugInfo/llvm-symbolizer.test b/test/DebugInfo/llvm-symbolizer.test index 11ba6642837..4dc369948fd 100644 --- a/test/DebugInfo/llvm-symbolizer.test +++ b/test/DebugInfo/llvm-symbolizer.test @@ -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 diff --git a/tools/llvm-symbolizer/LLVMSymbolize.cpp b/tools/llvm-symbolizer/LLVMSymbolize.cpp index 57f34c24729..1945d689dee 100644 --- a/tools/llvm-symbolizer/LLVMSymbolize.cpp +++ b/tools/llvm-symbolizer/LLVMSymbolize.cpp @@ -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);