This is an archive of the discontinued LLVM Phabricator instance.

[debug-info] Emit DW_AT_byte_size for non-default pointer/reference types
AcceptedPublic

Authored by arichardson on Mar 26 2021, 4:10 AM.

Details

Summary

In the CHERI and Arm Morello targets we support a compilation mode that
has multiple pointer sizes (32/64-bit integers as well as capabilities that are
twice that size). In order to support this in the debugger we emit
DW_AT_byte_size for pointer and reference types if their size is different
from the target's pointer size for the alloca address space.

This patch found the pointer size mismatch that I fixed in D99410.

Diff Detail

Event Timeline

arichardson created this revision.Mar 26 2021, 4:10 AM
arichardson edited the summary of this revision. (Show Details)Apr 19 2021, 7:30 AM
arichardson added reviewers: bsdjhb, aprantl, dblaikie.
  • update test
arichardson published this revision for review.Jul 2 2021, 2:11 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 2 2021, 2:11 AM
dblaikie accepted this revision.Jul 2 2021, 1:34 PM

Sounds OK to me - I'm not 100% sure that's the right address size check to do, but if it works for you, sounds OK to me.

This revision is now accepted and ready to land.Jul 2 2021, 1:34 PM
jrtc27 added a comment.Jul 2 2021, 1:41 PM

Sounds OK to me - I'm not 100% sure that's the right address size check to do, but if it works for you, sounds OK to me.

Yeah, LLVM suffers from having lots of granularity with no notion of a default address space... for us they're all (program, alloca, globals) the same

llvm/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
771–777

Hm, this doesn't really accurately reflect what's happening, but the same is true of the existing comment... maybe something like this?