If a producer emits a nonzero segment size, `lldb` will silently read incorrect values and crash, or do something worse later, as the tuple size is expected to be 2, rather than 3. Neither LLVM, nor GCC produce segmented aranges, but this dangerous case should still be checked and handled.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Change looks good, just needs a test. Should be easy to take a simple binary that has a .debug_aranges, and run obj2yaml on it, and tweak the segment size as needed?
Comment Actions
In this case I think the cleanest solution would be to write a c++ unit test: create a simple debug_aranges header (just hardcode bytes, nothing fancy), pass it to DWARFDebugArangesSet::extract, and check the result.
Comment Actions
I found similar unittests for other DWARF entries which allow me to check more about the parser state, so I went with Pavel's suggestion for the testcase