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

via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 13 05:12:56 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Will Hawkins (hawkinsw)

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/191802.diff


1 Files Affected:

- (modified) lldb/source/Core/SourceManager.cpp (+5-1) 


``````````diff
diff --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index abb5bfb5bcfd5..7f2f1c80b9853 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -582,7 +582,11 @@ 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());

``````````

</details>


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


More information about the lldb-commits mailing list