diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1998-08-07 02:22:11 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 1998-08-07 02:22:11 +0000 |
commit | e9c6d0a0fe1284ddcb3e6529d5f8fd3afa9bd3f7 (patch) | |
tree | a3518228531b899abb5a72c5f90e357b84e5cb70 /sys/arch/powerpc/include | |
parent | fa8817757f0a24834abc674e540d3949f595a75d (diff) |
Add kernel support for debugging with gdb. This also make /proc allow
access to the registers. The format of the registers returned in ptrace,
/proc and in the coredump header match what gdb was expecting.
Floating point registers are not yet copied into the structure.
The location of the fpr needs to be found and copied. <- TODO
Changes to trap.c was to add some interm debugging. code is commented out.
powerpc does not currently have a MID_* type, since it uses ELF instead
of a.out, one was never added. Currently the coredump is done in form
of MID_NONE. What is the correct approach for this?? Elf format coredumps...
maybe?
Diffstat (limited to 'sys/arch/powerpc/include')
-rw-r--r-- | sys/arch/powerpc/include/pcb.h | 6 | ||||
-rw-r--r-- | sys/arch/powerpc/include/ptrace.h | 4 | ||||
-rw-r--r-- | sys/arch/powerpc/include/reg.h | 21 |
3 files changed, 24 insertions, 7 deletions
diff --git a/sys/arch/powerpc/include/pcb.h b/sys/arch/powerpc/include/pcb.h index ab02043c45f..ea32d4bbcab 100644 --- a/sys/arch/powerpc/include/pcb.h +++ b/sys/arch/powerpc/include/pcb.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pcb.h,v 1.2 1996/12/28 06:25:18 rahnds Exp $ */ +/* $OpenBSD: pcb.h,v 1.3 1998/08/07 02:22:03 rahnds Exp $ */ /* $NetBSD: pcb.h,v 1.1 1996/09/30 16:34:29 ws Exp $ */ /*- @@ -34,6 +34,7 @@ #ifndef _MACHINE_PCB_H_ #define _MACHINE_PCB_H_ +#include <machine/reg.h> typedef int faultbuf[24]; struct pcb { @@ -51,8 +52,7 @@ struct pcb { }; struct md_coredump { - struct trapframe frame; - /* Need to add FPU regs here */ + struct reg regs; }; #ifdef _KERNEL diff --git a/sys/arch/powerpc/include/ptrace.h b/sys/arch/powerpc/include/ptrace.h index 321320297e6..7190d31d4a2 100644 --- a/sys/arch/powerpc/include/ptrace.h +++ b/sys/arch/powerpc/include/ptrace.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ptrace.h,v 1.1 1996/12/28 06:09:22 rahnds Exp $ */ +/* $OpenBSD: ptrace.h,v 1.2 1998/08/07 02:22:05 rahnds Exp $ */ /* $NetBSD: ptrace.h,v 1.7 1995/01/26 19:47:10 mycroft Exp $ */ /* @@ -37,10 +37,10 @@ * powerpc-dependent ptrace definitions */ #define PT_STEP (PT_FIRSTMACH + 0) -#if NOT_SUPPORTED #define PT_GETREGS (PT_FIRSTMACH + 1) #define PT_SETREGS (PT_FIRSTMACH + 2) +#if NOT_SUPPORTED #define PT_GETFPREGS (PT_FIRSTMACH + 3) #define PT_SETFPREGS (PT_FIRSTMACH + 4) #endif diff --git a/sys/arch/powerpc/include/reg.h b/sys/arch/powerpc/include/reg.h index b0c31944803..ba2ab6413a9 100644 --- a/sys/arch/powerpc/include/reg.h +++ b/sys/arch/powerpc/include/reg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: reg.h,v 1.1 1997/01/02 02:55:47 rahnds Exp $ */ +/* $OpenBSD: reg.h,v 1.2 1998/08/07 02:22:06 rahnds Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -41,5 +41,22 @@ #ifndef _POWERPC_REG_H_ #define _POWERPC_REG_H_ -/* not supported yet */ +/* + * Struct reg, used for procfs and in signal contexts + * Note that in signal contexts, it's represented as an array. + * That array has to look exactly like 'struct reg' though. + */ + +/* this table is set up to match what gdb expects */ +struct reg { + u_int32_t gpr[32]; + u_int64_t fpr[32]; + u_int32_t pc; + u_int32_t ps; + u_int32_t cnd; + u_int32_t lr; + u_int32_t cnt; + u_int32_t xer; + u_int32_t mq; +}; #endif /* !_POWERPC_REG_H_ */ |