[Lldb-commits] [lldb] [lldb] Support list-ing Source Embedded in DWARF (PR #191802)

Will Hawkins via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 13 05:26:04 PDT 2026


https://github.com/hawkinsw updated https://github.com/llvm/llvm-project/pull/191802

>From 78b55d98e0dd8b73383a222bccf3583364d93912 Mon Sep 17 00:00:00 2001
From: Will Hawkins <hawkinsw at obs.cr>
Date: Mon, 13 Apr 2026 07:33:09 -0400
Subject: [PATCH] [lldb] Support list-ing Source Embedded in DWARF

Compiled programs that embed their source code into their debugging
information (using, e.g., DW_LNCT_LLVM_source) should display that
code during debugging sessions.

Fixes #191801
---
 lldb/source/Core/SourceManager.cpp | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index abb5bfb5bcfd5..7aba2e4ccdf4b 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -582,7 +582,12 @@ void SourceManager::File::CommonInitializerImpl(SupportFileNSP support_file_nsp,
 }
 
 void SourceManager::File::SetSupportFile(SupportFileNSP support_file_nsp) {
-  FileSpec file_spec = support_file_nsp->GetSpecOnly();
+  // Use Materialize here to allow for the possibility of support files
+  // that may have special semantics for "generating" a file spec from
+  // a support file (e.g., DWARF with embedded source through
+  // DW_LNCT_LLVM_source).
+  FileSpec file_spec = support_file_nsp->Materialize();
+
   resolve_tilde(file_spec);
   m_support_file_nsp =
       std::make_shared<SupportFile>(file_spec, support_file_nsp->GetChecksum());



More information about the lldb-commits mailing list