summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ThreadPlanCallFunction.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-03-28 00:04:05 +0000
committerJim Ingham <jingham@apple.com>2013-03-28 00:04:05 +0000
commitea06f3bf4cb1d46ca29f9589fee0c2b27ba495a0 (patch)
treef0eaf19ff810ea7431d033acca05e17d4d32ea16 /lldb/source/Target/ThreadPlanCallFunction.cpp
parent89b466c6031bd5fd342d8a1d397cd90ef679e2ac (diff)
downloadbcm5719-llvm-ea06f3bf4cb1d46ca29f9589fee0c2b27ba495a0.tar.gz
bcm5719-llvm-ea06f3bf4cb1d46ca29f9589fee0c2b27ba495a0.zip
Return a useful error message from ValidatePlan if the expression can't be made for some reason.
llvm-svn: 178201
Diffstat (limited to 'lldb/source/Target/ThreadPlanCallFunction.cpp')
-rw-r--r--lldb/source/Target/ThreadPlanCallFunction.cpp30
1 files changed, 23 insertions, 7 deletions
diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp
index e0c2eaeb86c..9f7bd8a0c24 100644
--- a/lldb/source/Target/ThreadPlanCallFunction.cpp
+++ b/lldb/source/Target/ThreadPlanCallFunction.cpp
@@ -68,8 +68,9 @@ ThreadPlanCallFunction::ConstructorSetup (Thread &thread,
process_sp->ReadUnsignedIntegerFromMemory(m_function_sp, 4, 0, error);
if (!error.Success())
{
+ m_constructor_errors.Printf ("Trying to put the stack in unreadable memory at: 0x%" PRIx64 ".", m_function_sp);
if (log)
- log->Printf ("ThreadPlanCallFunction(%p): Trying to put the stack in unreadable memory at: 0x%" PRIx64 ".", this, m_function_sp);
+ log->Printf ("ThreadPlanCallFunction(%p): %s.", this, m_constructor_errors.GetData());
return false;
}
@@ -77,8 +78,9 @@ ThreadPlanCallFunction::ConstructorSetup (Thread &thread,
if (exe_module == NULL)
{
+ m_constructor_errors.Printf ("Can't execute code without an executable module.");
if (log)
- log->Printf ("ThreadPlanCallFunction(%p): Can't execute code without an executable module.", this);
+ log->Printf ("ThreadPlanCallFunction(%p): %s.", this, m_constructor_errors.GetData());
return false;
}
else
@@ -86,17 +88,21 @@ ThreadPlanCallFunction::ConstructorSetup (Thread &thread,
ObjectFile *objectFile = exe_module->GetObjectFile();
if (!objectFile)
{
+ m_constructor_errors.Printf ("Could not find object file for module \"%s\".",
+ exe_module->GetFileSpec().GetFilename().AsCString());
+
if (log)
- log->Printf ("ThreadPlanCallFunction(%p): Could not find object file for module \"%s\".",
- this, exe_module->GetFileSpec().GetFilename().AsCString());
+ log->Printf ("ThreadPlanCallFunction(%p): %s.", this, m_constructor_errors.GetData());
return false;
}
+
m_start_addr = objectFile->GetEntryPointAddress();
if (!m_start_addr.IsValid())
{
+ m_constructor_errors.Printf ("Could not find entry point address for executable module \"%s\".",
+ exe_module->GetFileSpec().GetFilename().AsCString());
if (log)
- log->Printf ("ThreadPlanCallFunction(%p): Could not find entry point address for executable module \"%s\".",
- this, exe_module->GetFileSpec().GetFilename().AsCString());
+ log->Printf ("ThreadPlanCallFunction(%p): %s.", this, m_constructor_errors.GetData());
return false;
}
}
@@ -109,8 +115,9 @@ ThreadPlanCallFunction::ConstructorSetup (Thread &thread,
if (!thread.CheckpointThreadState (m_stored_thread_state))
{
+ m_constructor_errors.Printf ("Setting up ThreadPlanCallFunction, failed to checkpoint thread state.");
if (log)
- log->Printf ("ThreadPlanCallFunction(%p): Setting up ThreadPlanCallFunction, failed to checkpoint thread state.", this);
+ log->Printf ("ThreadPlanCallFunction(%p): %s.", this, m_constructor_errors.GetData());
return false;
}
function_load_addr = m_function_addr.GetLoadAddress (target_sp.get());
@@ -330,7 +337,16 @@ bool
ThreadPlanCallFunction::ValidatePlan (Stream *error)
{
if (!m_valid)
+ {
+ if (error)
+ {
+ if (m_constructor_errors.GetSize() > 0)
+ error->PutCString (m_constructor_errors.GetData());
+ else
+ error->PutCString ("Unknown error");
+ }
return false;
+ }
return true;
}
OpenPOWER on IntegriCloud