This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Handle DIE with DW_AT_low_pc and empty ranges
ClosedPublic

Authored by ayermolo on Jun 15 2022, 11:34 AM.

Details

Summary

The case comes out of how BOLT handles transformation of
DW_AT_low_pc/DW_AT_high_pc into DW_AT_low_pc/DW_AT_high_pc
with latter being 0.

Diff Detail

Event Timeline

ayermolo created this revision.Jun 15 2022, 11:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 15 2022, 11:34 AM
Herald added subscribers: hoy, modimo, wenlei. · View Herald Transcript
ayermolo requested review of this revision.Jun 15 2022, 11:34 AM
Herald added a project: Restricted Project. · View Herald Transcript
clayborg accepted this revision.Jun 16 2022, 10:52 AM
This revision is now accepted and ready to land.Jun 16 2022, 10:52 AM
This revision was automatically updated to reflect the committed changes.

I've reverted this due to failures on our bots: https://lab.llvm.org/buildbot/#/builders/96/builds/25032/steps/6/logs/stdio

/usr/bin/ld: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/Commands/Output/dwarf5-low-pc-ranges-inlining.test.tmp.dir/main5.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/Commands/Output/dwarf5-low-pc-ranges-inlining.test.tmp.dir/main5.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

I think that the system ld is expecting an AArch64 format object here. Perhaps you could use lld instead given that we always build that when running the lldb tests?

Also I'm pretty sure you'll need to require the x86 target in llvm as well. The test will fail if this is an AArch64 target only build for example.

I've reverted this due to failures on our bots: https://lab.llvm.org/buildbot/#/builders/96/builds/25032/steps/6/logs/stdio

/usr/bin/ld: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/Commands/Output/dwarf5-low-pc-ranges-inlining.test.tmp.dir/main5.o: Relocations in generic ELF (EM: 62)
/usr/bin/ld: /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/test/Shell/Commands/Output/dwarf5-low-pc-ranges-inlining.test.tmp.dir/main5.o: error adding symbols: file in wrong format
collect2: error: ld returned 1 exit status

I think that the system ld is expecting an AArch64 format object here. Perhaps you could use lld instead given that we always build that when running the lldb tests?

Also I'm pretty sure you'll need to require the x86 target in llvm as well. The test will fail if this is an AArch64 target only build for example.

Ah thanks. Will make changes.

labath added a subscriber: labath.Jun 23 2022, 11:55 PM

It should be sufficient to replace the %clang line with the appropriate ld.lld equivalent, and replace REQUIRES: system-linux with REQUIRES: lld.

Also it test/Shell/SymbolFile/DWARF would be a better place for this test (and it also includes some tests that you can take inspiration from).