Changeset View
Changeset View
Standalone View
Standalone View
sys/i386/i386/ptrace_machdep.c
Show All 28 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include "opt_cpu.h" | #include "opt_cpu.h" | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/lock.h> | |||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/mutex.h> | |||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/ptrace.h> | #include <sys/ptrace.h> | ||||
#include <machine/frame.h> | #include <machine/frame.h> | ||||
#include <machine/md_var.h> | #include <machine/md_var.h> | ||||
#include <machine/pcb.h> | #include <machine/pcb.h> | ||||
static int | static int | ||||
cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) | cpu_ptrace_xstate(struct thread *td, int req, void *addr, int data) | ||||
▲ Show 20 Lines • Show All 144 Lines • ▼ Show 20 Lines | case PT_SETGSBASE: | ||||
} | } | ||||
break; | break; | ||||
default: | default: | ||||
return (EINVAL); | return (EINVAL); | ||||
} | } | ||||
return (error); | return (error); | ||||
} | |||||
int | |||||
ptrace_set_pc(struct thread *td, u_long addr) | |||||
{ | |||||
td->td_frame->tf_eip = addr; | |||||
return (0); | |||||
} | |||||
int | |||||
ptrace_single_step(struct thread *td) | |||||
{ | |||||
PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); | |||||
if ((td->td_frame->tf_eflags & PSL_T) == 0) { | |||||
td->td_frame->tf_eflags |= PSL_T; | |||||
td->td_dbgflags |= TDB_STEP; | |||||
} | |||||
return (0); | |||||
} | |||||
int | |||||
ptrace_clear_single_step(struct thread *td) | |||||
{ | |||||
PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); | |||||
td->td_frame->tf_eflags &= ~PSL_T; | |||||
td->td_dbgflags &= ~TDB_STEP; | |||||
return (0); | |||||
} | } |