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
This commit is contained in:
parent
f62dbbae61
commit
bf1be54f54
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=290193
@ -63,7 +63,7 @@ kgdb_trgt_fetch_registers(int regno __unused)
|
|||||||
#ifndef CROSS_DEBUGGER
|
#ifndef CROSS_DEBUGGER
|
||||||
struct kthr *kt;
|
struct kthr *kt;
|
||||||
struct pcb pcb;
|
struct pcb pcb;
|
||||||
int i, reg;
|
int i;
|
||||||
|
|
||||||
kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
|
kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
|
||||||
if (kt == NULL)
|
if (kt == NULL)
|
||||||
@ -76,12 +76,8 @@ kgdb_trgt_fetch_registers(int regno __unused)
|
|||||||
supply_register(i, (char *)&pcb.pcb_regs.sf_r4 +
|
supply_register(i, (char *)&pcb.pcb_regs.sf_r4 +
|
||||||
(i - (ARM_A1_REGNUM + 4 )) * 4);
|
(i - (ARM_A1_REGNUM + 4 )) * 4);
|
||||||
}
|
}
|
||||||
if (pcb.pcb_regs.sf_sp != 0) {
|
supply_register(ARM_PC_REGNUM, (char *)&pcb.pcb_regs.sf_pc);
|
||||||
if (kvm_read(kvm, pcb.pcb_regs.sf_sp + 4 * 4, ®, 4) != 4)
|
supply_register(ARM_LR_REGNUM, (char *)&pcb.pcb_regs.sf_lr);
|
||||||
warnx("kvm_read :%s", kvm_geterr(kvm));
|
|
||||||
else
|
|
||||||
supply_register(ARM_PC_REGNUM, (char *)®);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user