diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-08 17:13:54 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-08 17:13:54 +0000 |
commit | 8b4000f13b303cc154136abc74c55670673e2a96 (patch) | |
tree | cde70521176ae2fac67cb037f0a876972b9cc5f0 /source/API/SBProcess.cpp | |
parent | 52fd8de56a8a12201c1e6188e1f34d28c3d3398d (diff) |
Notes
Diffstat (limited to 'source/API/SBProcess.cpp')
-rw-r--r-- | source/API/SBProcess.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp index 5614cb468a69..0348113a9873 100644 --- a/source/API/SBProcess.cpp +++ b/source/API/SBProcess.cpp @@ -1157,22 +1157,34 @@ uint32_t SBProcess::LoadImage(lldb::SBFileSpec &sb_remote_image_spec, uint32_t SBProcess::LoadImage(const lldb::SBFileSpec &sb_local_image_spec, const lldb::SBFileSpec &sb_remote_image_spec, lldb::SBError &sb_error) { + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); ProcessSP process_sp(GetSP()); if (process_sp) { Process::StopLocker stop_locker; if (stop_locker.TryLock(&process_sp->GetRunLock())) { + if (log) + log->Printf("SBProcess(%p)::LoadImage() => calling Platform::LoadImage" + "for: %s", + static_cast<void *>(process_sp.get()), + sb_local_image_spec.GetFilename()); + std::lock_guard<std::recursive_mutex> guard( - process_sp->GetTarget().GetAPIMutex()); + process_sp->GetTarget().GetAPIMutex()); PlatformSP platform_sp = process_sp->GetTarget().GetPlatform(); return platform_sp->LoadImage(process_sp.get(), *sb_local_image_spec, *sb_remote_image_spec, sb_error.ref()); } else { - Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); if (log) log->Printf("SBProcess(%p)::LoadImage() => error: process is running", static_cast<void *>(process_sp.get())); sb_error.SetErrorString("process is running"); } + } else { + if (log) + log->Printf("SBProcess(%p)::LoadImage() => error: called with invalid" + " process", + static_cast<void *>(process_sp.get())); + sb_error.SetErrorString("process is invalid"); } return LLDB_INVALID_IMAGE_TOKEN; } |