[Lldb-commits] [clang] [lldb] [clang][lldb] Don't assert structure layout correctness for layouts provided by LLDB (PR #93809)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Fri May 31 15:26:05 PDT 2024


Michael137 wrote:

> The correct answer here is probably to fix the sizes in the RecordLayout itself; in particular, the DataSize of the members.

That would be ideal, but also means we'd have to reflect the various C++ attributes that affect layout in DWARF. Avoiding adding such language-specific constructs to DWARF is what partly motivated this patch. 

> We should trust external record layout to the extent that it generates a valid layout, but if it generates something with overlapping fields, or that runs outside the claimed bounds of the type, we'll just end up crashing in IRGen. I assume those things are expressible in DWARF;

Yea the idea was that we catch these malformed DWARF representations elsewhere. Not necessarily relying on the record layout layer to tell us about this. Not sure how equipped LLDB currently is in dealing with corrupted DWARF.


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


More information about the lldb-commits mailing list