diff options
author | bde <bde@FreeBSD.org> | 1998-05-12 16:49:13 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-05-12 16:49:13 +0000 |
commit | 400020b8c9bd026bcc630e4377ad85dbe96ac57a (patch) | |
tree | c937f5128327ae1218114eca1e94a3bd91c08f63 /gnu/usr.bin/gdb | |
parent | cf33162fa63c2bb11e908cc0d96fa52619e60bc8 (diff) | |
download | FreeBSD-src-400020b8c9bd026bcc630e4377ad85dbe96ac57a.zip FreeBSD-src-400020b8c9bd026bcc630e4377ad85dbe96ac57a.tar.gz |
Don't attempt to read process context from the kernel when (the
kernel's) curproc is null. This fixes endless recursion in
xfer_umem() for attempts to read from user addresses, in particular
for attempts to read %fs and %gs from the pcb for `info reg'.
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r-- | gnu/usr.bin/gdb/gdb/kvm-fbsd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c index 1f75dbe..eca0f70 100644 --- a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c +++ b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c @@ -361,7 +361,7 @@ get_kcore_registers (regno) struct user *uaddr; /* find the pcb for the current process */ - if (kvread (&cur_proc->p_addr, &uaddr)) + if (cur_proc == NULL || kvread (&cur_proc->p_addr, &uaddr)) error ("cannot read u area ptr for proc at %#x", cur_proc); if (read_pcb (core_kd, (CORE_ADDR)&uaddr->u_pcb) < 0) error ("cannot read pcb at %#x", &uaddr->u_pcb); @@ -418,7 +418,7 @@ xfer_umem (memaddr, myaddr, len, write) int n; struct proc proc; - if (kvread (cur_proc, &proc)) + if (cur_proc == NULL || kvread (cur_proc, &proc)) error ("cannot read proc at %#x", cur_proc); n = kvm_uread (core_kd, &proc, memaddr, myaddr, len) ; |