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 | 7403c8bd0ac9eccf9fcd9bf18b268a7e284d357e (patch) | |
tree | 9d30efd21ebcf7f27ed309efa4d17f082c67ccf0 /lldb/source/Plugins/MemoryHistory | |
parent | d3f902fa7121147a579cf5f6d3ece4b82b433db3 (diff) |
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>
Diffstat (limited to 'lldb/source/Plugins/MemoryHistory')
-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++) |