This is an archive of the discontinued LLVM Phabricator instance.

Move packet construction from GDBRemoteRegisterContext go the communication class
ClosedPublic

Authored by labath on Aug 16 2016, 6:12 AM.

Details

Summary

When saving/restoring registers the GDBRemoteRegisterContext class was manually constructing
the register save/restore packets. This creates appropriate helper functions in
GDBRemoteCommunicationClient, and switches the class to use those. It also removes what a
duplicate packet send in some of those functions, a thing that I can only attribute to a bad
merge artefact.

I also add a test framework for testing gdb-remote client functionality and add tests for the new
functions I introduced. I'd like to be able to test the register context changes in isolation as
well, but currently there doesn't seem to be a way to reasonably construct a standalone register
context object, so we'll have to rely on the end-to-end tests to verify that.

Diff Detail

Repository
rL LLVM

Event Timeline

labath updated this revision to Diff 68169.Aug 16 2016, 6:12 AM
labath retitled this revision from to Move packet construction from GDBRemoteRegisterContext go the communication class.
labath updated this object.
labath added a reviewer: clayborg.
labath added a subscriber: lldb-commits.
labath added inline comments.Aug 16 2016, 6:17 AM
source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
601 ↗(On Diff #68169)

The location of the duplicate Send. Also similar two cases in WriteAllRegisterValues.

labath updated this revision to Diff 68171.Aug 16 2016, 6:18 AM

Fix indentation

clayborg accepted this revision.Aug 16 2016, 9:48 AM
clayborg edited edge metadata.

Looks good. I know there are many other functions that we should port down into the client code.

This revision is now accepted and ready to land.Aug 16 2016, 9:48 AM
This revision was automatically updated to reflect the committed changes.