diff options
Diffstat (limited to 'lldb/source/Target/ProcessLaunchInfo.cpp')
-rw-r--r-- | lldb/source/Target/ProcessLaunchInfo.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lldb/source/Target/ProcessLaunchInfo.cpp b/lldb/source/Target/ProcessLaunchInfo.cpp index a4dd3635092..d5f3d5176d3 100644 --- a/lldb/source/Target/ProcessLaunchInfo.cpp +++ b/lldb/source/Target/ProcessLaunchInfo.cpp @@ -396,15 +396,14 @@ ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell (Error &error, Args shell_arguments; std::string safe_arg; shell_arguments.AppendArgument (shell_executable.c_str()); - + shell_arguments.AppendArgument ("-c"); StreamString shell_command; if (will_debug) { // Add a modified PATH environment variable in case argv[0] - // is a relative path. + // is a relative path const char *argv0 = argv[0]; - FileSpec arg_spec(argv0, false); - if (arg_spec.IsRelativeToCurrentWorkingDirectory()) + if (argv0 && (argv0[0] != '/' && argv0[0] != '~')) { // We have a relative path to our executable which may not work if // we just try to run "a.out" (without it being converted to "./a.out") @@ -435,7 +434,7 @@ ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell (Error &error, shell_command.PutCString(new_path.c_str()); } - shell_command.PutCString("exec"); + shell_command.PutCString ("exec"); // Only Apple supports /usr/bin/arch being able to specify the architecture if (GetArchitecture().IsValid() && // Valid architecture |