[Reproducers] Capture return values of functions returning by ptr/ref

For some reason I had convinced myself that functions returning by
pointer or reference do not require recording their result. However,
after further considering I don't see how that could work, at least not
with the current implementation. Interestingly enough, the reproducer
instrumentation already (mostly) accounts for this, though the
lldb-instr tool did not.

This patch adds the missing macros and updates the lldb-instr tool.

Differential revision: https://reviews.llvm.org/D60178

llvm-svn: 357639
This commit is contained in:
Jonas Devlieghere
2019-04-03 21:31:22 +00:00
parent 7c711ccf36
commit 306809f292
64 changed files with 203 additions and 93 deletions

View File

@@ -84,7 +84,7 @@ const lldb::SBThread &SBThread::operator=(const SBThread &rhs) {
if (this != &rhs)
m_opaque_sp = clone(rhs.m_opaque_sp);
return *this;
return LLDB_RECORD_RESULT(*this);
}
//----------------------------------------------------------------------
@@ -1402,9 +1402,8 @@ lldb_private::Thread *SBThread::operator->() {
ThreadSP thread_sp(m_opaque_sp->GetThreadSP());
if (thread_sp)
return thread_sp.get();
else
return NULL;
return LLDB_RECORD_RESULT(thread_sp.get());
return nullptr;
}
lldb_private::Thread *SBThread::get() {
@@ -1412,9 +1411,8 @@ lldb_private::Thread *SBThread::get() {
ThreadSP thread_sp(m_opaque_sp->GetThreadSP());
if (thread_sp)
return thread_sp.get();
else
return NULL;
return LLDB_RECORD_RESULT(thread_sp.get());
return nullptr;
}
namespace lldb_private {