Commit 403c96ad authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Andrei Vagin

compel: Add compel_run_at helper

Simply run tracee from specfied IP assuming
it's arelady have trapping instruction in
stream.

It's unsafe low-level function use with caution.

travis-ci: success for compel: A fix and new helper
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent d4c02f2e
......@@ -73,6 +73,7 @@ extern int compel_syscall(struct parasite_ctl *ctl, int nr, unsigned long *ret,
unsigned long arg5,
unsigned long arg6);
extern int compel_run_in_thread(struct parasite_thread_ctl *tctl, unsigned int cmd);
extern int compel_run_at(struct parasite_ctl *ctl, unsigned long ip, user_regs_struct_t *ret_regs);
/*
* The PTRACE_SYSCALL will trap task twice -- on
......
......@@ -590,6 +590,17 @@ int compel_execute_syscall(struct parasite_ctl *ctl,
return err;
}
int compel_run_at(struct parasite_ctl *ctl, unsigned long ip, user_regs_struct_t *ret_regs)
{
user_regs_struct_t regs = ctl->orig.regs;
int ret;
ret = parasite_run(ctl->rpid, PTRACE_CONT, ip, 0, &regs, &ctl->orig);
if (!ret)
ret = parasite_trap(ctl, ctl->rpid, ret_regs ? ret_regs : &regs, &ctl->orig);
return ret;
}
static int accept_tsock(struct parasite_ctl *ctl)
{
int sock;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment