From 67d2168b444f70d939b6693cd25c62f2c9c5cfca Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 8 Feb 2002 03:19:56 +0000 Subject: Make this part compile and try and use the p_threads tailq. It might work but I am not sure, I haven't been able to compile the rest of gdb yet. --- gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c | 9 +++++++-- gnu/usr.bin/binutils/gdb/kvm-fbsd.c | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'gnu') diff --git a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c index f5aab1a..241b876 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 f5aab1a..241b876 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); } -- cgit v1.1