Missed a few places where we need to report unreadable executables.

<rdar://problem/17727734>

llvm-svn: 215743
This commit is contained in:
Greg Clayton 2014-08-15 18:03:30 +00:00
parent 1a0b735340
commit 39945dcc0b
6 changed files with 66 additions and 24 deletions

View File

@ -287,10 +287,17 @@ PlatformFreeBSD::ResolveExecutable (const FileSpec &exe_file,
if (error.Fail() || !exe_module_sp)
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
if (exe_file.Readable())
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
else
{
error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
}
}
}
}

View File

@ -184,10 +184,17 @@ PlatformKalimba::ResolveExecutable (const FileSpec &exe_file,
if (error.Fail() || !exe_module_sp)
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
if (exe_file.Readable())
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
else
{
error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
}
}
}
}

View File

@ -301,10 +301,17 @@ PlatformLinux::ResolveExecutable (const FileSpec &exe_file,
if (error.Fail() || !exe_module_sp)
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
if (exe_file.Readable())
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
else
{
error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
}
}
}
}

View File

@ -273,10 +273,17 @@ PlatformRemoteiOS::ResolveExecutable (const FileSpec &exe_file,
if (error.Fail() || !exe_module_sp)
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
if (exe_file.Readable())
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
else
{
error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
}
}
}
else

View File

@ -238,10 +238,17 @@ PlatformiOSSimulator::ResolveExecutable (const FileSpec &exe_file,
if (error.Fail() || !exe_module_sp)
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
if (exe_file.Readable())
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
else
{
error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
}
}
}
else

View File

@ -294,10 +294,17 @@ PlatformWindows::ResolveExecutable (const FileSpec &exe_file,
if (error.Fail() || !exe_module_sp)
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
if (exe_file.Readable())
{
error.SetErrorStringWithFormat ("'%s' doesn't contain any '%s' platform architectures: %s",
exe_file.GetPath().c_str(),
GetPluginName().GetCString(),
arch_names.GetString().c_str());
}
else
{
error.SetErrorStringWithFormat("'%s' is not readable", exe_file.GetPath().c_str());
}
}
}
}