Add the ability to capture the return value in a thread's stop info, and print it

as part of the thread format output.
Currently this is only done for the ThreadPlanStepOut.
Add a convenience API ABI::GetReturnValueObject.
Change the ValueObject::EvaluationPoint to BE an ExecutionContextScope, rather than
trying to hand out one of its subsidiary object's pointers.  That way this will always
be good.

llvm-svn: 146806
This commit is contained in:
Jim Ingham
2011-12-17 01:35:57 +00:00
parent 903231bc58
commit 73ca05a2a0
22 changed files with 316 additions and 40 deletions

View File

@@ -31,10 +31,10 @@
#include "lldb/API/SBAddress.h"
#include "lldb/API/SBFrame.h"
// DONT THINK THIS IS NECESSARY: #include "lldb/API/SBSourceManager.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBFrame.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBValue.h"
using namespace lldb;
using namespace lldb_private;
@@ -316,6 +316,30 @@ SBThread::GetStopDescription (char *dst, size_t dst_len)
return 0;
}
SBValue
SBThread::GetStopReturnValue ()
{
ValueObjectSP return_valobj_sp;
if (m_opaque_sp)
{
Mutex::Locker api_locker (m_opaque_sp->GetProcess().GetTarget().GetAPIMutex());
StopInfoSP stop_info_sp = m_opaque_sp->GetStopInfo ();
if (stop_info_sp)
{
return_valobj_sp = StopInfo::GetReturnValueObject (stop_info_sp);
}
}
LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
if (log)
log->Printf ("SBThread(%p)::GetStopReturnValue () => %s", m_opaque_sp.get(),
return_valobj_sp.get()
? return_valobj_sp->GetValueAsCString()
: "<no return value>");
return SBValue (return_valobj_sp);
}
void
SBThread::SetThread (const ThreadSP& lldb_object_sp)
{