[Lldb-commits] [lldb] [lldb-dap] Add memory history in ASan report (PR #183740)

John Harrison via lldb-commits lldb-commits at lists.llvm.org
Fri Feb 27 08:58:41 PST 2026


================
@@ -231,6 +231,25 @@ static std::string FormatExtendedStopInfo(lldb::SBThread &thread) {
   // Check if we can improve the formatting of the raw JSON report.
   if (report) {
     OS << *report;
+    std::visit(
+        [&](auto &&report) {
+          using T = std::decay_t<decltype(report)>;
+          if constexpr (std::is_same_v<T, ASanReport>) {
+            lldb::addr_t address = report.address;
+            lldb::SBProcess process = thread.GetProcess();
+            lldb::SBThreadCollection history_threads =
+                process.GetHistoryThreads(address);
+            lldb::SBStream stream;
+            OS << "Memory history associated with addres: 0x"
+               << llvm::utohexstr(address) << "\n";
+            for (const auto history_thread : history_threads) {
+              if (history_thread.GetStatus(stream))
+                OS << stream << "\n";
+              stream.Clear();
+            }
+          }
----------------
ashgti wrote:

Do we need an `else OS << *report;`?

https://github.com/llvm/llvm-project/pull/183740


More information about the lldb-commits mailing list