summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorgallatin <gallatin@FreeBSD.org>2002-02-18 14:13:59 +0000
committergallatin <gallatin@FreeBSD.org>2002-02-18 14:13:59 +0000
commit7a2c2b4bb1d80bef02d619284875353493e241bd (patch)
treeb0849b36f50f219fcbcf3e264d603bbe98e53224 /gnu
parent338edfed4600d09a8ef0ebb4903f6a78a8a0cd76 (diff)
downloadFreeBSD-src-7a2c2b4bb1d80bef02d619284875353493e241bd.zip
FreeBSD-src-7a2c2b4bb1d80bef02d619284875353493e241bd.tar.gz
Fix kgdb in the face of the last round of KSE commits.
The alpha world may actually build now..
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c
index 55e4c83..23a016e 100644
--- a/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c
+++ b/gnu/usr.bin/binutils/gdb/alpha/kvm-fbsd.c
@@ -378,7 +378,7 @@ static void
set_proc_cmd(arg)
char *arg;
{
- CORE_ADDR addr;
+ CORE_ADDR addr, first_td;
void *val;
if (!arg)
@@ -389,11 +389,17 @@ set_proc_cmd(arg)
addr = (CORE_ADDR)parse_and_eval_address(arg);
- /* Read the PCB address in proc structure. */
- addr += (int) &((struct proc *)0)->p_thread.td_pcb;
+ /* Find the first thread in the process XXXKSE */
+ addr += offsetof(struct proc, p_threads.tqh_first);
+ if (kvread(addr, &first_td))
+ error("cannot read thread ptr");
+
+ /* Read the PCB address in thread structure. */
+ addr = first_td + offsetof(struct thread, td_pcb);
if (kvread(addr, &val))
error("cannot read pcb ptr");
+ /* Read the PCB address in proc structure. */
if (set_context((CORE_ADDR)val))
error("invalid proc address");
}
OpenPOWER on IntegriCloud