This is an archive of the discontinued LLVM Phabricator instance.

[LLDB][Reliability] Fix register value unpacking
ClosedPublic

Authored by fixathon on Jul 21 2022, 2:42 PM.

Details

Summary

Fix incorrect direction for bit-shifting.

Coverity warning 1355603 (scan.coverity.com)

Diff Detail

Event Timeline

fixathon created this revision.Jul 21 2022, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 2:42 PM
fixathon requested review of this revision.Jul 21 2022, 2:42 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 21 2022, 2:42 PM
DavidSpickett accepted this revision.Jul 22 2022, 2:37 AM
DavidSpickett added a subscriber: DavidSpickett.

Thanks!

I'm bothered that no test hit this but I deal with that (it's probably because no instruction you'd need to emulate uses these registers).

This revision is now accepted and ready to land.Jul 22 2022, 2:37 AM

Can we add a test for this?

So I looked into what *should* be testing this and if it was done comprehensively it would have been testing it. However the Arm emulation tests:

  • Don't check D registers directly, only S (which is why we didn't miss the upper 32 bits).
  • Don't verify that memory expected matches memory got (memory is mostly used as an input to registers).
  • Don't specify the final state of memory anyway.

I got some way into fixing that and found ~50 tests that use memory but don't verify the content.

Which is to say, yes this can and should have been tested :)

I will put up some patches shortly to build on this and maybe make the memory checking optional. Then this can be tested, and I'll work towards adding memory checks to the other tests over time.

So hold off on landing while I come up with that.

I've stacked some reviews onto this that end in a new test that covers this change.

This revision was automatically updated to reflect the committed changes.

Thanks for review and for adding unit tests