Fix gdb_cpu_getreg() to actually match GDB's register
definition.
This commit is contained in:
parent
2ffa44209a
commit
4590f2282a
@ -53,12 +53,15 @@ gdb_cpu_getreg(int regnum, size_t *regsz)
|
|||||||
|
|
||||||
*regsz = gdb_cpu_regsz(regnum);
|
*regsz = gdb_cpu_regsz(regnum);
|
||||||
|
|
||||||
if (kdb_thread == curthread) {
|
if (kdb_thread == curthread) {
|
||||||
if (regnum < 16)
|
if (regnum < 15)
|
||||||
return (&kdb_frame->tf_r0 + 4 * regnum);
|
return (&kdb_frame->tf_r0 + regnum);
|
||||||
|
if (regnum == 15)
|
||||||
|
return (&kdb_frame->tf_pc);
|
||||||
if (regnum == 25)
|
if (regnum == 25)
|
||||||
return (&kdb_frame->tf_spsr);
|
return (&kdb_frame->tf_spsr);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (regnum) {
|
switch (regnum) {
|
||||||
case 8: return (&kdb_thrctx->un_32.pcb32_r8);
|
case 8: return (&kdb_thrctx->un_32.pcb32_r8);
|
||||||
case 9: return (&kdb_thrctx->un_32.pcb32_r9);
|
case 9: return (&kdb_thrctx->un_32.pcb32_r9);
|
||||||
@ -78,6 +81,7 @@ gdb_cpu_getreg(int regnum, size_t *regsz)
|
|||||||
return (&kdb_thrctx->un_32.pcb32_pc);
|
return (&kdb_thrctx->un_32.pcb32_pc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user