diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-01-30 09:42:18 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2009-01-30 09:42:18 +0000 |
commit | e8379d37dcbedc4eca7c7b70ac32fe61c49856f5 (patch) | |
tree | 84a6d393c9a3d4210d579611a915f180eec1e552 /gnu/usr.bin | |
parent | 6110cd79c1514a150ca59e18aa365c9a8a6258f3 (diff) |
Turns out we need to look one frame deeper to find the saved return address
from a pcb when debugging a kernel. Make sure we provide the matching stack
pointer too to avoid duplicating the first frame. Makes "target kvm" much
more useful on powerpc.
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r-- | gnu/usr.bin/binutils/gdb/ppcobsd-nat.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c b/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c index 5acfbb35e4d..6bf6dbc8187 100644 --- a/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c +++ b/gnu/usr.bin/binutils/gdb/ppcobsd-nat.c @@ -169,17 +169,19 @@ ppcobsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) return 0; read_memory (pcb->pcb_sp, (char *)&sf, sizeof sf); - regcache_raw_supply (regcache, SP_REGNUM, &sf.sp); regcache_raw_supply (regcache, tdep->ppc_cr_regnum, &sf.cr); regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 2, &sf.fixreg2); for (i = 0, regnum = tdep->ppc_gp0_regnum + 13; i < 19; i++, regnum++) regcache_raw_supply (regcache, regnum, &sf.fixreg[i]); read_memory (sf.sp, (char *)&cf, sizeof cf); - regcache_raw_supply (regcache, PC_REGNUM, &cf.lr); + regcache_raw_supply (regcache, SP_REGNUM, &cf.sp); regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 30, &cf.r30); regcache_raw_supply (regcache, tdep->ppc_gp0_regnum + 31, &cf.r31); + read_memory (cf.sp, (char *)&cf, sizeof cf); + regcache_raw_supply (regcache, PC_REGNUM, &cf.lr); + return 1; } |