This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Add Arm64 CodeView to LLDB regnum mapping
ClosedPublic

Authored by omjavaid on Jun 20 2022, 1:11 PM.

Details

Summary

This patch writes a mapping structure for converting CodeView Arm64 register numbers to LLDB Arm64 regnums.

This fixes various symbols and variable location test failures on AArch64/Windows.

Diff Detail

Event Timeline

omjavaid created this revision.Jun 20 2022, 1:11 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 20 2022, 1:11 PM
omjavaid requested review of this revision.Jun 20 2022, 1:11 PM
DavidSpickett added a subscriber: DavidSpickett.

Are there public docs for these numbers?

Are there public docs for these numbers?

There is no public doc but I have copied these mappings from https://github.com/microsoft/microsoft-pdb which was opensourced by microsoft. Also cross checked with mapping available at llvm/include/llvm/DebugInfo/CodeView/CodeViewRegisters.def

DavidSpickett added inline comments.Jun 27 2022, 3:08 AM
lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.cpp
51

Is there a reason W29/W30/WZR are missing here?

88

ARM64_ZR here? Though they're the same encoding in the instructions so it probably doesn't change much.

omjavaid added inline comments.Jun 28 2022, 5:58 AM
lldb/source/Plugins/SymbolFile/NativePDB/CodeViewRegisterMapping.cpp
51

So this is mapping between LLDB and CodeView register numbering. LLDB register numbering ignores W29, W30 and WZR in favor of FP, LR and SP. Ref ./lldb/source/Plugins/Process/Utility/RegisterInfos_arm64.h

88

Here again LLDB register numbering considers GPR 31 as SP although AARM suggest it can be used as ZR. hence the choice of LLDB specific encoding.

This revision is now accepted and ready to land.Jun 29 2022, 1:28 AM
This revision was automatically updated to reflect the committed changes.