[Lldb-commits] [lldb] Add support for inline DWARF source files. (PR #75880)

Alexander M. via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 2 07:17:18 PDT 2024


amordo wrote:

Hi again! Some notes about Win test fail I discovered:

Setting function breakpoints on binary with `-gdwarf-5` on Windows doesn't work; the case is rased https://github.com/llvm/llvm-project/issues/87327

The next analysis was done from repo based on b4001e32b1aa4df07dc6babefba19f2b77f487c6.
During `b f` command this path was executed in `SymbolFileDWARF::ParseFunction()`: 
```
if (lowest_func_addr == LLDB_INVALID_ADDRESS ||
      lowest_func_addr >= highest_func_addr ||
      lowest_func_addr < m_first_code_address)
    return nullptr;
```
particularly `lowest_func_addr < m_first_code_address`.
Analyzing `DWARFDebugInfoEntry::GetAttributeAddressRanges()` and sections loading it was noticed no section was found by type `eSectionTypeDWARFDebugAddr`: `m_sections[idx]->GetType() == sect_type` from `SectionList::FindSectionByType()` wasn't succeeded because section with `debug_addr` name had `eSectionTypeData` type.
I've logged `Dump(stream, 1, nullptr, true, UINT32_MAX);` in `SectionList::FindSectionByType()` and got
```
  SectID     Type             File Address                             Perm File Off.  File Size  Flags      Section Name
 ---------- ---------------- ---------------------------------------  ---- ---------- ---------- ---------- ----------------------------
 0xffffffffffffffff regular          [0x0000000140000000-0x0000000140000600)  r--  0x00000000 0x00000600 0x00000000 a.out.PECOFF header
 0x00000001 code             [0x0000000140001000-0x000000014005d216)  r-x  0x00000600 0x0005c400 0x60000020 a.out..text
 0x00000002 data             [0x000000014005e000-0x000000014006f864)  r--  0x0005ca00 0x00011a00 0x40000040 a.out..rdata
 0x00000003 data             [0x0000000140070000-0x00000001400726c0)  rw-  0x0006e400 0x00000e00 0xc0000040 a.out..data
 0x00000004 data             [0x0000000140073000-0x0000000140077764)  r--  0x0006f200 0x00004800 0x40000040 a.out..pdata
 0x00000005 data             [0x0000000140078000-0x0000000140081f20)  r--  0x00073a00 0x0000a000 0x40000040 a.out..gxfg
 0x00000006 data             [0x0000000140082000-0x00000001400821f4)  r--  0x0007da00 0x00000200 0x40000040 a.out._RDATA
 0x00000007 regular          [0x0000000140083000-0x0000000140083108)  ---  0x0007dc00 0x00000200 0x00000000 a.out.memcpy_
 0x00000008 regular          [0x0000000140084000-0x00000001400847fc)  r--  0x0007de00 0x00000800 0x42000040 a.out..reloc
 0x00000009 dwarf-abbrev     [0x0000000140085000-0x0000000140085098)  r--  0x0007e600 0x00000200 0x42000040 a.out..debug_abbrev
 0x0000000a data             [0x0000000140086000-0x0000000140086028)  r--  0x0007e800 0x00000200 0x42000040 a.out..debug_addr
 0x0000000b dwarf-info       [0x0000000140087000-0x000000014008709c)  r--  0x0007ea00 0x00000200 0x42000040 a.out..debug_info
 0x0000000c dwarf-line       [0x0000000140088000-0x00000001400880db)  r--  0x0007ec00 0x00000200 0x42000040 a.out..debug_line
 0x0000000d data             [0x0000000140089000-0x00000001400891db)  r--  0x0007ee00 0x00000200 0x42000040 a.out..debug_line_str
 0x0000000e dwarf-names      [0x000000014008a000-0x000000014008a050)  r--  0x0007f000 0x00000200 0x42000040 a.out..debug_names
 0x0000000f dwarf-str        [0x000000014008b000-0x000000014008b20a)  r--  0x0007f200 0x00000400 0x42000040 a.out..debug_str
 0x00000010 data             [0x000000014008c000-0x000000014008c048)  r--  0x0007f600 0x00000200 0x42000040 a.out..debug_str_offsets
```  

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


More information about the lldb-commits mailing list