diff options
author | peter <peter@FreeBSD.org> | 2001-09-20 06:31:23 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2001-09-20 06:31:23 +0000 |
commit | 5c7920c83b53e35568a5198b1c0619164d31ddf4 (patch) | |
tree | 0cdc63000e73f9f56f3b3180653f17f4dc06ea29 /gnu | |
parent | 32232bb3044f4a7fa7cbc3bd3ef1f5ae84e9ddc2 (diff) | |
download | FreeBSD-src-5c7920c83b53e35568a5198b1c0619164d31ddf4.zip FreeBSD-src-5c7920c83b53e35568a5198b1c0619164d31ddf4.tar.gz |
Fix alpha gdb -k on "live" kernels. Use offsetof() instead of some evil
hand-rolled macros to do the same thing.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c index be95697..d0d4cf4 100644 --- a/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c +++ b/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c @@ -128,10 +128,17 @@ initial_pcb() * Therefore, just use proc0 and let the user set * some other context if they care about it. */ - addr = ksym_lookup("proc0paddr"); + addr = ksym_lookup("thread0"); if (kvread(addr, &val)) { - error("cannot read proc0paddr pointer at %x\n", addr); + error("cannot read thread0 pointer at %x\n", addr); val = 0; + } else { + /* Read the PCB address in proc structure. */ + addr = (CORE_ADDR)val + offsetof(struct thread, td_pcb); + if (kvread(addr, &val)) { + error("cannot read thread0->td_pcb pointer at %x\n", addr); + val = 0; + } } return ((CORE_ADDR)val); |