This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Fix emitting offsets to CUs with -dwarf-sections-as-references=Enable.
ClosedPublic

Authored by ikudrin on Jun 22 2020, 9:31 AM.

Details

Summary

The size of the field depends on the DWARF format, not the address size of the target.

Diff Detail

Event Timeline

ikudrin created this revision.Jun 22 2020, 9:31 AM
jhenderson accepted this revision.Jun 22 2020, 11:57 PM

LGTM. I'm rather surprised this hasn't been picked up before now, given it would generate invalid debug information. Perhaps this indicates the option is never used?

This revision is now accepted and ready to land.Jun 22 2020, 11:57 PM

The problematic code path is performed only when generating .debug_pub* or .debug_aranges sections when the option is set to Enabled, but as it was stated in D43943, where the option was added, it was intended only for cases, when these sections are omitted/ignored. Nevertheless, the common code should be correct as its usage might be extended in the future.

The problematic code path is performed only when generating .debug_pub* or .debug_aranges sections when the option is set to Enabled, but as it was stated in D43943, where the option was added, it was intended only for cases, when these sections are omitted/ignored. Nevertheless, the common code should be correct as its usage might be extended in the future.

Great, thanks for the explanation!

This revision was automatically updated to reflect the committed changes.