summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/macosx
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2012-07-12 14:09:25 +0000
committerFilipe Cabecinhas <me@filcab.net>2012-07-12 14:09:25 +0000
commit0c251adf75c428762dec393ff36722dab4f1a1c0 (patch)
tree8f2217689da702fc0a416c17851f43f1131bb692 /lldb/source/Host/macosx
parentfdce33a49589a5b5cbfad2100a17f19e334fe86f (diff)
downloadbcm5719-llvm-0c251adf75c428762dec393ff36722dab4f1a1c0.tar.gz
bcm5719-llvm-0c251adf75c428762dec393ff36722dab4f1a1c0.zip
Provide more information when process launch can't change directory to the
path passed with -w Test this functionality. llvm-svn: 160130
Diffstat (limited to 'lldb/source/Host/macosx')
-rw-r--r--lldb/source/Host/macosx/Host.mm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lldb/source/Host/macosx/Host.mm b/lldb/source/Host/macosx/Host.mm
index 50afa2f8edc..0aea4a6bf03 100644
--- a/lldb/source/Host/macosx/Host.mm
+++ b/lldb/source/Host/macosx/Host.mm
@@ -1532,7 +1532,16 @@ LaunchProcessPosixSpawn (const char *exe_path, ProcessLaunchInfo &launch_info, :
if (working_dir)
{
// No more thread specific current working directory
- __pthread_chdir (working_dir);
+ if (__pthread_chdir (working_dir) < 0) {
+ if (errno == ENOENT) {
+ error.SetErrorStringWithFormat("No such file or directory: %s", working_dir);
+ } else if (errno == ENOTDIR) {
+ error.SetErrorStringWithFormat("Path doesn't name a directory: %s", working_dir);
+ } else {
+ error.SetErrorStringWithFormat("An unknown error occurred when changing directory for process execution.");
+ }
+ return error;
+ }
}
const size_t num_file_actions = launch_info.GetNumFileActions ();
OpenPOWER on IntegriCloud