summaryrefslogtreecommitdiff
path: root/usr.bin/pmdb
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-07-31 02:38:40 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-07-31 02:38:40 +0000
commit8324535a7671499e2adefbd379914e02e2ec1c8b (patch)
treefdecd032d19f138c339736d9979bfb32a632669a /usr.bin/pmdb
parent832ac40b6739579a1fcf06e259bd6e1ad4a74cc0 (diff)
unbreak process_getregs
Diffstat (limited to 'usr.bin/pmdb')
-rw-r--r--usr.bin/pmdb/process.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/usr.bin/pmdb/process.c b/usr.bin/pmdb/process.c
index 1615195a644..a128da74eb5 100644
--- a/usr.bin/pmdb/process.c
+++ b/usr.bin/pmdb/process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.c,v 1.8 2002/07/22 03:06:00 art Exp $ */
+/* $OpenBSD: process.c,v 1.9 2002/07/31 02:38:39 art Exp $ */
/*
* Copyright (c) 2002 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -165,15 +165,13 @@ int
process_getregs(struct pstate *ps, struct reg *r)
{
- if (ps->ps_state == STOPPED) {
- if (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)r, 0) != 0)
- return (-1);
- } else if (ps->ps_flags & PSF_CORE) {
+ if (ps->ps_flags & PSF_CORE) {
memcpy(r, ps->ps_core->regs, sizeof(*r));
- } else
- return (-1);
- return (0);
+ return (0);
+ }
+
+ return (ptrace(PT_GETREGS, ps->ps_pid, (caddr_t)r, 0));
}
int