diff options
Diffstat (limited to 'lldb/source/API/SBThread.cpp')
-rw-r--r-- | lldb/source/API/SBThread.cpp | 249 |
1 files changed, 214 insertions, 35 deletions
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index bc9652625ec..ab08bb3563f 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "lldb/API/SBThread.h" +#include "SBReproducerPrivate.h" #include "Utils.h" #include "lldb/API/SBAddress.h" #include "lldb/API/SBDebugger.h" @@ -49,18 +50,27 @@ using namespace lldb; using namespace lldb_private; const char *SBThread::GetBroadcasterClassName() { + LLDB_RECORD_STATIC_METHOD_NO_ARGS(const char *, SBThread, + GetBroadcasterClassName); + return Thread::GetStaticBroadcasterClass().AsCString(); } //---------------------------------------------------------------------- // Constructors //---------------------------------------------------------------------- -SBThread::SBThread() : m_opaque_sp(new ExecutionContextRef()) {} +SBThread::SBThread() : m_opaque_sp(new ExecutionContextRef()) { + LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBThread); +} SBThread::SBThread(const ThreadSP &lldb_object_sp) - : m_opaque_sp(new ExecutionContextRef(lldb_object_sp)) {} + : m_opaque_sp(new ExecutionContextRef(lldb_object_sp)) { + LLDB_RECORD_CONSTRUCTOR(SBThread, (const lldb::ThreadSP &), lldb_object_sp); +} SBThread::SBThread(const SBThread &rhs) : m_opaque_sp() { + LLDB_RECORD_CONSTRUCTOR(SBThread, (const lldb::SBThread &), rhs); + m_opaque_sp = clone(rhs.m_opaque_sp); } @@ -69,6 +79,9 @@ SBThread::SBThread(const SBThread &rhs) : m_opaque_sp() { //---------------------------------------------------------------------- const lldb::SBThread &SBThread::operator=(const SBThread &rhs) { + LLDB_RECORD_METHOD(const lldb::SBThread &, + SBThread, operator=,(const lldb::SBThread &), rhs); + if (this != &rhs) m_opaque_sp = clone(rhs.m_opaque_sp); return *this; @@ -80,6 +93,8 @@ const lldb::SBThread &SBThread::operator=(const SBThread &rhs) { SBThread::~SBThread() {} lldb::SBQueue SBThread::GetQueue() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::SBQueue, SBThread, GetQueue); + SBQueue sb_queue; QueueSP queue_sp; std::unique_lock<std::recursive_mutex> lock; @@ -105,10 +120,12 @@ lldb::SBQueue SBThread::GetQueue() const { static_cast<void *>(exe_ctx.GetThreadPtr()), static_cast<void *>(queue_sp.get())); - return sb_queue; + return LLDB_RECORD_RESULT(sb_queue); } bool SBThread::IsValid() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBThread, IsValid); + std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -123,9 +140,15 @@ bool SBThread::IsValid() const { return false; } -void SBThread::Clear() { m_opaque_sp->Clear(); } +void SBThread::Clear() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBThread, Clear); + + m_opaque_sp->Clear(); +} StopReason SBThread::GetStopReason() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::StopReason, SBThread, GetStopReason); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); StopReason reason = eStopReasonInvalid; @@ -153,6 +176,8 @@ StopReason SBThread::GetStopReason() { } size_t SBThread::GetStopReasonDataCount() { + LLDB_RECORD_METHOD_NO_ARGS(size_t, SBThread, GetStopReasonDataCount); + std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -206,6 +231,9 @@ size_t SBThread::GetStopReasonDataCount() { } uint64_t SBThread::GetStopReasonDataAtIndex(uint32_t idx) { + LLDB_RECORD_METHOD(uint64_t, SBThread, GetStopReasonDataAtIndex, (uint32_t), + idx); + std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -271,6 +299,9 @@ uint64_t SBThread::GetStopReasonDataAtIndex(uint32_t idx) { } bool SBThread::GetStopReasonExtendedInfoAsJSON(lldb::SBStream &stream) { + LLDB_RECORD_METHOD(bool, SBThread, GetStopReasonExtendedInfoAsJSON, + (lldb::SBStream &), stream); + Stream &strm = stream.ref(); std::unique_lock<std::recursive_mutex> lock; @@ -291,6 +322,10 @@ bool SBThread::GetStopReasonExtendedInfoAsJSON(lldb::SBStream &stream) { SBThreadCollection SBThread::GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type) { + LLDB_RECORD_METHOD(lldb::SBThreadCollection, SBThread, + GetStopReasonExtendedBacktraces, + (lldb::InstrumentationRuntimeType), type); + ThreadCollectionSP threads; threads = std::make_shared<ThreadCollection>(); @@ -298,20 +333,23 @@ SBThread::GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type) { ExecutionContext exe_ctx(m_opaque_sp.get(), lock); if (!exe_ctx.HasThreadScope()) - return threads; + return LLDB_RECORD_RESULT(threads); ProcessSP process_sp = exe_ctx.GetProcessSP(); StopInfoSP stop_info = exe_ctx.GetThreadPtr()->GetStopInfo(); StructuredData::ObjectSP info = stop_info->GetExtendedInfo(); if (!info) - return threads; + return LLDB_RECORD_RESULT(threads); - return process_sp->GetInstrumentationRuntime(type) - ->GetBacktracesFromExtendedStopInfo(info); + return LLDB_RECORD_RESULT(process_sp->GetInstrumentationRuntime(type) + ->GetBacktracesFromExtendedStopInfo(info)); } size_t SBThread::GetStopDescription(char *dst, size_t dst_len) { + LLDB_RECORD_METHOD(size_t, SBThread, GetStopDescription, (char *, size_t), + dst, dst_len); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; @@ -423,6 +461,8 @@ size_t SBThread::GetStopDescription(char *dst, size_t dst_len) { } SBValue SBThread::GetStopReturnValue() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBValue, SBThread, GetStopReturnValue); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); ValueObjectSP return_valobj_sp; std::unique_lock<std::recursive_mutex> lock; @@ -449,7 +489,7 @@ SBValue SBThread::GetStopReturnValue() { return_valobj_sp.get() ? return_valobj_sp->GetValueAsCString() : "<no return value>"); - return SBValue(return_valobj_sp); + return LLDB_RECORD_RESULT(SBValue(return_valobj_sp)); } void SBThread::SetThread(const ThreadSP &lldb_object_sp) { @@ -457,6 +497,8 @@ void SBThread::SetThread(const ThreadSP &lldb_object_sp) { } lldb::tid_t SBThread::GetThreadID() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::tid_t, SBThread, GetThreadID); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); if (thread_sp) return thread_sp->GetID(); @@ -464,6 +506,8 @@ lldb::tid_t SBThread::GetThreadID() const { } uint32_t SBThread::GetIndexID() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(uint32_t, SBThread, GetIndexID); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); if (thread_sp) return thread_sp->GetIndexID(); @@ -471,6 +515,8 @@ uint32_t SBThread::GetIndexID() const { } const char *SBThread::GetName() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetName); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); const char *name = NULL; std::unique_lock<std::recursive_mutex> lock; @@ -496,6 +542,8 @@ const char *SBThread::GetName() const { } const char *SBThread::GetQueueName() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBThread, GetQueueName); + const char *name = NULL; std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -521,6 +569,8 @@ const char *SBThread::GetQueueName() const { } lldb::queue_id_t SBThread::GetQueueID() const { + LLDB_RECORD_METHOD_CONST_NO_ARGS(lldb::queue_id_t, SBThread, GetQueueID); + queue_id_t id = LLDB_INVALID_QUEUE_ID; std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -545,6 +595,9 @@ lldb::queue_id_t SBThread::GetQueueID() const { } bool SBThread::GetInfoItemByPathAsString(const char *path, SBStream &strm) { + LLDB_RECORD_METHOD(bool, SBThread, GetInfoItemByPathAsString, + (const char *, lldb::SBStream &), path, strm); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); bool success = false; std::unique_lock<std::recursive_mutex> lock; @@ -634,11 +687,17 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx, } void SBThread::StepOver(lldb::RunMode stop_other_threads) { + LLDB_RECORD_METHOD(void, SBThread, StepOver, (lldb::RunMode), + stop_other_threads); + SBError error; // Ignored StepOver(stop_other_threads, error); } void SBThread::StepOver(lldb::RunMode stop_other_threads, SBError &error) { + LLDB_RECORD_METHOD(void, SBThread, StepOver, (lldb::RunMode, lldb::SBError &), + stop_other_threads, error); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; @@ -676,17 +735,27 @@ void SBThread::StepOver(lldb::RunMode stop_other_threads, SBError &error) { } void SBThread::StepInto(lldb::RunMode stop_other_threads) { + LLDB_RECORD_METHOD(void, SBThread, StepInto, (lldb::RunMode), + stop_other_threads); + StepInto(NULL, stop_other_threads); } void SBThread::StepInto(const char *target_name, lldb::RunMode stop_other_threads) { + LLDB_RECORD_METHOD(void, SBThread, StepInto, (const char *, lldb::RunMode), + target_name, stop_other_threads); + SBError error; // Ignored StepInto(target_name, LLDB_INVALID_LINE_NUMBER, error, stop_other_threads); } void SBThread::StepInto(const char *target_name, uint32_t end_line, SBError &error, lldb::RunMode stop_other_threads) { + LLDB_RECORD_METHOD(void, SBThread, StepInto, + (const char *, uint32_t, lldb::SBError &, lldb::RunMode), + target_name, end_line, error, stop_other_threads); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; @@ -741,11 +810,15 @@ void SBThread::StepInto(const char *target_name, uint32_t end_line, } void SBThread::StepOut() { + LLDB_RECORD_METHOD_NO_ARGS(void, SBThread, StepOut); + SBError error; // Ignored StepOut(error); } void SBThread::StepOut(SBError &error) { + LLDB_RECORD_METHOD(void, SBThread, StepOut, (lldb::SBError &), error); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; @@ -778,11 +851,17 @@ void SBThread::StepOut(SBError &error) { } void SBThread::StepOutOfFrame(SBFrame &sb_frame) { + LLDB_RECORD_METHOD(void, SBThread, StepOutOfFrame, (lldb::SBFrame &), + sb_frame); + SBError error; // Ignored StepOutOfFrame(sb_frame, error); } void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) { + LLDB_RECORD_METHOD(void, SBThread, StepOutOfFrame, + (lldb::SBFrame &, lldb::SBError &), sb_frame, error); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; @@ -835,11 +914,16 @@ void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) { } void SBThread::StepInstruction(bool step_over) { + LLDB_RECORD_METHOD(void, SBThread, StepInstruction, (bool), step_over); + SBError error; // Ignored StepInstruction(step_over, error); } void SBThread::StepInstruction(bool step_over, SBError &error) { + LLDB_RECORD_METHOD(void, SBThread, StepInstruction, (bool, lldb::SBError &), + step_over, error); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; @@ -866,11 +950,16 @@ void SBThread::StepInstruction(bool step_over, SBError &error) { } void SBThread::RunToAddress(lldb::addr_t addr) { + LLDB_RECORD_METHOD(void, SBThread, RunToAddress, (lldb::addr_t), addr); + SBError error; // Ignored RunToAddress(addr, error); } void SBThread::RunToAddress(lldb::addr_t addr, SBError &error) { + LLDB_RECORD_METHOD(void, SBThread, RunToAddress, + (lldb::addr_t, lldb::SBError &), addr, error); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; @@ -904,6 +993,10 @@ void SBThread::RunToAddress(lldb::addr_t addr, SBError &error) { SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, lldb::SBFileSpec &sb_file_spec, uint32_t line) { + LLDB_RECORD_METHOD(lldb::SBError, SBThread, StepOverUntil, + (lldb::SBFrame &, lldb::SBFileSpec &, uint32_t), sb_frame, + sb_file_spec, line); + SBError sb_error; Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); char path[PATH_MAX]; @@ -930,7 +1023,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, if (line == 0) { sb_error.SetErrorString("invalid line argument"); - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } if (!frame_sp) { @@ -942,7 +1035,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, SymbolContext frame_sc; if (!frame_sp) { sb_error.SetErrorString("no valid frames in thread to step"); - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } // If we have a frame, get its line @@ -953,7 +1046,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, if (frame_sc.comp_unit == NULL) { sb_error.SetErrorStringWithFormat( "frame %u doesn't have debug information", frame_sp->GetFrameIndex()); - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } FileSpec step_file_spec; @@ -965,7 +1058,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, step_file_spec = frame_sc.line_entry.file; else { sb_error.SetErrorString("invalid file argument or no file for frame"); - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } } @@ -1025,15 +1118,23 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame, } else { sb_error.SetErrorString("this SBThread object is invalid"); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } SBError SBThread::StepUsingScriptedThreadPlan(const char *script_class_name) { - return StepUsingScriptedThreadPlan(script_class_name, true); + LLDB_RECORD_METHOD(lldb::SBError, SBThread, StepUsingScriptedThreadPlan, + (const char *), script_class_name); + + return LLDB_RECORD_RESULT( + StepUsingScriptedThreadPlan(script_class_name, true)); } SBError SBThread::StepUsingScriptedThreadPlan(const char *script_class_name, bool resume_immediately) { + LLDB_RECORD_METHOD(lldb::SBError, SBThread, StepUsingScriptedThreadPlan, + (const char *, bool), script_class_name, + resume_immediately); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBError error; @@ -1047,7 +1148,7 @@ SBError SBThread::StepUsingScriptedThreadPlan(const char *script_class_name, if (!exe_ctx.HasThreadScope()) { error.SetErrorString("this SBThread object is invalid"); - return error; + return LLDB_RECORD_RESULT(error); } Thread *thread = exe_ctx.GetThreadPtr(); @@ -1057,21 +1158,24 @@ SBError SBThread::StepUsingScriptedThreadPlan(const char *script_class_name, if (new_plan_status.Fail()) { error.SetErrorString(new_plan_status.AsCString()); - return error; + return LLDB_RECORD_RESULT(error); } if (!resume_immediately) - return error; + return LLDB_RECORD_RESULT(error); if (new_plan_status.Success()) error = ResumeNewPlan(exe_ctx, new_plan_sp.get()); else error.SetErrorString(new_plan_status.AsCString()); - return error; + return LLDB_RECORD_RESULT(error); } SBError SBThread::JumpToLine(lldb::SBFileSpec &file_spec, uint32_t line) { + LLDB_RECORD_METHOD(lldb::SBError, SBThread, JumpToLine, + (lldb::SBFileSpec &, uint32_t), file_spec, line); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBError sb_error; @@ -1085,17 +1189,20 @@ SBError SBThread::JumpToLine(lldb::SBFileSpec &file_spec, uint32_t line) { if (!exe_ctx.HasThreadScope()) { sb_error.SetErrorString("this SBThread object is invalid"); - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } Thread *thread = exe_ctx.GetThreadPtr(); Status err = thread->JumpToLine(file_spec.get(), line, true); sb_error.SetError(err); - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } SBError SBThread::ReturnFromFrame(SBFrame &frame, SBValue &return_value) { + LLDB_RECORD_METHOD(lldb::SBError, SBThread, ReturnFromFrame, + (lldb::SBFrame &, lldb::SBValue &), frame, return_value); + SBError sb_error; Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); @@ -1114,10 +1221,13 @@ SBError SBThread::ReturnFromFrame(SBFrame &frame, SBValue &return_value) { thread->ReturnFromFrame(frame.GetFrameSP(), return_value.GetSP())); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } SBError SBThread::UnwindInnermostExpression() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBError, SBThread, + UnwindInnermostExpression); + SBError sb_error; Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); @@ -1136,15 +1246,19 @@ SBError SBThread::UnwindInnermostExpression() { thread->SetSelectedFrameByIndex(0, false); } - return sb_error; + return LLDB_RECORD_RESULT(sb_error); } bool SBThread::Suspend() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBThread, Suspend); + SBError error; // Ignored return Suspend(error); } bool SBThread::Suspend(SBError &error) { + LLDB_RECORD_METHOD(bool, SBThread, Suspend, (lldb::SBError &), error); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1170,11 +1284,15 @@ bool SBThread::Suspend(SBError &error) { } bool SBThread::Resume() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBThread, Resume); + SBError error; // Ignored return Resume(error); } bool SBThread::Resume(SBError &error) { + LLDB_RECORD_METHOD(bool, SBThread, Resume, (lldb::SBError &), error); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1201,6 +1319,8 @@ bool SBThread::Resume(SBError &error) { } bool SBThread::IsSuspended() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBThread, IsSuspended); + std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1210,6 +1330,8 @@ bool SBThread::IsSuspended() { } bool SBThread::IsStopped() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBThread, IsStopped); + std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1219,6 +1341,8 @@ bool SBThread::IsStopped() { } SBProcess SBThread::GetProcess() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBProcess, SBThread, GetProcess); + SBProcess sb_process; std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1239,10 +1363,12 @@ SBProcess SBThread::GetProcess() { frame_desc_strm.GetData()); } - return sb_process; + return LLDB_RECORD_RESULT(sb_process); } uint32_t SBThread::GetNumFrames() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBThread, GetNumFrames); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); uint32_t num_frames = 0; @@ -1268,6 +1394,8 @@ uint32_t SBThread::GetNumFrames() { } SBFrame SBThread::GetFrameAtIndex(uint32_t idx) { + LLDB_RECORD_METHOD(lldb::SBFrame, SBThread, GetFrameAtIndex, (uint32_t), idx); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBFrame sb_frame; @@ -1296,10 +1424,12 @@ SBFrame SBThread::GetFrameAtIndex(uint32_t idx) { static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData()); } - return sb_frame; + return LLDB_RECORD_RESULT(sb_frame); } lldb::SBFrame SBThread::GetSelectedFrame() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBFrame, SBThread, GetSelectedFrame); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBFrame sb_frame; @@ -1328,10 +1458,13 @@ lldb::SBFrame SBThread::GetSelectedFrame() { static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData()); } - return sb_frame; + return LLDB_RECORD_RESULT(sb_frame); } lldb::SBFrame SBThread::SetSelectedFrame(uint32_t idx) { + LLDB_RECORD_METHOD(lldb::SBFrame, SBThread, SetSelectedFrame, (uint32_t), + idx); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); SBFrame sb_frame; @@ -1363,32 +1496,52 @@ lldb::SBFrame SBThread::SetSelectedFrame(uint32_t idx) { static_cast<void *>(exe_ctx.GetThreadPtr()), idx, static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData()); } - return sb_frame; + return LLDB_RECORD_RESULT(sb_frame); } bool SBThread::EventIsThreadEvent(const SBEvent &event) { + LLDB_RECORD_STATIC_METHOD(bool, SBThread, EventIsThreadEvent, + (const lldb::SBEvent &), event); + return Thread::ThreadEventData::GetEventDataFromEvent(event.get()) != NULL; } SBFrame SBThread::GetStackFrameFromEvent(const SBEvent &event) { - return Thread::ThreadEventData::GetStackFrameFromEvent(event.get()); + LLDB_RECORD_STATIC_METHOD(lldb::SBFrame, SBThread, GetStackFrameFromEvent, + (const lldb::SBEvent &), event); + + return LLDB_RECORD_RESULT( + Thread::ThreadEventData::GetStackFrameFromEvent(event.get())); } SBThread SBThread::GetThreadFromEvent(const SBEvent &event) { - return Thread::ThreadEventData::GetThreadFromEvent(event.get()); + LLDB_RECORD_STATIC_METHOD(lldb::SBThread, SBThread, GetThreadFromEvent, + (const lldb::SBEvent &), event); + + return LLDB_RECORD_RESULT( + Thread::ThreadEventData::GetThreadFromEvent(event.get())); } bool SBThread::operator==(const SBThread &rhs) const { + LLDB_RECORD_METHOD_CONST(bool, SBThread, operator==,(const lldb::SBThread &), + rhs); + return m_opaque_sp->GetThreadSP().get() == rhs.m_opaque_sp->GetThreadSP().get(); } bool SBThread::operator!=(const SBThread &rhs) const { + LLDB_RECORD_METHOD_CONST(bool, SBThread, operator!=,(const lldb::SBThread &), + rhs); + return m_opaque_sp->GetThreadSP().get() != rhs.m_opaque_sp->GetThreadSP().get(); } bool SBThread::GetStatus(SBStream &status) const { + LLDB_RECORD_METHOD_CONST(bool, SBThread, GetStatus, (lldb::SBStream &), + status); + Stream &strm = status.ref(); std::unique_lock<std::recursive_mutex> lock; @@ -1403,10 +1556,16 @@ bool SBThread::GetStatus(SBStream &status) const { } bool SBThread::GetDescription(SBStream &description) const { - return GetDescription(description, false); + LLDB_RECORD_METHOD_CONST(bool, SBThread, GetDescription, (lldb::SBStream &), + description); + + return GetDescription(description, false); } bool SBThread::GetDescription(SBStream &description, bool stop_format) const { + LLDB_RECORD_METHOD_CONST(bool, SBThread, GetDescription, + (lldb::SBStream &, bool), description, stop_format); + Stream &strm = description.ref(); std::unique_lock<std::recursive_mutex> lock; @@ -1425,6 +1584,9 @@ bool SBThread::GetDescription(SBStream &description, bool stop_format) const { } SBThread SBThread::GetExtendedBacktraceThread(const char *type) { + LLDB_RECORD_METHOD(lldb::SBThread, SBThread, GetExtendedBacktraceThread, + (const char *), type); + Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API)); std::unique_lock<std::recursive_mutex> lock; ExecutionContext exe_ctx(m_opaque_sp.get(), lock); @@ -1475,10 +1637,13 @@ SBThread SBThread::GetExtendedBacktraceThread(const char *type) { log->Printf("SBThread(%p)::GetExtendedBacktraceThread() is not returning a " "Valid thread", static_cast<void *>(exe_ctx.GetThreadPtr())); - return sb_origin_thread; + return LLDB_RECORD_RESULT(sb_origin_thread); } uint32_t SBThread::GetExtendedBacktraceOriginatingIndexID() { + LLDB_RECORD_METHOD_NO_ARGS(uint32_t, SBThread, + GetExtendedBacktraceOriginatingIndexID); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); if (thread_sp) return thread_sp->GetExtendedBacktraceOriginatingIndexID(); @@ -1486,20 +1651,30 @@ uint32_t SBThread::GetExtendedBacktraceOriginatingIndexID() { } SBValue SBThread::GetCurrentException() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBValue, SBThread, GetCurrentException); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); - if (!thread_sp) return SBValue(); + if (!thread_sp) + return LLDB_RECORD_RESULT(SBValue()); - return SBValue(thread_sp->GetCurrentException()); + return LLDB_RECORD_RESULT(SBValue(thread_sp->GetCurrentException())); } SBThread SBThread::GetCurrentExceptionBacktrace() { + LLDB_RECORD_METHOD_NO_ARGS(lldb::SBThread, SBThread, + GetCurrentExceptionBacktrace); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); - if (!thread_sp) return SBThread(); + if (!thread_sp) + return LLDB_RECORD_RESULT(SBThread()); - return SBThread(thread_sp->GetCurrentExceptionBacktrace()); + return LLDB_RECORD_RESULT( + SBThread(thread_sp->GetCurrentExceptionBacktrace())); } bool SBThread::SafeToCallFunctions() { + LLDB_RECORD_METHOD_NO_ARGS(bool, SBThread, SafeToCallFunctions); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); if (thread_sp) return thread_sp->SafeToCallFunctions(); @@ -1507,6 +1682,8 @@ bool SBThread::SafeToCallFunctions() { } lldb_private::Thread *SBThread::operator->() { + LLDB_RECORD_METHOD_NO_ARGS(lldb_private::Thread *, SBThread, operator->); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); if (thread_sp) return thread_sp.get(); @@ -1515,6 +1692,8 @@ lldb_private::Thread *SBThread::operator->() { } lldb_private::Thread *SBThread::get() { + LLDB_RECORD_METHOD_NO_ARGS(lldb_private::Thread *, SBThread, get); + ThreadSP thread_sp(m_opaque_sp->GetThreadSP()); if (thread_sp) return thread_sp.get(); |