From 53dbf303491f486ef2c376e6330280cf2bd2d162 Mon Sep 17 00:00:00 2001 From: David Xu Date: Tue, 13 Jul 2004 07:22:56 +0000 Subject: Add ptrace_clear_single_step(), alpha already has it for years, the function will be used by ptrace to clear a thread's single step state. --- sys/amd64/amd64/machdep.c | 7 +++++++ sys/i386/i386/machdep.c | 7 +++++++ sys/ia64/ia64/machdep.c | 8 ++++++++ sys/pc98/i386/machdep.c | 7 +++++++ sys/pc98/pc98/machdep.c | 7 +++++++ sys/powerpc/aim/machdep.c | 8 ++++++++ sys/powerpc/powerpc/machdep.c | 8 ++++++++ sys/sparc64/sparc64/machdep.c | 7 +++++++ 8 files changed, 59 insertions(+) diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index bfd0edc7b7ed..b95c211ad1c2 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1302,6 +1302,13 @@ ptrace_single_step(struct thread *td) return (0); } +int +ptrace_clear_single_step(struct thread *td) +{ + td->td_frame->tf_rflags &= ~PSL_T; + return (0); +} + int fill_regs(struct thread *td, struct reg *regs) { diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index a783e013f483..ec148fcd56ba 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -2251,6 +2251,13 @@ ptrace_single_step(struct thread *td) return (0); } +int +ptrace_clear_single_step(struct thread *td) +{ + td->td_frame->tf_eflags &= ~PSL_T; + return (0); +} + int fill_regs(struct thread *td, struct reg *regs) { diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 9fed902d1f40..1dfab47d2b8e 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -1254,6 +1254,14 @@ ptrace_single_step(struct thread *td) return (0); } +int +ptrace_clear_single_step(struct thread *td) +{ + + td->td_frame->tf_special.psr &= ~IA64_PSR_SS; + return (0); +} + int fill_regs(struct thread *td, struct reg *regs) { diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index 67e5f71f4f41..96576ee70863 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -2308,6 +2308,13 @@ ptrace_single_step(struct thread *td) return (0); } +int +ptrace_clear_single_step(struct thread *td) +{ + td->td_frame->tf_eflags &= ~PSL_T; + return (0); +} + int fill_regs(struct thread *td, struct reg *regs) { diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index 67e5f71f4f41..96576ee70863 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -2308,6 +2308,13 @@ ptrace_single_step(struct thread *td) return (0); } +int +ptrace_clear_single_step(struct thread *td) +{ + td->td_frame->tf_eflags &= ~PSL_T; + return (0); +} + int fill_regs(struct thread *td, struct reg *regs) { diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index 051a12138fdd..4c3199e211b8 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -820,6 +820,14 @@ ptrace_single_step(struct thread *td) return (ENOSYS); } +int +ptrace_clear_single_step(struct thread *td) +{ + + /* XXX: coming soon... */ + return (ENOSYS); +} + /* * Initialise a struct pcpu. */ diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 051a12138fdd..4c3199e211b8 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -820,6 +820,14 @@ ptrace_single_step(struct thread *td) return (ENOSYS); } +int +ptrace_clear_single_step(struct thread *td) +{ + + /* XXX: coming soon... */ + return (ENOSYS); +} + /* * Initialise a struct pcpu. */ diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index 1671af43824f..73e6aa346c7c 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -711,6 +711,13 @@ ptrace_single_step(struct thread *td) return (0); } +int +ptrace_clear_single_step(struct thread *td) +{ + /* TODO; */ + return (0); +} + void exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings) { -- cgit v1.3