[Lldb-commits] [lldb] r251882 - Emit an error message if the current working directory does not exist when the user is trying to launch argdumper to do shell expansion
Enrico Granata via lldb-commits
lldb-commits at lists.llvm.org
Mon Nov 2 17:47:19 PST 2015
Author: enrico
Date: Mon Nov 2 19:47:19 2015
New Revision: 251882
URL: http://llvm.org/viewvc/llvm-project?rev=251882&view=rev
Log:
Emit an error message if the current working directory does not exist when the user is trying to launch argdumper to do shell expansion
Modified:
lldb/trunk/source/Host/macosx/Host.mm
Modified: lldb/trunk/source/Host/macosx/Host.mm
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/macosx/Host.mm?rev=251882&r1=251881&r2=251882&view=diff
==============================================================================
--- lldb/trunk/source/Host/macosx/Host.mm (original)
+++ lldb/trunk/source/Host/macosx/Host.mm Mon Nov 2 19:47:19 2015
@@ -1371,7 +1371,13 @@ Host::ShellExpandArguments (ProcessLaunc
int status;
std::string output;
- RunShellCommand(expand_command, launch_info.GetWorkingDirectory(), &status, nullptr, &output, 10);
+ FileSpec cwd(launch_info.GetWorkingDirectory());
+ if (!cwd.Exists())
+ {
+ error.SetErrorStringWithFormat("cwd does not exist; cannot launch with shell argument expansion");
+ return error;
+ }
+ RunShellCommand(expand_command, cwd, &status, nullptr, &output, 10);
if (status != 0)
{
More information about the lldb-commits
mailing list