task::finish_emulated_syscall

Kyle Huey me at kylehuey.com
Sun Jan 25 22:33:10 PST 2015


On Mon, Jan 26, 2015 at 2:19 PM, Robert O'Callahan <robert at ocallahan.org>
wrote:

> On Fri, Jan 23, 2015 at 6:03 PM, Kyle Huey <me at kylehuey.com> wrote:
>
>> Why is this necessary?
>>
>
> When we resume with a PTRACE_SYSEMU (or PTRACE_SYSEMU_SINGLESTEP) on x86,
> and we reach a system call, we get a ptrace trap. We need to exit the
> emulated system call before we set the registers from the trace. We do that
> by single-stepping in finish_emulated_syscall, but as the comments there
> describe, it's not trivial since on x86 singlestepping not only exits the
> syscall but also executes the instruction after it.
>

Why do we need to exit the syscall before setting the registers?  Does the
kernel do something weird here?

- Kyle
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rr-dev/attachments/20150126/48726e6e/attachment.html>


More information about the rr-dev mailing list