diff options
author | Jason Molenda <jmolenda@apple.com> | 2015-11-06 00:43:31 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2015-11-06 00:43:31 +0000 |
commit | 313a018bec6fef9ac6634bd7cce112f4048fa9b7 (patch) | |
tree | 81460d9d471f75eed09a130192085b906212c75f /lldb | |
parent | 5e88be9f8c0ffce84d04d2c633d3b9d105bdbb54 (diff) | |
download | bcm5719-llvm-313a018bec6fef9ac6634bd7cce112f4048fa9b7.tar.gz bcm5719-llvm-313a018bec6fef9ac6634bd7cce112f4048fa9b7.zip |
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
Diffstat (limited to 'lldb')
-rw-r--r-- | lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp index 13bd26d407b..c5751987162 100644 --- a/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp +++ b/lldb/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp @@ -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++) |