mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 09:31:59 +08:00
[lldb/API] NFC: Reformat and simplify SBThread::GetStopDescription()
Summary: This gets rid of some nesting and of the raw char* variable that caused the memory management bug we hit recently. This commit also removes the fallback code which should trigger when the StopInfo provides no stop description. All currently implemented StopInfos have a `GetDescription()` method that shouldn't return an empty description. Reviewers: JDevlieghere, labath, mib Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D74157
This commit is contained in:
@@ -596,8 +596,12 @@ std::string Thread::GetStopDescription() {
|
||||
std::string Thread::GetStopDescriptionRaw() {
|
||||
StopInfoSP stop_info_sp = GetStopInfo();
|
||||
std::string raw_stop_description;
|
||||
if (stop_info_sp && stop_info_sp->IsValid())
|
||||
if (stop_info_sp && stop_info_sp->IsValid()) {
|
||||
raw_stop_description = stop_info_sp->GetDescription();
|
||||
assert((!raw_stop_description.empty() ||
|
||||
stop_info_sp->GetStopReason() == eStopReasonNone) &&
|
||||
"StopInfo returned an empty description.");
|
||||
}
|
||||
return raw_stop_description;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user