Page MenuHomePhabricator

Show register names in DWARF unwind info.
ClosedPublic

Authored by clayborg on Oct 2 2020, 6:07 PM.

Details

Summary

Register context information was already being passed into the DWARFDebugFrame code that dumps unwind information but it wasn't being used. This change adds the ability to dump registers names of a valid MC register context was passed in and if it knows about the register. Updated the tests to use the newly returned register names.

Diff Detail

Event Timeline

clayborg created this revision.Oct 2 2020, 6:07 PM
Herald added a project: Restricted Project. · View Herald Transcript
clayborg requested review of this revision.Oct 2 2020, 6:08 PM
clayborg updated this revision to Diff 295944.Oct 2 2020, 6:10 PM

Removed a change to DwarfTransformer.cpp that wasn't part of this patch.

clayborg updated this revision to Diff 296018.Oct 3 2020, 8:39 PM

Fix test failures found by harbormaster.

aprantl accepted this revision.Oct 5 2020, 9:39 AM

Nice!

This revision is now accepted and ready to land.Oct 5 2020, 9:39 AM
This revision was landed with ongoing or failed builds.Oct 5 2020, 3:34 PM
This revision was automatically updated to reflect the committed changes.
JamesNagurne added a subscriber: JamesNagurne.EditedOct 6 2020, 2:10 PM

In llvm/test/DebugInfo/dwarfdump-debug-frame-simple.test

Our team maintains a downstream ARM target. The compiler, and indeed llvm-dwarfdump, are not built with the target used to build the object file queried here. Therefore, it does not know to use ESP or EIP and dumps reg4/reg8 instead.
Has any other downstream compiler seen this? I'm not able to access the buildbots right at the moment.

Specifically, here's the output from our lit test run with this change integrated into our downstream build:

llvm/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o: No available targets are compatible with triple "i386-unknown-unknown"
llvm/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o:	file format elf32-i386

.debug_frame contents:

00000000 00000010 ffffffff CIE
  Format:                DWARF32
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 8

  DW_CFA_def_cfa: reg4 +4
  DW_CFA_offset: reg8 -4
  DW_CFA_nop:
  DW_CFA_nop:

I suspect that if we really desire ESP/EIP, the test will need to be excluded when the i386 target is not available.

In llvm/test/DebugInfo/dwarfdump-debug-frame-simple.test

Our team maintains a downstream ARM target. The compiler, and indeed llvm-dwarfdump, are not built with the target used to build the object file queried here. Therefore, it does not know to use ESP or EIP and dumps reg4/reg8 instead.
Has any other downstream compiler seen this? I'm not able to access the buildbots right at the moment.

Specifically, here's the output from our lit test run with this change integrated into our downstream build:

llvm/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o: No available targets are compatible with triple "i386-unknown-unknown"
llvm/test/DebugInfo/Inputs/dwarfdump-test-32bit.elf.o:	file format elf32-i386

.debug_frame contents:

00000000 00000010 ffffffff CIE
  Format:                DWARF32
  Version:               1
  Augmentation:          ""
  Code alignment factor: 1
  Data alignment factor: -4
  Return address column: 8

  DW_CFA_def_cfa: reg4 +4
  DW_CFA_offset: reg8 -4
  DW_CFA_nop:
  DW_CFA_nop:

I suspect that if we really desire ESP/EIP, the test will need to be excluded when the i386 target is not available.

Or this could be switched to a regex that accepts "reg4" or "ESP" or "reg8" or "EIP"?

I made a patch to fix buildbots that don't compile in certain architectures with https://reviews.llvm.org/D88940

I made a patch to fix buildbots that don't compile in certain architectures with https://reviews.llvm.org/D88940

@clayborg Our Flang-AArch64 buildbots have been failing due to this: http://lab.llvm.org:8011/#/builders/34/builds/13. Please, could this be either reverted or the other patch merged? Thanks!

I made a patch to fix buildbots that don't compile in certain architectures with https://reviews.llvm.org/D88940

@clayborg Our Flang-AArch64 buildbots have been failing due to this: http://lab.llvm.org:8011/#/builders/34/builds/13. Please, could this be either reverted or the other patch merged? Thanks!

I didn't see any failures on the llvm buildbots that email me when they fail. The other patch will be merged as soon as accepted. Should be tomorrow morning.

@clayborg Our Flang-AArch64 buildbots have been failing due to this: http://lab.llvm.org:8011/#/builders/34/builds/13. Please, could this be either reverted or the other patch merged? Thanks!

I didn't see any failures on the llvm buildbots that email me when they fail. The other patch will be merged as soon as accepted. Should be tomorrow morning.

Thanks! I think that the buildbot master was restarted recently and hence our worker wasn't able to generate an accurate blamelist. Otherwise everything seems fine.

@clayborg Our Flang-AArch64 buildbots have been failing due to this: http://lab.llvm.org:8011/#/builders/34/builds/13. Please, could this be either reverted or the other patch merged? Thanks!

I didn't see any failures on the llvm buildbots that email me when they fail. The other patch will be merged as soon as accepted. Should be tomorrow morning.

Thanks! I think that the buildbot master was restarted recently and hence our worker wasn't able to generate an accurate blamelist. Otherwise everything seems fine.

Fixed with https://reviews.llvm.org/D88940. Let me know if this fixes things on your end!

@clayborg Our Flang-AArch64 buildbots have been failing due to this: http://lab.llvm.org:8011/#/builders/34/builds/13. Please, could this be either reverted or the other patch merged? Thanks!

I didn't see any failures on the llvm buildbots that email me when they fail. The other patch will be merged as soon as accepted. Should be tomorrow morning.

Thanks! I think that the buildbot master was restarted recently and hence our worker wasn't able to generate an accurate blamelist. Otherwise everything seems fine.

Fixed with https://reviews.llvm.org/D88940. Let me know if this fixes things on your end!

All good, thank you!