This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [ABI] Apply AugmentRegisterInfo() to DynamicRegisterInfo::Registers
ClosedPublic

Authored by mgorny on Oct 5 2021, 6:07 AM.

Details

Summary

Call ABI::AugmentRegisterInfo() once with a vector of all defined
registers rather than calling it for every individual register. Move
and rename RemoteRegisterInfo from gdb-remote to
DynamicRegisterInfo::Register, and use this class when augmenting
registers.

Diff Detail

Event Timeline

mgorny updated this revision to Diff 377186.Oct 5 2021, 6:28 AM

Add one missing call to AugmentRegisterInfo() before Finalize().

mgorny updated this revision to Diff 377538.Oct 6 2021, 7:23 AM
mgorny retitled this revision from [lldb] [ABI] Make AugmentRegisterInfo() take whole DynamicRegisterInfo to [lldb] [ABI] Apply AugmentRegisterInfo() to RemoteRegisterInfos.
mgorny edited the summary of this revision. (Show Details)

Pass a vector of RemoteRegisterInfos instead of DynamicRegisterInfo class.

labath added a comment.Oct 7 2021, 6:08 AM

I like everything except the class name. :)

I don't think it makes sense in the new location, and ideally I'd like to also use this for other plugins in the future (so that e.g. core file plugins don't have to excruciatingly list everything). Maybe we could move it into the the DynamicRegisterInfo class (as the intended use is to convert it to that eventually), and give it some generic name like Register or Descriptor or RegisterDescriptor ?

lldb/include/lldb/Target/DynamicRegisterInfo.h
94–96

What's up with this?

mgorny marked an inline comment as done.Oct 7 2021, 6:42 AM
mgorny added inline comments.
lldb/include/lldb/Target/DynamicRegisterInfo.h
94–96

Probably leftover from the previous version. I need to double-check if no other commit requires that.

mgorny updated this revision to Diff 377831.Oct 7 2021, 6:48 AM
mgorny marked an inline comment as done.
mgorny retitled this revision from [lldb] [ABI] Apply AugmentRegisterInfo() to RemoteRegisterInfos to [lldb] [ABI] Apply AugmentRegisterInfo() to DynamicRegisterInfo::Registers.
mgorny edited the summary of this revision. (Show Details)

Move/rename RemoteRegisterInfo to DynamicRegisterInfo::Register. Remove leftover DRI changes.

labath accepted this revision.Oct 8 2021, 1:09 AM
This revision is now accepted and ready to land.Oct 8 2021, 1:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 11 2021, 8:02 AM