PTRACE_GETREGSET and PTRACE_SETREGSET basic implementation on aarch64 #1695
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As I mentioned in #1419 (comment) I had this code implemented in a personal project of mine.
As some of you might know, to read and modify tracee's registers with
ptrace
onaarch64
, one need to do so by callingptrace
viaiovec
. (man ptrace underPTRACE_GETREGSET
)This current PR supports
aarch64
linux and android and includes:ptrace
calls to receive and modify data viaiovec
:ptrace_get_iovec_data
andptrace_set_iovec_data
.ptrace_getregset
andptrace_setregset
test_ptrace_regsets
, that receives tracee's registers, modify one of them, and validate if the modification completed successfully.I might will modify some minor changes.
I want to get you're special attention about this line from
man ptrace
:On return, the kernel modifies iov.len to indicate the actual number of bytes returned.
In my original implemented I didn't add anything to validate that, and I'm not aware what'd this repo's conventions dictate in such occasion, so leave a comment and I will edit the code as necessery.
Please let me know if I forgot or missed something.