NetBSD Problem Report #43196

From www@NetBSD.org  Fri Apr 23 09:13:12 2010
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 20F3663C52F
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 23 Apr 2010 09:13:12 +0000 (UTC)
Message-Id: <20100423091311.96C2E63B873@www.NetBSD.org>
Date: Fri, 23 Apr 2010 09:13:11 +0000 (UTC)
From: eng1@koblersystems.de
Reply-To: eng1@koblersystems.de
To: gnats-bugs@NetBSD.org
Subject: Adjust KGDB_NUMREGS to gdb 6.5
X-Send-Pr-Version: www-1.0

>Number:         43196
>Category:       port-powerpc
>Synopsis:       Adjust KGDB_NUMREGS to gdb 6.5
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-powerpc-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 23 09:15:00 +0000 2010
>Closed-Date:    Tue Sep 08 04:36:21 +0000 2015
>Last-Modified:  Tue Sep 08 04:36:21 +0000 2015
>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

>Release-Note:

>Audit-Trail:
From: "Matt Thomas" <matt@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/43196 CVS commit: src/sys/arch/powerpc/include
Date: Tue, 14 Jun 2011 03:28:33 +0000

 Module Name:	src
 Committed By:	matt
 Date:		Tue Jun 14 03:28:32 UTC 2011

 Modified Files:
 	src/sys/arch/powerpc/include: db_machdep.h

 Log Message:
 Update KDB_NUMREGS to match what gdb6 is using for PPC.
 Patch taken from PR/43196


 To generate a diff of this commit:
 cvs rdiff -u -r1.23 -r1.24 src/sys/arch/powerpc/include/db_machdep.h

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Tue, 08 Sep 2015 04:36:21 +0000
State-Changed-Why:
matt@ committed the patch in 2011


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.