[Lldb-commits] [PATCH] Fix segfault when doing `thread info` on a thread without stop info.

Chaoren Lin chaorenl at google.com
Wed Apr 8 14:22:21 PDT 2015


REPOSITORY
  rL LLVM

http://reviews.llvm.org/D8905

Files:
  lldb/trunk/source/Target/Thread.cpp

Index: lldb/trunk/source/Target/Thread.cpp
===================================================================
--- lldb/trunk/source/Target/Thread.cpp
+++ lldb/trunk/source/Target/Thread.cpp
@@ -2209,22 +2209,25 @@
     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)
         {
             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;
     }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8905.23442.patch
Type: text/x-patch
Size: 1052 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150408/a9c9222f/attachment.bin>


More information about the lldb-commits mailing list