diff options
author | Greg Clayton <gclayton@apple.com> | 2012-09-27 03:13:55 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-09-27 03:13:55 +0000 |
commit | c8f814d1dfec8f162c86b71973f16cea0f229aa7 (patch) | |
tree | 97e10e1c005700bb61ebf6e613c30e8d16474459 /lldb/source/Host/common/Host.cpp | |
parent | c36b184fa2a8cbd083df03664da1f2c1fc264c31 (diff) | |
download | bcm5719-llvm-c8f814d1dfec8f162c86b71973f16cea0f229aa7.tar.gz bcm5719-llvm-c8f814d1dfec8f162c86b71973f16cea0f229aa7.zip |
Added the ability to download a symboled executable and symbol file given a UUID.
llvm-svn: 164753
Diffstat (limited to 'lldb/source/Host/common/Host.cpp')
-rw-r--r-- | lldb/source/Host/common/Host.cpp | 35 |
1 files changed, 24 insertions, 11 deletions
diff --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp index 400f493d2c3..4ed06c000d0 100644 --- a/lldb/source/Host/common/Host.cpp +++ b/lldb/source/Host/common/Host.cpp @@ -1312,19 +1312,32 @@ Host::RunShellCommand (const char *command, int *status_ptr, int *signo_ptr, std::string *command_output_ptr, - uint32_t timeout_sec) + uint32_t timeout_sec, + const char *shell) { Error error; ProcessLaunchInfo launch_info; - launch_info.SetShell("/bin/bash"); - launch_info.GetArguments().AppendArgument(command); - const bool localhost = true; - const bool will_debug = false; - const bool first_arg_is_full_shell_command = true; - launch_info.ConvertArgumentsForLaunchingInShell (error, - localhost, - will_debug, - first_arg_is_full_shell_command); + if (shell && shell[0]) + { + // Run the command in a shell + launch_info.SetShell(shell); + launch_info.GetArguments().AppendArgument(command); + const bool localhost = true; + const bool will_debug = false; + const bool first_arg_is_full_shell_command = true; + launch_info.ConvertArgumentsForLaunchingInShell (error, + localhost, + will_debug, + first_arg_is_full_shell_command); + } + else + { + // No shell, just run it + Args args (command); + const bool first_arg_is_executable = true; + const bool first_arg_is_executable_and_argument = true; + launch_info.SetArguments(args, first_arg_is_executable, first_arg_is_executable_and_argument); + } if (working_dir) launch_info.SetWorkingDirectory(working_dir); @@ -1338,7 +1351,7 @@ Host::RunShellCommand (const char *command, output_file_path = ::tmpnam(output_file_path_buffer); launch_info.AppendSuppressFileAction (STDIN_FILENO, true, false); launch_info.AppendOpenFileAction(STDOUT_FILENO, output_file_path, false, true); - launch_info.AppendDuplicateFileAction(STDERR_FILENO, STDOUT_FILENO); + launch_info.AppendDuplicateFileAction(STDOUT_FILENO, STDERR_FILENO); } else { |