summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/binutils/gdb
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2002-02-08 03:19:56 +0000
committerPeter Wemm <peter@FreeBSD.org>2002-02-08 03:19:56 +0000
commit656c73dbdf367d237f605c585b4b615289114878 (patch)
tree5b4dc0097c2d68fe94a829a88c1d760362d756c7 /gnu/usr.bin/binutils/gdb
parentf9393c5e723b94082c652392675265ac8ea1e8df (diff)
Notes
Diffstat (limited to 'gnu/usr.bin/binutils/gdb')
-rw-r--r--gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c9
-rw-r--r--gnu/usr.bin/binutils/gdb/kvm-fbsd.c9
2 files changed, 14 insertions, 4 deletions
diff --git a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c
index f5aab1a1d64a..241b876b5c7f 100644
--- a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c
+++ b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c
@@ -387,10 +387,15 @@ get_kcore_registers (regno)
int regno;
{
struct pcb *pcbaddr;
+ struct thread *mainthread;
/* find the pcb for the current process */
- if (cur_proc == NULL || kvread (&cur_proc->p_thread.td_pcb, &pcbaddr)) /* XXXKSE */
- error ("cannot read u area ptr for proc at %#x", cur_proc);
+ if (cur_proc == NULL)
+ error ("get_kcore_registers no proc");
+ if (kvread (TAILQ_FIRST(&cur_proc->p_threads), &mainthread)) /* XXXKSE */
+ error ("cannot read main thread for proc at %#x", cur_proc);
+ if (kvread (&mainthread->td_pcb, &pcbaddr)) /* XXXKSE */
+ error ("cannot read pcb pointer for proc at %#x", cur_proc);
if (read_pcb (core_kd, (CORE_ADDR)pcbaddr) < 0)
error ("cannot read pcb at %#x", pcbaddr);
}
diff --git a/gnu/usr.bin/binutils/gdb/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/kvm-fbsd.c
index f5aab1a1d64a..241b876b5c7f 100644
--- a/gnu/usr.bin/binutils/gdb/kvm-fbsd.c
+++ b/gnu/usr.bin/binutils/gdb/kvm-fbsd.c
@@ -387,10 +387,15 @@ get_kcore_registers (regno)
int regno;
{
struct pcb *pcbaddr;
+ struct thread *mainthread;
/* find the pcb for the current process */
- if (cur_proc == NULL || kvread (&cur_proc->p_thread.td_pcb, &pcbaddr)) /* XXXKSE */
- error ("cannot read u area ptr for proc at %#x", cur_proc);
+ if (cur_proc == NULL)
+ error ("get_kcore_registers no proc");
+ if (kvread (TAILQ_FIRST(&cur_proc->p_threads), &mainthread)) /* XXXKSE */
+ error ("cannot read main thread for proc at %#x", cur_proc);
+ if (kvread (&mainthread->td_pcb, &pcbaddr)) /* XXXKSE */
+ error ("cannot read pcb pointer for proc at %#x", cur_proc);
if (read_pcb (core_kd, (CORE_ADDR)pcbaddr) < 0)
error ("cannot read pcb at %#x", pcbaddr);
}