This is an archive of the discontinued LLVM Phabricator instance.

[lldb] Fix ppc64 detection in lldb
ClosedPublic

Authored by serge-sans-paille on May 2 2022, 4:53 AM.

Details

Summary

Currently, ppc64le and ppc64 (defaulting to big endian) have the same
descriptor, thus the linear scan always return ppc64le. Handle that through
subtype.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2022, 4:53 AM
serge-sans-paille requested review of this revision.May 2 2022, 4:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2022, 4:53 AM
labath accepted this revision.May 2 2022, 8:56 AM

There were probably easier ways to test this, but it's nice to have the core file nonetheless. LGTM, assuming the core is of a reasonable size.

This revision is now accepted and ready to land.May 2 2022, 8:56 AM
MaskRay accepted this revision.May 2 2022, 9:51 AM
MaskRay added inline comments.
lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
315
328

Move before EM_RISCV for an alphabetical order.

This revision was automatically updated to reflect the committed changes.

I reverted this due to an assert: https://lab.llvm.org/buildbot/#/builders/96/builds/22715/steps/6/logs/stdio (set cmake LLVM_ENABLE_ASSERTIONS to ON)

I think you could just add PowerPC to the if (!reg_interface there but first time looking at the code I'm not sure of the consequences of that.

I reverted this due to an assert: https://lab.llvm.org/buildbot/#/builders/96/builds/22715/steps/6/logs/stdio (set cmake LLVM_ENABLE_ASSERTIONS to ON)

I think you could just add PowerPC to the if (!reg_interface there but first time looking at the code I'm not sure of the consequences of that.

Thanks @DavidSpickett for the revert. I think we need to implement RegisterInfoPOSIX_ppc64 for Linux... I'll investiagte that.

Change the rest case to something that doesn't require me to implement ppc64be corefile support.

serge-sans-paille reopened this revision.May 4 2022, 1:43 PM

@labath does that version look good? I only changed the test.

This revision is now accepted and ready to land.May 4 2022, 1:43 PM
This revision was automatically updated to reflect the committed changes.
labath added a comment.May 9 2022, 1:27 AM

Sure, that's great.