nix icon indicating copy to clipboard operation
nix copied to clipboard

Support GETFPREGS and SETFPREGS ptrace calls

Open nemarci opened this issue 3 years ago • 5 comments

Added two new functions to the ptrace module: getfpregs and setfpregs gets and sets the floating point registers of the tracee.

nemarci avatar Apr 15 '21 08:04 nemarci

Would it be possible to add a test?

Yes, sure. What kind of test do you have in mind? I see that most ptrace related tests just call ptrace and then check that it doesn't return Error::UnsupportedOperation. Would a similar check be sufficient, or would you like some more thorough testing? (e.g. creating a subprocess, then modify one of the XMM reigsters with setfpregs, and reading it with getfpregs to check that we successfully modified it).

nemarci avatar Apr 17 '21 14:04 nemarci

Would it be possible to add a test?

Yes, sure. What kind of test do you have in mind? I see that most ptrace related tests just call ptrace and then check that it doesn't return Error::UnsupportedOperation. Would a similar check be sufficient, or would you like some more thorough testing? (e.g. creating a subprocess, then modify one of the XMM reigsters with setfpregs, and reading it with getfpregs to check that we successfully modified it).

That would be perfect.

asomers avatar Apr 18 '21 21:04 asomers

Two of the automatic tests failed, but as far as I understand, these failures are unrelated to my patch. Could you verify if this is indeed true? And if I'm wrong, could you give some advice how to fix the failures?

nemarci avatar May 26 '21 08:05 nemarci

Thanks for the very good tests! As for the test failures, both should be fixed if you rebase your changes onto master.

asomers avatar May 30 '21 14:05 asomers

Looks good, but I forgot one thing: this needs a CHANGELOG entry. And you can go ahead and squash while you're at it.

asomers avatar Jun 12 '21 18:06 asomers

Closing in favor of https://github.com/nix-rust/nix/pull/1844

nemarci avatar Oct 11 '22 18:10 nemarci