[Lldb-commits] [lldb] [LLDB] Warn about truncated DWARF section names on Windows (PR #145175)

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Sat Jun 21 11:24:28 PDT 2025


================
@@ -1071,6 +1078,16 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
       m_sections_up->AddSection(section_sp);
       unified_section_list.AddSection(section_sp);
     }
+
+    if (!truncated_dwarf_sections.empty()) {
+      module_sp->ReportWarning(
+          "contains {} truncated DWARF sections ({}).\n"
+          "Note: Executable images on Windows can't include the required names "
+          "when linking with the default link.exe. A third party linker like "
+          "lld-link is required (compile with -fuse-ld=lld-link on Clang).",
+          truncated_dwarf_sections.size(),
+          llvm::join(truncated_dwarf_sections, ", "));
+    }
----------------
JDevlieghere wrote:

I would drop the "Note:" prefix as we have a separate mechanism for notes and here we're reporting a warning, which would be confusing, for example if an IDE decides to highlight this with a yellow background or something (and notes are highlighted differently). 
```suggestion
    if (!truncated_dwarf_sections.empty())
      module_sp->ReportWarning(
          "contains {} truncated DWARF sections ({}).\n"
          "Executable images on Windows can't include the required names "
          "when linking with the default link.exe. A third party linker like "
          "lld-link is required (compile with -fuse-ld=lld-link on Clang).",
          truncated_dwarf_sections.size(),
          llvm::join(truncated_dwarf_sections, ", "));
```

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


More information about the lldb-commits mailing list