NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

port-powerpc/43196: Adjust KGDB_NUMREGS to gdb 6.5



>Number:         43196
>Category:       port-powerpc
>Synopsis:       Adjust KGDB_NUMREGS to gdb 6.5
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-powerpc-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 23 09:15:00 +0000 2010
>Originator:     Jan Kobler
>Release:        5.0.2
>Organization:
Kobler Systems GmbH
>Environment:
>Description:
In usr/src/sys/arch/powerpc/include/db_machdep.h the value 220 of KGDB_NUMREGS 
is valid only for gdb 5.x.
gdb 6.5 is using a different register array, which is defined in 
usr/src/gnu/dist/gdb6/gdb/regformats/reg-ppc.dat.
The value for KGDB_NUMREGS should be changed to 103 for use with gdb 6.5.

>How-To-Repeat:

>Fix:
--- old/usr/src/sys/arch/powerpc/include/db_machdep.h   2006-05-14 
23:56:32.000000000 +0200
+++ new/usr/src/sys/arch/powerpc/include/db_machdep.h   2010-04-23 
10:42:12.000000000 +0200
@@ -133,9 +133,20 @@
  * and up to 64 4-byte non-standard OES special-purpose registers.
  * GDB keeps some extra space, so the total size of the register array
  * they use is 880 bytes (gdb-5.0).
+ * KGDB_NUMREGS 220
+ */
+/*
+ * GDB's register array of gdb-6.0 is defined in 
usr/src/gnu/dist/gdb6/gdb/regformats/reg-ppc.dat
+ * GDB's register array is:
+ *  32 4-byte GPRs
+ *  32 8-byte FPRs
+ *   7 4-byte UISA special-purpose registers: pc, ps, cr, lr, ctr, xer, fpscr
+ * index of pc in array: 32 + 2*32 = 96
+ * size 32 * 4 + 32 * 8 + 7 * 4 = 103 * 4 = 412 bytes
+   * KGD_NUMREGS 103
  */
 typedef long   kgdb_reg_t;
-#define KGDB_NUMREGS   220     /* Treat all registers as 4-byte */
+#define KGDB_NUMREGS   103     /* Treat all registers as 4-byte */
 #define KGDB_BUFLEN    (2*KGDB_NUMREGS*sizeof(kgdb_reg_t)+1)
 #define KGDB_PPC_PC_REG                96      /* first UISA SP register */
 #define KGDB_PPC_MSR_REG       97



Home | Main Index | Thread Index | Old Index