Re: [RFC][PATCH 1/2] x86: Allow breakpoints to emulate call functions

From: Steven Rostedt
Date: Mon May 06 2019 - 22:59:12 EST


On Mon, 6 May 2019 19:22:06 -0700
Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:

> Notice? We'd not even have to look up any values. We'd literally just
> do something like
>
> int offset = locked_atomic_read(ip+1);
> return int3_emulate_call(ip, ip+5+offset);
>
> and it would be *atomic* with respect to whatever other user that
> updates the instruction, as long as they update the offset with a
> "xchg" instruction.

Honestly, I'm not really sure what you are trying to do here.

Are you talking about making the update to the code in the int3
handler? And then just returning back to the regs->ip and executing the
new call (not really emulating).

-- Steve