Don't try to dereference a kernel pointer in userland; use offsetof()
to get the right address. This fixes kernel GDB after KSE2. Reviewed by: jhb, jake
This commit is contained in:
parent
2622bf6fe4
commit
9c52cf5785
@ -206,7 +206,7 @@ curProc ()
|
||||
|
||||
if (kvread (addr, &td))
|
||||
error ("cannot read thread pointer at %x\n", addr);
|
||||
addr = (CORE_ADDR)td->td_proc;
|
||||
addr = (CORE_ADDR)td + offsetof(struct thread, td_proc);
|
||||
if (kvread (addr, &p))
|
||||
error ("cannot read proc pointer at %x\n", addr);
|
||||
return p;
|
||||
|
@ -206,7 +206,7 @@ curProc ()
|
||||
|
||||
if (kvread (addr, &td))
|
||||
error ("cannot read thread pointer at %x\n", addr);
|
||||
addr = (CORE_ADDR)td->td_proc;
|
||||
addr = (CORE_ADDR)td + offsetof(struct thread, td_proc);
|
||||
if (kvread (addr, &p))
|
||||
error ("cannot read proc pointer at %x\n", addr);
|
||||
return p;
|
||||
|
Loading…
Reference in New Issue
Block a user