[Lldb-commits] [lldb] 5e3fe22 - [lldb/Reproducers] Refactor GetStopReasonExtendedBacktraces (NFC)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 6 14:02:44 PST 2020


Author: Jonas Devlieghere
Date: 2020-02-06T14:00:09-08:00
New Revision: 5e3fe22c636274d4308400b0c2c9bc533ed0c49b

URL: https://github.com/llvm/llvm-project/commit/5e3fe22c636274d4308400b0c2c9bc533ed0c49b
DIFF: https://github.com/llvm/llvm-project/commit/5e3fe22c636274d4308400b0c2c9bc533ed0c49b.diff

LOG: [lldb/Reproducers] Refactor GetStopReasonExtendedBacktraces (NFC)

Refactore GetStopReasonExtendedBacktraces so that the reproducer macro
is passed an instrumented copy constructor rather than the constructor
taking a ThreadCollectionSP, which is not instrumented.

Added: 
    

Modified: 
    lldb/source/API/SBThread.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index a88e8442986d..0d3dd6d30e52 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -292,14 +292,13 @@ SBThread::GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type) {
                      GetStopReasonExtendedBacktraces,
                      (lldb::InstrumentationRuntimeType), type);
 
-  ThreadCollectionSP threads;
-  threads = std::make_shared<ThreadCollection>();
+  SBThreadCollection threads;
 
   std::unique_lock<std::recursive_mutex> lock;
   ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
 
   if (!exe_ctx.HasThreadScope())
-    return LLDB_RECORD_RESULT(threads);
+    return LLDB_RECORD_RESULT(SBThreadCollection());
 
   ProcessSP process_sp = exe_ctx.GetProcessSP();
 
@@ -308,8 +307,9 @@ SBThread::GetStopReasonExtendedBacktraces(InstrumentationRuntimeType type) {
   if (!info)
     return LLDB_RECORD_RESULT(threads);
 
-  return LLDB_RECORD_RESULT(process_sp->GetInstrumentationRuntime(type)
-                                ->GetBacktracesFromExtendedStopInfo(info));
+  threads = process_sp->GetInstrumentationRuntime(type)
+                ->GetBacktracesFromExtendedStopInfo(info);
+  return LLDB_RECORD_RESULT(threads);
 }
 
 size_t SBThread::GetStopDescription(char *dst, size_t dst_len) {


        


More information about the lldb-commits mailing list