This is an archive of the discontinued LLVM Phabricator instance.

[BOLT][DWARF] Handle zero size DW_TAG_inlined_subroutine
ClosedPublic

Authored by ayermolo on Aug 17 2022, 11:42 AM.

Details

Summary

We were resetting DW_AT_low_pc to zero when DW_AT_high_pc was zero, or
DW_AT_low_pc == DW_AT_high_pc. This resulted in LLDB to print error "adding
range [0x0-0x0) which has a base that is less than the function's low PC".

Changed it so that when this case arises we set DW_AT_low_pc to the start
address.

Diff Detail

Event Timeline

ayermolo created this revision.Aug 17 2022, 11:42 AM
Herald added a reviewer: Amir. · View Herald Transcript
Herald added a reviewer: maksfb. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Herald added subscribers: hoy, modimo, wenlei. · View Herald Transcript
ayermolo requested review of this revision.Aug 17 2022, 11:42 AM
Herald added a project: Restricted Project. · View Herald Transcript
rafauler added inline comments.Aug 17 2022, 3:48 PM
bolt/test/X86/dwarf4-size-0-inlined_subroutine.s
18

If this was manually modified, in these cases it would be helpful to have an extra comment in the modified line, such as "# The following line was manually modified", so it is extra clear

ayermolo updated this revision to Diff 453458.Aug 17 2022, 4:03 PM

Added which line was manually modified.

ayermolo marked an inline comment as done.Aug 17 2022, 4:03 PM
This revision is now accepted and ready to land.Aug 17 2022, 4:32 PM
This revision was automatically updated to reflect the committed changes.