[Lldb-commits] [lldb] r252252 - Upstream a change to MemoryHistoryASan from Sean:

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Thu Nov 5 16:43:31 PST 2015


Author: jmolenda
Date: Thu Nov  5 18:43:31 2015
New Revision: 252252

URL: http://llvm.org/viewvc/llvm-project?rev=252252&view=rev
Log:
Upstream a change to MemoryHistoryASan from Sean:

Author: Sean Callanan <scallanan at 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>


Modified:
    lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp

Modified: lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp?rev=252252&r1=252251&r2=252252&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp (original)
+++ lldb/trunk/source/Plugins/MemoryHistory/asan/MemoryHistoryASan.cpp Thu Nov  5 18:43:31 2015
@@ -102,14 +102,23 @@ static void CreateHistoryThreadFromValue
     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++)




More information about the lldb-commits mailing list