From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29837 invoked by alias); 12 Jul 2002 11:59:51 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 29822 invoked from network); 12 Jul 2002 11:59:49 -0000 Received: from unknown (HELO uk.superh.com) (193.128.105.170) by sources.redhat.com with SMTP; 12 Jul 2002 11:59:49 -0000 Received: from sh-uk-ex01.uk.w2k.superh.com (sh-uk-ex01 [192.168.16.17]) by uk.superh.com (8.11.6+Sun/8.11.6) with ESMTP id g6CBrLk26116; Fri, 12 Jul 2002 12:53:21 +0100 (BST) Received: from superh.com ([192.168.16.50]) by sh-uk-ex01.uk.w2k.superh.com with Microsoft SMTPSVC(5.0.2195.4905); Fri, 12 Jul 2002 12:58:55 +0100 Message-ID: <3D2EC4B3.FDDB3D47@superh.com> Date: Fri, 12 Jul 2002 05:47:00 -0000 From: Joern Rennecke Organization: SuperH UK Ltd. X-Accept-Language: en MIME-Version: 1.0 To: Elena Zannoni CC: gdb-patches@sources.redhat.com Subject: Re: Unreviewed patches References: <3D205F19.1B99290F@superh.com> <15648.31077.572892.886182@localhost.redhat.com> <3D208CF1.AB7AC45A@superh.com> <15648.51312.63195.689336@localhost.redhat.com> <3D20D12F.6AB9E865@superh.com> <15649.65211.660582.965251@localhost.redhat.com> <3D236046.4FAE0419@superh.com> <15662.14806.918730.224362@localhost.redhat.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 12 Jul 2002 11:58:55.0764 (UTC) FILETIME=[7F9FBD40:01C2299B] X-SW-Source: 2002-07/txt/msg00262.txt.bz2 Elena Zannoni wrote: > For the gdb sh-tdep.c part, I have a few comments. > There is no need for a prototype. I removed all of those a few months back. Ok, I'll place the new function so that it needs no prototype. But you have to keep in mind that that makes the call graph more rigid, unless you like to move code around a lot. > You should just move the new function to before the gdbarch_init one. > Instead of adding another enum, you should use > > struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); > and then > tdep-><...>_REGNUM > > If you need new register numbers for the dsp case, just add > them to the tdep structure. I think the stashing of constants into the tdep structure is basically wrong. You separate the register names arrays from the literals that describe their positions, and you replicate the literals up to four times. The tdep structure and the sh_gdbarch_init function are so large that you have lost track of the things that really belong in tdep, like sh_show_regs, skip_prologue_hard_way, and do_pseudo_register. If you look at other gdb ports, you'll see that they put only variable stuff in tdep, and use enums for constants. The sh gdb register naming scheme also doesn't scale well, the names are again duplicated multiple times. I have a scheme that names each register just once, and enumerates it only once - in an enum, of course. But I thought we should first sort out the simulator <-> gdb and gcc -> gdb interfaces before we start on the gdb internals. -- -------------------------- SuperH 2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ T:+44 1454 462330