From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24503 invoked by alias); 11 Nov 2006 21:19:20 -0000 Received: (qmail 24495 invoked by uid 22791); 11 Nov 2006 21:19:20 -0000 X-Spam-Check-By: sourceware.org Received: from smtp-vbr17.xs4all.nl (HELO smtp-vbr17.xs4all.nl) (194.109.24.37) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 11 Nov 2006 21:19:07 +0000 Received: from webmail.xs4all.nl (dovemail5.xs4all.nl [194.109.26.7]) by smtp-vbr17.xs4all.nl (8.13.8/8.13.8) with ESMTP id kABLIiM8065494; Sat, 11 Nov 2006 22:18:48 +0100 (CET) (envelope-from mark.kettenis@xs4all.nl) Received: from 82.92.89.47 (SquirrelMail authenticated user sibelius) by webmail.xs4all.nl with HTTP; Sat, 11 Nov 2006 22:18:48 +0100 (CET) Message-ID: <13947.82.92.89.47.1163279928.squirrel@webmail.xs4all.nl> In-Reply-To: <200611111839.kABId7in031579@d12av02.megacenter.de.ibm.com> References: <200611111839.kABId7in031579@d12av02.megacenter.de.ibm.com> Date: Sat, 11 Nov 2006 21:19:00 -0000 Subject: Re: [RFA][3/5] New port: Cell BE SPU (the port itself) From: "Mark Kettenis" To: "Ulrich Weigand" Cc: gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.8 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-11/txt/msg00087.txt.bz2 > Hello, > > this is the bulk of the new SPU port. It adds a configuration for > spu*-*-* as target, as well as a 'pseudo-native' configuration hosted > on powerpc that allows debugging SPU code natively on a Cell BE system. > > OK? Hi Ulrich, A couple of points: First, "spu" doesn't occur anywhere in config.guess. Is this a name the community agrees on? I understand it stands for Synergistic Processor Unit, and it seems a bad idea to me that's a fairly generic term. > * config/spu/spu-cell.mt: New file. > * config/spu/spu.mt: New file. Two .mt files? I think spu-cell.mt should be renamed spu.mh. > * spu-nat.c: New file. This file seems to be Linux-spefic. Can you rename it to spu-linux-nat.c? > +/* Some older glibc versions do not define this. */ > +#ifndef __WNOTHREAD > +#define __WNOTHREAD 0x20000000 /* Don't wait on children of > other > + threads in this group */ > +#endif Is this really needed? I mean, sometimes stuff like this gets added when we're working on getting anew platform running, but things get fixed before there's an "offical" release. > + sprintf (mess, "reading PPC register #%d", regno); Can you use xsnprintf() wherever you use sprintf? The later is a very dangerous function, and really should not be used in new code. > + char buf[8]; Lots of places use char where you should use gdb_byte. > diff -urN gdb-orig/gdb/spu-tdep.h gdb-head/gdb/spu-tdep.h > --- gdb-orig/gdb/spu-tdep.h 1970-01-01 01:00:00.000000000 +0100 > +++ gdb-head/gdb/spu-tdep.h 2006-11-10 02:10:48.572865680 +0100 > @@ -0,0 +1,44 @@ > +/* SPU target-dependent code for GDB, the GNU debugger. > + Copyright (C) 2006 Free Software Foundation, Inc. > + > + This file is part of GDB. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 2 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program; if not, write to the Free Software > + Foundation, Inc., 51 Franklin Street, Fifth Floor, > + Boston, MA 02110-1301, USA. */ > + > +#ifndef SPU_TDEP_H > +#define SPU_TDEP_H > + > +/* Number of registers. */ > +#define SPU_NUM_REGS 130 > +#define SPU_NUM_PSEUDO_REGS 1 > +#define SPU_NUM_CORE_REGS 128 > + > +/* SPU calling convention. */ > +#define SPU_LR_REGNUM 0 > +#define SPU_RAW_SP_REGNUM 1 > +#define SPU_ARG1_REGNUM 3 > +#define SPU_ARGN_REGNUM 79 > +#define SPU_FP_REGNUM 127 > + > +/* Special registers. */ > +#define SPU_ID_REGNUM 128 > +#define SPU_PC_REGNUM 129 > +#define SPU_SP_REGNUM 130 > + > +/* Local store. */ > +#define SPU_LS_SIZE 0x40000 > + > +#endif Many ports use an enum for the register numbers, which makes debugging a bit easier. I also think SPU_NUM_CORE_REGS is a bad name. I first thought this had something to do with core files. May I suggest SPU_NUM_VEC_REGS. Mark