Upstream a change to MemoryHistoryASan from Sean:

Author: Sean Callanan <scallanan@apple.com>
Date:   Tue Jun 23 13:52:24 2015 -0700

    Memory history should not crash if it can't inspect its data.  Added
    error handling.
            
    <rdar://problem/21231304>

llvm-svn: 252252
This commit is contained in:
Jason Molenda 2015-11-06 00:43:31 +00:00
parent 5e88be9f8c
commit 313a018bec
1 changed files with 11 additions and 2 deletions

View File

@ -102,14 +102,23 @@ static void CreateHistoryThreadFromValueObject(ProcessSP process_sp, ValueObject
std::string count_path = "." + std::string(type) + "_count";
std::string tid_path = "." + std::string(type) + "_tid";
std::string trace_path = "." + std::string(type) + "_trace";
ValueObjectSP count_sp = return_value_sp->GetValueForExpressionPath(count_path.c_str());
ValueObjectSP tid_sp = return_value_sp->GetValueForExpressionPath(tid_path.c_str());
if (!count_sp || !tid_sp)
return;
int count = return_value_sp->GetValueForExpressionPath(count_path.c_str())->GetValueAsUnsigned(0);
tid_t tid = return_value_sp->GetValueForExpressionPath(tid_path.c_str())->GetValueAsUnsigned(0);
int count = count_sp->GetValueAsUnsigned(0);
tid_t tid = tid_sp->GetValueAsUnsigned(0);
if (count <= 0)
return;
ValueObjectSP trace_sp = return_value_sp->GetValueForExpressionPath(trace_path.c_str());
if (!trace_sp)
return;
std::vector<lldb::addr_t> pcs;
for (int i = 0; i < count; i++)