From ee69a4bcd06a71fc798c8924f212c4cfd52696c7 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 18 Feb 2015 23:59:11 +0000 Subject: [PATCH] A few minor path fixes for Windows. When launching argdumper, there are a few problems with the current logic. First, on Windows, the file is called argdumper.exe, not argdumper. Second, Windows paths have backslashes in them, and JSON treats as an escape sequence. To fix the second problem, on Windows we convert backslashes to forward slashes, since backslash isn't a valid filename character anyway this shouldn't be a problem. llvm-svn: 229784 --- lldb/source/Target/Platform.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index 6b98ab89f111..c64559920811 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1122,7 +1122,11 @@ Platform::LaunchProcess (ProcessLaunchInfo &launch_info) error.SetErrorString("could not find argdumper tool"); return error; } +#if defined(_WIN32) + glob_tool_spec.AppendPathComponent("argdumper.exe"); +#else glob_tool_spec.AppendPathComponent("argdumper"); +#endif if (!glob_tool_spec.Exists()) { error.SetErrorString("could not find argdumper tool"); @@ -1131,7 +1135,9 @@ Platform::LaunchProcess (ProcessLaunchInfo &launch_info) std::string quoted_cmd_string; launch_info.GetArguments().GetQuotedCommandString(quoted_cmd_string); - +#if defined(_WIN32) + std::replace(quoted_cmd_string.begin(), quoted_cmd_string.end(), '\\', '/'); +#endif StreamString glob_command; glob_command.Printf("%s %s",