[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


================
@@ -1036,12 +1036,19 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
     m_sections_up->AddSection(header_sp);
     unified_section_list.AddSection(header_sp);
 
+    std::vector<llvm::StringRef> truncated_dwarf_sections;
     const uint32_t nsects = m_sect_headers.size();
     for (uint32_t idx = 0; idx < nsects; ++idx) {
       llvm::StringRef sect_name = GetSectionName(m_sect_headers[idx]);
       ConstString const_sect_name(sect_name);
       SectionType section_type = GetSectionType(sect_name, m_sect_headers[idx]);
 
+      // Detect unknown sections matching ^\.debug_[a-z]$
+      if (section_type == eSectionTypeOther && sect_name.size() == 8 &&
+          sect_name.starts_with(".debug_") && llvm::isLower(sect_name.back())) {
+        truncated_dwarf_sections.emplace_back(sect_name);
+      }
----------------
JDevlieghere wrote:

```suggestion
      if (section_type == eSectionTypeOther && sect_name.size() == 8 &&
          sect_name.starts_with(".debug_") && llvm::isLower(sect_name.back()))
        truncated_dwarf_sections.emplace_back(sect_name);
```

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


More information about the lldb-commits mailing list