Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Mark Kettenis" <mark.kettenis@xs4all.nl>
To: "Ulrich Weigand" <uweigand@de.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA][3/5] New port: Cell BE SPU (the port itself)
Date: Sat, 11 Nov 2006 21:19:00 -0000	[thread overview]
Message-ID: <13947.82.92.89.47.1163279928.squirrel@webmail.xs4all.nl> (raw)
In-Reply-To: <200611111839.kABId7in031579@d12av02.megacenter.de.ibm.com>

>  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


  reply	other threads:[~2006-11-11 21:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-11 18:39 Ulrich Weigand
2006-11-11 21:19 ` Mark Kettenis [this message]
2006-11-12 15:38   ` Ulrich Weigand
2006-11-12 21:42     ` Mark Kettenis
2006-11-12 22:12       ` Daniel Jacobowitz
2006-11-13 12:27         ` Ulrich Weigand
2006-11-13 12:43           ` Mark Kettenis
2006-11-13 13:48             ` Daniel Jacobowitz
2006-11-13 19:50             ` Jim Blandy
2006-11-18  0:10             ` Ulrich Weigand
2006-11-18  6:03               ` Daniel Jacobowitz
2006-11-18 11:10                 ` Ulrich Weigand
2006-11-18 16:41                   ` Daniel Jacobowitz
2006-11-18 17:35               ` Mark Kettenis
2006-11-21 20:22                 ` Ulrich Weigand
2006-11-21 20:40                   ` Daniel Jacobowitz
2006-11-21 21:32                   ` Mark Kettenis
2006-11-22 14:13                     ` Ulrich Weigand
2006-11-22 18:43                       ` Daniel Jacobowitz
2006-11-22 19:46                         ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13947.82.92.89.47.1163279928.squirrel@webmail.xs4all.nl \
    --to=mark.kettenis@xs4all.nl \
    --cc=gdb-patches@sourceware.org \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox