summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/Process.cpp
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2012-04-18 00:05:19 +0000
committerGreg Clayton <gclayton@apple.com>2012-04-18 00:05:19 +0000
commitac7a3db0677309c6a81f9cf59e1b14dd7881fce1 (patch)
treebe891eec15b3cf982ffd1be1c7e98255fd315868 /lldb/source/Target/Process.cpp
parent1b5d8d46fbc7878a6e0d22fdeb0094a371fea4c3 (diff)
downloadbcm5719-llvm-ac7a3db0677309c6a81f9cf59e1b14dd7881fce1.tar.gz
bcm5719-llvm-ac7a3db0677309c6a81f9cf59e1b14dd7881fce1.zip
Make sure an error is returned when Process::LoadImage() fails.
llvm-svn: 154965
Diffstat (limited to 'lldb/source/Target/Process.cpp')
-rw-r--r--lldb/source/Target/Process.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index c32b4b1305f..dd283c5f736 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -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;
}
OpenPOWER on IntegriCloud