This is an archive of the discontinued LLVM Phabricator instance.

[LLDB] Add GetByteOffset to SBValue interface for reading register offset
AbandonedPublic

Authored by omjavaid on Jun 30 2020, 4:32 AM.

Details

Reviewers
labath
rengolin
Summary

This patch adds GetByteOffset to SBValue interface for accessing register offset from register infos. This was needed to write tests to verify that AArch64 register sizes and offsets are updated when a thread updates vector granule register vg. A follow up test will make use of this API to test LLDB SVE register in multithreaded mode with dynamic update of size and offset.

Diff Detail

Event Timeline

omjavaid created this revision.Jun 30 2020, 4:32 AM

The new API looks fairly confusing. This doesn't sound like something that the SB users should generally know or care about. What would the GetByteOffset function return in the generic case?
I don't find the explanation in the summary convincing. Presumably, you should be able to verify the proper behavior by checking the data (and its size) that the SBValue object holds. If that returns the right thing, who cares about the value of the offset field?

The new API looks fairly confusing. This doesn't sound like something that the SB users should generally know or care about. What would the GetByteOffset function return in the generic case?
I don't find the explanation in the summary convincing. Presumably, you should be able to verify the proper behavior by checking the data (and its size) that the SBValue object holds. If that returns the right thing, who cares about the value of the offset field?

This was something which helped during development so I thought about implementing tests based on this but as you highlighted I wasnt sure if there is a proper client for this API function. I am gonna abandon this change and have updated test implementation removed dependence on GetByteOffset.

Sounds good. FWIW, I wouldn't be opposed to some CLI command which would dump some low-level details of the register context, similar to how we have the "target modules dump" command tree for Module objects...

omjavaid abandoned this revision.Feb 22 2021, 1:01 AM