summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-03-19 21:32:11 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2002-03-19 21:32:11 +0000
commit31e7d538ed5febc04e7da0e389865984145dabe4 (patch)
treed116da00fe6c50af794548d5d9efe993986defb2
parentc8b290c9bd3c08670cc9745fb6fe5de5acd18336 (diff)
a bit of style.
-rw-r--r--usr.bin/pmdb/arch/hppa/hppa.c17
-rw-r--r--usr.bin/pmdb/arch/i386/i386.c8
-rw-r--r--usr.bin/pmdb/arch/sparc/sparc.c19
-rw-r--r--usr.bin/pmdb/arch/sparc64/sparc64.c17
-rw-r--r--usr.bin/pmdb/arch/vax/vax.c8
5 files changed, 38 insertions, 31 deletions
diff --git a/usr.bin/pmdb/arch/hppa/hppa.c b/usr.bin/pmdb/arch/hppa/hppa.c
index 877ef61f134..a482ac0554a 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.1 2002/03/15 19:48:19 mickey Exp $ */
+/* $OpenBSD: hppa.c,v 1.2 2002/03/19 21:32:10 fgsch Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -57,12 +57,12 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
int i;
if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0)
- return -1;
+ return (-1);
if (frame == 0) {
fram->pc = r.r_pc;
fram->fp = r.r_reg[3];
- return 0;
+ return (0);
}
rp = r.r_reg[2];
@@ -72,7 +72,8 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
for (i = 1; i < frame; i++) {
if (read_from_pid(ps->ps_pid, fp-60, &fr, sizeof(fr)) < 0)
- return -1;
+ return (-1);
+
pc = rp;
fp = fr[15];
rp = fr[10];
@@ -86,7 +87,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
fram->args[2] = fr.r_arg2;
fram->args[3] = fr.r_arg3;
- return 0;
+ return (0);
}
int
@@ -96,11 +97,13 @@ md_getregs(struct pstate *ps, reg *regs)
int i;
if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0)
- return -1;
+ return (-1);
+
regs[0] = r.r_pc;
regs[1] = r.r_npc;
+
for (i = 0; i < 32; i++)
regs[2 + i] = r.r_out[i];
- return 0;
+ return (0);
}
diff --git a/usr.bin/pmdb/arch/i386/i386.c b/usr.bin/pmdb/arch/i386/i386.c
index 89f479b22cd..7b565481487 100644
--- a/usr.bin/pmdb/arch/i386/i386.c
+++ b/usr.bin/pmdb/arch/i386/i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i386.c,v 1.2 2002/03/15 16:41:06 jason Exp $ */
+/* $OpenBSD: i386.c,v 1.3 2002/03/19 21:32:10 fgsch Exp $ */
/*
* Copyright (c) 2002 Federico Schwindt <fgsch@openbsd.org>
* All rights reserved.
@@ -74,7 +74,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
fram->pc = fr.pc;
fram->fp = fr.fp;
- return 0;
+ return (0);
}
int
@@ -83,9 +83,9 @@ md_getregs(struct pstate *ps, reg *regs)
struct reg r;
if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0)
- return -1;
+ return (-1);
memcpy(regs, &r, sizeof(r));
- return 0;
+ return (0);
}
diff --git a/usr.bin/pmdb/arch/sparc/sparc.c b/usr.bin/pmdb/arch/sparc/sparc.c
index ae5120feeff..a791df3088a 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.2 2002/03/15 16:41:06 jason Exp $ */
+/* $OpenBSD: sparc.c,v 1.3 2002/03/19 21:32:10 fgsch Exp $ */
/*
* Copyright (c) 2002 Federico Schwindt <fgsch@openbsd.org>
* All rights reserved.
@@ -55,12 +55,12 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
int i;
if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0)
- return -1;
+ return (-1);
if (frame == 0) {
fram->pc = r.r_pc;
fram->fp = r.r_out[6];
- return 0;
+ return (0);
}
fp = r.r_out[6];
@@ -68,10 +68,10 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
for (i = 1; i < frame; i++) {
if (fp < 8192 || (fp & 7) != 0)
- return -1;
+ return (-1);
if (read_from_pid(ps->ps_pid, fp, &fr, sizeof(fr)) < 0)
- return -1;
+ return (-1);
fp = (unsigned long)next_frame((&fr));
pc = fr.fr_pc;
}
@@ -83,7 +83,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
fram->args[i] = fr.fr_arg[i];
}
- return 0;
+ return (0);
}
int
@@ -93,15 +93,18 @@ md_getregs(struct pstate *ps, reg *regs)
int i;
if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0)
- return -1;
+ return (-1);
+
regs[0] = r.r_pc;
regs[1] = r.r_npc;
+
for (i = 0; i < 8; i++) {
regs[2 + i] = r.r_out[i];
}
+
for (i = 0; i < 8; i++) {
regs[10 + i] = r.r_global[i];
}
- return 0;
+ return (0);
}
diff --git a/usr.bin/pmdb/arch/sparc64/sparc64.c b/usr.bin/pmdb/arch/sparc64/sparc64.c
index 340fa0afd38..42af2277be7 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.3 2002/03/17 18:39:33 art Exp $ */
+/* $OpenBSD: sparc64.c,v 1.4 2002/03/19 21:32:10 fgsch Exp $ */
/*
* Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -80,7 +80,8 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
return (-1);
if (read_from_pid(ps->ps_pid, fp, &fr, sizeof(fr)) < 0)
- return -1;
+ return (-1);
+
fp = (unsigned long)v9next_frame((&fr));
pc = fr.fr_pc;
@@ -100,7 +101,7 @@ out:
fram->args[i] = fr.fr_arg[i];
}
- return 0;
+ return (0);
}
int
@@ -110,17 +111,17 @@ md_getregs(struct pstate *ps, reg *regs)
int i;
if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0)
- return -1;
+ return (-1);
+
regs[0] = r.r_pc;
regs[1] = r.r_npc;
+
for (i = 0; i < 8; i++) {
regs[2 + i] = r.r_out[i];
regs[10 + i] = r.r_in[i];
regs[18 + i] = r.r_global[i];
regs[26 + i] = r.r_local[i];
}
- for (i = 0; i < 8; i++) {
- }
- return 0;
-} \ No newline at end of file
+ return (0);
+}
diff --git a/usr.bin/pmdb/arch/vax/vax.c b/usr.bin/pmdb/arch/vax/vax.c
index 173f4258a4a..228c58536ad 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.1 2002/03/19 21:01:49 fgsch Exp $ */
+/* $OpenBSD: vax.c,v 1.2 2002/03/19 21:32:10 fgsch Exp $ */
/*
* Copyright (c) 2002 Federico Schwindt <fgsch@openbsd.org>
* All rights reserved.
@@ -63,7 +63,7 @@ md_getframe(struct pstate *ps, int frame, struct md_frame *fram)
fram->pc = fr.ca_pc;
fram->fp = fr.ca_fp;
- return 0;
+ return (0);
}
int
@@ -72,9 +72,9 @@ md_getregs(struct pstate *ps, reg *regs)
struct reg r;
if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)&r, 0) != 0)
- return -1;
+ return (-1);
memcpy(regs, &r, sizeof(r));
- return 0;
+ return (0);
}