Make sure an error is returned when Process::LoadImage() fails.

llvm-svn: 154965
This commit is contained in:
Greg Clayton 2012-04-18 00:05:19 +00:00
parent 1b5d8d46fb
commit ac7a3db067
1 changed files with 5 additions and 2 deletions

View File

@ -1391,6 +1391,9 @@ Process::GetImageInfoAddress()
uint32_t
Process::LoadImage (const FileSpec &image_spec, Error &error)
{
char path[PATH_MAX];
image_spec.GetPath(path, sizeof(path));
DynamicLoader *loader = GetDynamicLoader();
if (loader)
{
@ -1413,8 +1416,6 @@ Process::LoadImage (const FileSpec &image_spec, Error &error)
frame_sp->CalculateExecutionContext (exe_ctx);
bool unwind_on_error = true;
StreamString expr;
char path[PATH_MAX];
image_spec.GetPath(path, sizeof(path));
expr.Printf("dlopen (\"%s\", 2)", path);
const char *prefix = "extern \"C\" void* dlopen (const char *path, int mode);\n";
lldb::ValueObjectSP result_valobj_sp;
@ -1437,6 +1438,8 @@ Process::LoadImage (const FileSpec &image_spec, Error &error)
}
}
}
if (!error.AsCString())
error.SetErrorStringWithFormat("unable to load '%s'", path);
return LLDB_INVALID_IMAGE_TOKEN;
}