diff options
| author | nathanw <nathanw@NetBSD.org> | 2004-01-02 22:41:17 +0000 |
|---|---|---|
| committer | nathanw <nathanw@NetBSD.org> | 2004-01-02 22:41:17 +0000 |
| commit | 240c6ac9cf4b2beaebf00baf89c1fab0fea72a95 (patch) | |
| tree | b91169e89227b581c9a7a8afba77ff13088c4daa /gnu | |
| parent | ba5491506323487254e54b3d9eb59c6713b4ef3c (diff) | |
Re-implement fetch_kcore_registers() for alpha.
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/dist/gdb/gdb/alphabsd-nat.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gnu/dist/gdb/gdb/alphabsd-nat.c b/gnu/dist/gdb/gdb/alphabsd-nat.c index b26d3ea7c48..c09596e168f 100644 --- a/gnu/dist/gdb/gdb/alphabsd-nat.c +++ b/gnu/dist/gdb/gdb/alphabsd-nat.c @@ -27,7 +27,9 @@ #include <sys/types.h> #include <sys/ptrace.h> +#include <sys/signal.h> #include <machine/reg.h> +#include <machine/pcb.h> #ifdef HAVE_SYS_PROCFS_H #include <sys/procfs.h> @@ -155,3 +157,36 @@ store_inferior_registers (int regno) perror_with_name ("Couldn't write floating point status"); } } + +#ifdef FETCH_KCORE_REGISTERS +/* + * Get registers from a kernel crash dump or live kernel. + * Called by kcore-nbsd.c:get_kcore_registers(). + */ +void +fetch_kcore_registers (pcb) + struct pcb *pcb; +{ + int i, regno; + + /* Clear v0 through t7 */ + for (i = 0, regno = 0; regno < ALPHA_S0_REGNUM; regno++) + supply_register (regno, (char *)&i); + + /* s0 through s6 */ + for (i = 0, regno = ALPHA_S0_REGNUM; regno < ALPHA_A0_REGNUM ; regno++, i++) + supply_register (regno, (char *)&pcb->pcb_context[i]); + + /* Clear a0 through gp */ + for (i = 0, regno = ALPHA_A0_REGNUM; regno < ALPHA_SP_REGNUM; regno++) + supply_register (regno, (char *)&i); + + /* sp */ + supply_register (ALPHA_SP_REGNUM, (char *)&pcb->pcb_hw.apcb_ksp); + + /* XXX Should we clear FP state? */ + + /* pc */ + supply_register (ALPHA_PC_REGNUM, (char *)&pcb->pcb_context[7]); +} +#endif |
