diff options
author | Edd Dawson <edd.dawson@sony.com> | 2024-07-24 09:07:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-24 09:07:25 +0100 |
commit | 3993a47bb58f7b6da9940d084e62e54a821e81fc (patch) | |
tree | 4580c0a5f133efb1a1108b2f9916cd9b50c2209b /llvm/lib | |
parent | c34d673b02ead039acd107f096c1f32c16b61e07 (diff) | |
download | llvm-3993a47bb58f7b6da9940d084e62e54a821e81fc.zip llvm-3993a47bb58f7b6da9940d084e62e54a821e81fc.tar.gz llvm-3993a47bb58f7b6da9940d084e62e54a821e81fc.tar.bz2 |
[PS4/PS5][Driver][DWARF] Always emit .debug_aranges for SCE tuning (#100160)
Some of SIE's post-mortem analysis infrastructure currently makes use of
.debug_aranges, so we'd like to ensure the section's presence in
PlayStation binaries. The simplest way to do this is to force emission
when the debugger tuning is set to SCE (which is in turn typically
initialized from the target triple). This also simplifies the driver.
llvm/test/DebugInfo/debuglineinfo-path.ll has been marked as UNSUPPORTED
on PlayStation. When aranges are emitted, the DWARF in the test case is
such that relocations need to be applied to the aranges section in order
for symbolization to work. An alternative approach would be to implement
the application of relocations in DWARFDebugArangeSet. While experiments
show that this can be made to work with a modest patch, the test cases
would be rather contrived. Since I expect the only utility for such a
change would be to make this test case pass for PlayStation targets, and
few - if any - outside of PlayStation care about aranges, UNSUPPORTED
would seem to be a more practical option.
This was originally commited as 22eb290a96 (#99629) and later reverted
at 84658fb82b (#99711) due to test failures on SIE built bots. These
failures shouldn't recur due to 3b24e5d450 (#99897) and the
aforementioned change to debuglineinfo-path.ll.
SIE tracker: TOOLCHAIN-16951
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index f886531..5f1f315 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -354,6 +354,9 @@ DwarfDebug::DwarfDebug(AsmPrinter *A) UseLocSection = !TT.isNVPTX(); + // Always emit .debug_aranges for SCE tuning. + UseARangesSection = GenerateARangeSection || tuneForSCE(); + HasAppleExtensionAttributes = tuneForLLDB(); // Handle split DWARF. @@ -1450,7 +1453,7 @@ void DwarfDebug::endModule() { emitDebugInfo(); // Emit info into a debug aranges section. - if (GenerateARangeSection) + if (UseARangesSection) emitDebugARanges(); // Emit info into a debug ranges section. diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h index 452485b..13f4c37 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h @@ -435,6 +435,9 @@ class DwarfDebug : public DebugHandlerBase { ///Allow emission of the .debug_loc section. bool UseLocSection = true; + /// Allow emission of .debug_aranges section + bool UseARangesSection = false; + /// Generate DWARF v4 type units. bool GenerateTypeUnits; |