diff options
author | zbb <zbb@FreeBSD.org> | 2015-10-30 12:37:40 +0000 |
---|---|---|
committer | zbb <zbb@FreeBSD.org> | 2015-10-30 12:37:40 +0000 |
commit | 5e057d29086245855ba89118eb697cab393b48ef (patch) | |
tree | d28922f5c2b4450f7c57cbd15f4da5e809181f6e | |
parent | dbf29557d917055e8603643594313199f544af88 (diff) | |
download | FreeBSD-src-5e057d29086245855ba89118eb697cab393b48ef.zip FreeBSD-src-5e057d29086245855ba89118eb697cab393b48ef.tar.gz |
Use PCB/LR from PCB rather from stack on armv7-gdb
The kernel dump does not store these values on the stack.
Use PCB structure to resolve PC and LR properly.
Submitted by: Wojciech Macek <wma@semihalf.com>
Reviewed by: jhb, kib
Obtained from: Semihalf
Sponsored by: Juniper Networks Inc.
Differential Revision: https://reviews.freebsd.org/D4013
-rw-r--r-- | gnu/usr.bin/gdb/kgdb/trgt_arm.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_arm.c b/gnu/usr.bin/gdb/kgdb/trgt_arm.c index cb23aa6..d457bd3 100644 --- a/gnu/usr.bin/gdb/kgdb/trgt_arm.c +++ b/gnu/usr.bin/gdb/kgdb/trgt_arm.c @@ -63,7 +63,7 @@ kgdb_trgt_fetch_registers(int regno __unused) #ifndef CROSS_DEBUGGER struct kthr *kt; struct pcb pcb; - int i, reg; + int i; kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid)); if (kt == NULL) @@ -76,12 +76,8 @@ kgdb_trgt_fetch_registers(int regno __unused) supply_register(i, (char *)&pcb.pcb_regs.sf_r4 + (i - (ARM_A1_REGNUM + 4 )) * 4); } - if (pcb.pcb_regs.sf_sp != 0) { - if (kvm_read(kvm, pcb.pcb_regs.sf_sp + 4 * 4, ®, 4) != 4) - warnx("kvm_read :%s", kvm_geterr(kvm)); - else - supply_register(ARM_PC_REGNUM, (char *)®); - } + supply_register(ARM_PC_REGNUM, (char *)&pcb.pcb_regs.sf_pc); + supply_register(ARM_LR_REGNUM, (char *)&pcb.pcb_regs.sf_lr); #endif } |