This is an archive of the discontinued LLVM Phabricator instance.

[XCOFF][DWARF] XCOFF64 should be able to select the dwarf format in intergrated-as mode.
ClosedPublic

Authored by Esme on May 9 2023, 1:06 AM.

Details

Summary

DWARF32 is not supported for XCOFF64 under non integrated-as mode, because system assembler will fill the debug section lengths according to DWARF64 format.
While in intergrated-as mode, XCOFF64 should be able to select the DWARF version.

Diff Detail

Event Timeline

Esme created this revision.May 9 2023, 1:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 9 2023, 1:06 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
Esme requested review of this revision.May 9 2023, 1:06 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 9 2023, 1:06 AM
shchenz accepted this revision as: shchenz.May 10 2023, 6:21 PM

I think this is correct. DWARF spec indicates that DWARF64 should not be set as default. So it is right to change to DWARF32 by default for integrated-as mode for XCOFF64.

LGTM with one nit.

llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
412

Nit: Maybe we can use a variable to contain the value for TT.isOSBinFormatXCOFF().

This revision is now accepted and ready to land.May 10 2023, 6:21 PM
Esme updated this revision to Diff 521229.May 11 2023, 1:52 AM

Update test cases.

Esme retitled this revision from [XCOFF][DWARF] XCOFF64 should be able to select the dwarf version under intergrated-as mode. to [XCOFF][DWARF] XCOFF64 should be able to select the dwarf format in intergrated-as mode..May 11 2023, 1:53 AM