From d3173f34e8546a96b8d0df0d9de133f88f10c127 Mon Sep 17 00:00:00 2001 From: Chaoren Lin Date: Fri, 29 May 2015 19:52:29 +0000 Subject: Refactor many file functions to use FileSpec over strings. Summary: This should solve the issue of sending denormalized paths over gdb-remote if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the server handle any denormalization. Reviewers: ovyalov, zturner, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D9728 llvm-svn: 238604 --- lldb/source/Target/Process.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'lldb/source/Target/Process.cpp') diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 322d7fbfb27..88a07b9613d 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -432,7 +432,7 @@ ProcessLaunchCommandOptions::SetOptionValue (uint32_t option_idx, const char *op case 'i': // STDIN for read only { FileAction action; - if (action.Open (STDIN_FILENO, option_arg, true, false)) + if (action.Open(STDIN_FILENO, FileSpec{option_arg, false}, true, false)) launch_info.AppendFileAction (action); break; } @@ -440,7 +440,7 @@ ProcessLaunchCommandOptions::SetOptionValue (uint32_t option_idx, const char *op case 'o': // Open STDOUT for write only { FileAction action; - if (action.Open (STDOUT_FILENO, option_arg, false, true)) + if (action.Open(STDOUT_FILENO, FileSpec{option_arg, false}, false, true)) launch_info.AppendFileAction (action); break; } @@ -448,7 +448,7 @@ ProcessLaunchCommandOptions::SetOptionValue (uint32_t option_idx, const char *op case 'e': // STDERR for write only { FileAction action; - if (action.Open (STDERR_FILENO, option_arg, false, true)) + if (action.Open(STDERR_FILENO, FileSpec{option_arg, false}, false, true)) launch_info.AppendFileAction (action); break; } @@ -460,17 +460,18 @@ ProcessLaunchCommandOptions::SetOptionValue (uint32_t option_idx, const char *op case 'n': // Disable STDIO { FileAction action; - if (action.Open (STDIN_FILENO, "/dev/null", true, false)) + const FileSpec dev_null{"/dev/null", false}; + if (action.Open(STDIN_FILENO, dev_null, true, false)) launch_info.AppendFileAction (action); - if (action.Open (STDOUT_FILENO, "/dev/null", false, true)) + if (action.Open(STDOUT_FILENO, dev_null, false, true)) launch_info.AppendFileAction (action); - if (action.Open (STDERR_FILENO, "/dev/null", false, true)) + if (action.Open(STDERR_FILENO, dev_null, false, true)) launch_info.AppendFileAction (action); break; } case 'w': - launch_info.SetWorkingDirectory (option_arg); + launch_info.SetWorkingDirectory(FileSpec{option_arg, false}); break; case 't': // Open process in new terminal window -- cgit v1.2.3