mirror of
https://github.com/intel/llvm.git
synced 2026-01-15 12:25:46 +08:00
Fix segfault when doing thread info on a thread without stop info.
Summary: E.g., if thread 1 hits a breakpoint, then a `thread info` on thread 2 will cause a segfault, since thread 2 will have no stop info (intended behavior?). Reviewers: kubabrecka, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8905 llvm-svn: 234437
This commit is contained in:
@@ -2209,8 +2209,7 @@ Thread::GetDescription (Stream &strm, lldb::DescriptionLevel level, bool print_j
|
||||
strm.Printf("\n");
|
||||
|
||||
StructuredData::ObjectSP thread_info = GetExtendedInfo();
|
||||
StructuredData::ObjectSP stop_info = m_stop_info_sp->GetExtendedInfo();
|
||||
|
||||
|
||||
if (print_json_thread || print_json_stopinfo)
|
||||
{
|
||||
if (thread_info && print_json_thread)
|
||||
@@ -2218,13 +2217,17 @@ Thread::GetDescription (Stream &strm, lldb::DescriptionLevel level, bool print_j
|
||||
thread_info->Dump (strm);
|
||||
strm.Printf("\n");
|
||||
}
|
||||
|
||||
if (stop_info && print_json_stopinfo)
|
||||
|
||||
if (print_json_stopinfo && m_stop_info_sp)
|
||||
{
|
||||
stop_info->Dump (strm);
|
||||
strm.Printf("\n");
|
||||
StructuredData::ObjectSP stop_info = m_stop_info_sp->GetExtendedInfo();
|
||||
if (stop_info)
|
||||
{
|
||||
stop_info->Dump (strm);
|
||||
strm.Printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user