From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27560 invoked by alias); 17 Jul 2002 19:50:02 -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 27523 invoked from network); 17 Jul 2002 19:49:57 -0000 Received: from unknown (HELO localhost.redhat.com) (216.138.202.10) by sources.redhat.com with SMTP; 17 Jul 2002 19:49:57 -0000 Received: from ges.redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 1D1923DE0; Wed, 17 Jul 2002 15:49:57 -0400 (EDT) Message-ID: <3D35CA64.7040502@ges.redhat.com> Date: Wed, 17 Jul 2002 13:04:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.0) Gecko/20020708 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joern Rennecke Cc: Elena Zannoni , 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> <3D2EC4B3.FDDB3D47@superh.com> <3D2EEE6B.9060708@ges.redhat.com> <3D35A89B.EE1EABC3@superh.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-07/txt/msg00370.txt.bz2 > Andrew Cagney wrote: > >> > >> > >> > 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. > >> >> Can i suggest comparing the SH with the MIPS or RS6000. > MIPS and RS6000 use varying register numbers for hardware registers > with identical name and function. I suppose that is due to historical > accident? If it happened once it would be an accident. In the good old days, GDB was built for a specific CPU. The register layout (along with the G packet) was hard wired using constants from the tm*.h files. Each CPU variant had a different register layout (for efficiency reasons). Targets like the SH would then add a limited form of CPU variant support using patches like: Mon May 15 21:27:27 2000 J"orn Rennecke * sh-tdep.c (sh_dsp_reg_names, sh3_dsp_reg_names): New arrays. (sh_processor_type_table): Add entries for bfd_mach_sh_dsp and bfd_mach_sh3_dsp. It was implemented by modifying the register name tables (along with a few other structures) directly. In the mean time, people have been replacing that code with code using the multi-arch framework. In doing this conversion, the technique of replacing hardwired constants with variables has proven most effective. This is because it lets the developer complete their multi-arch task independant of any other longer term changes that GDB may require. enjoy, Andrew