From 1e1a46615a800011d1dbeee99c5f83f6eeb762ad Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Mon, 22 Jul 2002 02:54:24 +0000 Subject: Use process_getregs everywhere. --- usr.bin/pmdb/arch/alpha/alpha.c | 8 ++++---- usr.bin/pmdb/arch/alpha/alpha_trace.c | 6 +++--- usr.bin/pmdb/arch/hppa/hppa.c | 6 +++--- usr.bin/pmdb/arch/powerpc/powerpc.c | 9 +++++---- usr.bin/pmdb/arch/sparc/sparc.c | 6 +++--- usr.bin/pmdb/arch/sparc64/sparc64.c | 6 +++--- usr.bin/pmdb/arch/vax/vax.c | 6 +++--- 7 files changed, 24 insertions(+), 23 deletions(-) (limited to 'usr.bin/pmdb/arch') diff --git a/usr.bin/pmdb/arch/alpha/alpha.c b/usr.bin/pmdb/arch/alpha/alpha.c index 9e5fd953b16..37a36e39ccc 100644 --- a/usr.bin/pmdb/arch/alpha/alpha.c +++ b/usr.bin/pmdb/arch/alpha/alpha.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alpha.c,v 1.2 2002/03/15 16:41:06 jason Exp $ */ +/* $OpenBSD: alpha.c,v 1.3 2002/07/22 02:54:23 art Exp $ */ /* * Copyright (c) 2002 Artur Grabowski * All rights reserved. @@ -61,10 +61,10 @@ md_getregs(struct pstate *ps, reg *regs) { struct reg r; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) - return -1; + if (process_getregs(ps, &r)) + return (-1); memcpy(regs, &r, sizeof(r)); - return 0; + return (0); } \ No newline at end of file diff --git a/usr.bin/pmdb/arch/alpha/alpha_trace.c b/usr.bin/pmdb/arch/alpha/alpha_trace.c index 305690848cc..e50cb74a76a 100644 --- a/usr.bin/pmdb/arch/alpha/alpha_trace.c +++ b/usr.bin/pmdb/arch/alpha/alpha_trace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: alpha_trace.c,v 1.3 2002/07/22 01:20:50 art Exp $ */ +/* $OpenBSD: alpha_trace.c,v 1.4 2002/07/22 02:54:23 art Exp $ */ /* * Copyright (c) 2002 Artur Grabowski * All rights reserved. @@ -247,8 +247,8 @@ md_getframe(struct pstate *ps, int framec, struct md_frame *fram) bzero(slot, sizeof(slot)); - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)®s, 0) != 0) - return -1; + if (process_getregs(ps, ®s)) + return (-1); for (i = 0; i < 32; i++) slot[i] = -1; diff --git a/usr.bin/pmdb/arch/hppa/hppa.c b/usr.bin/pmdb/arch/hppa/hppa.c index 800fc404944..bb2bdc43914 100644 --- a/usr.bin/pmdb/arch/hppa/hppa.c +++ b/usr.bin/pmdb/arch/hppa/hppa.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hppa.c,v 1.3 2002/07/22 01:20:50 art Exp $ */ +/* $OpenBSD: hppa.c,v 1.4 2002/07/22 02:54:23 art Exp $ */ /* * Copyright (c) 2002 Michael Shalayeff @@ -56,7 +56,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram) reg fp, pc, rp; int i; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); if (frame == 0) { @@ -96,7 +96,7 @@ md_getregs(struct pstate *ps, reg *regs) struct reg r; int i; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); regs[0] = r.r_pc; diff --git a/usr.bin/pmdb/arch/powerpc/powerpc.c b/usr.bin/pmdb/arch/powerpc/powerpc.c index 9efafd430c1..fe7d5acbe91 100644 --- a/usr.bin/pmdb/arch/powerpc/powerpc.c +++ b/usr.bin/pmdb/arch/powerpc/powerpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: powerpc.c,v 1.2 2002/07/22 01:20:50 art Exp $ */ +/* $OpenBSD: powerpc.c,v 1.3 2002/07/22 02:54:23 art Exp $ */ /* * Copyright (c) 2002 Dale Rahn * All rights reserved. @@ -55,7 +55,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram) reg fp, pc; int i; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); fp = r.gpr[1]; if (frame == 0) { @@ -82,10 +82,11 @@ out: return 0; } -int md_getregs(struct pstate *ps, reg *regs) +int +md_getregs(struct pstate *ps, reg *regs) { struct reg md_reg; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&md_reg, 0) != 0) + if (process_getregs(ps, &md_reg)) return -1; memcpy(regs, &md_reg, 32 * sizeof(long)); memcpy(®s[32], &md_reg.pc, 7 * sizeof(long)); diff --git a/usr.bin/pmdb/arch/sparc/sparc.c b/usr.bin/pmdb/arch/sparc/sparc.c index fc5c6921f50..dbbb2e72df4 100644 --- a/usr.bin/pmdb/arch/sparc/sparc.c +++ b/usr.bin/pmdb/arch/sparc/sparc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sparc.c,v 1.4 2002/07/22 01:20:50 art Exp $ */ +/* $OpenBSD: sparc.c,v 1.5 2002/07/22 02:54:23 art Exp $ */ /* * Copyright (c) 2002 Federico Schwindt * All rights reserved. @@ -54,7 +54,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram) reg fp, pc; int i; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); if (frame == 0) { @@ -92,7 +92,7 @@ md_getregs(struct pstate *ps, reg *regs) struct reg r; int i; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); regs[0] = r.r_pc; diff --git a/usr.bin/pmdb/arch/sparc64/sparc64.c b/usr.bin/pmdb/arch/sparc64/sparc64.c index b71d29f88aa..707f5073a4a 100644 --- a/usr.bin/pmdb/arch/sparc64/sparc64.c +++ b/usr.bin/pmdb/arch/sparc64/sparc64.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sparc64.c,v 1.5 2002/07/22 01:20:50 art Exp $ */ +/* $OpenBSD: sparc64.c,v 1.6 2002/07/22 02:54:23 art Exp $ */ /* * Copyright (c) 2002 Artur Grabowski * All rights reserved. @@ -55,7 +55,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram) reg *outs; int i; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); if (frame == 0) { @@ -110,7 +110,7 @@ md_getregs(struct pstate *ps, reg *regs) struct reg r; int i; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); regs[0] = r.r_pc; diff --git a/usr.bin/pmdb/arch/vax/vax.c b/usr.bin/pmdb/arch/vax/vax.c index 5b3e7051e55..aeac744ea17 100644 --- a/usr.bin/pmdb/arch/vax/vax.c +++ b/usr.bin/pmdb/arch/vax/vax.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vax.c,v 1.4 2002/07/22 01:20:50 art Exp $ */ +/* $OpenBSD: vax.c,v 1.5 2002/07/22 02:54:23 art Exp $ */ /* * Copyright (c) 2002 Federico Schwindt * All rights reserved. @@ -50,7 +50,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram) struct reg r; int count; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); fr.ca_fp = r.fp; @@ -74,7 +74,7 @@ md_getregs(struct pstate *ps, reg *regs) { struct reg r; - if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0) + if (process_getregs(ps, &r)) return (-1); memcpy(regs, &r, sizeof(r)); -- cgit v1.2.3