From 7ebe9cc4fc2d97ec0ed2a6038be25b2a7ed1aac2 Mon Sep 17 00:00:00 2001 From: Med Ismail Bennani Date: Tue, 4 Feb 2020 17:53:26 +0100 Subject: [lldb/Target] Add Assert StackFrame Recognizer When a thread stops, this checks depending on the platform if the top frame is an abort stack frame. If so, it looks for an assert stack frame in the upper frames and set it as the most relavant frame when found. To do so, the StackFrameRecognizer class holds a "Most Relevant Frame" and a "cooked" stop reason description. When the thread is about to stop, it checks if the current frame is recognized, and if so, it fetches the recognized frame's attributes and applies them. rdar://58528686 Differential Revision: https://reviews.llvm.org/D73303 Signed-off-by: Med Ismail Bennani --- lldb/source/API/SBThread.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lldb/source/API/SBThread.cpp') diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp index 69342b972a2c..a88e8442986d 100644 --- a/lldb/source/API/SBThread.cpp +++ b/lldb/source/API/SBThread.cpp @@ -325,8 +325,11 @@ size_t SBThread::GetStopDescription(char *dst, size_t dst_len) { StopInfoSP stop_info_sp = exe_ctx.GetThreadPtr()->GetStopInfo(); if (stop_info_sp) { - const char *stop_desc = stop_info_sp->GetDescription(); - if (stop_desc) { + std::string thread_stop_desc = + exe_ctx.GetThreadPtr()->GetStopDescription(); + const char *stop_desc = thread_stop_desc.c_str(); + + if (stop_desc[0] != '\0') { if (dst) return ::snprintf(dst, dst_len, "%s", stop_desc); else { -- cgit v1.2.3