From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22974 invoked by alias); 18 Oct 2004 20:32:25 -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 22955 invoked from network); 18 Oct 2004 20:32:23 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 18 Oct 2004 20:32:23 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9IKWHpD005551 for ; Mon, 18 Oct 2004 16:32:22 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9IKWBr00467; Mon, 18 Oct 2004 16:32:11 -0400 Received: from msnyder8600 (vpn26-3.sfbay.redhat.com [172.16.26.3]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with SMTP id i9IKW8Vn018379; Mon, 18 Oct 2004 16:32:09 -0400 Message-ID: <004401c4b551$8c4691b0$5ca56b80@msnyder8600> From: "Michael Snyder" To: "Kevin Buettner" Cc: , "Joel Brobecker" , References: <41706E26.3050804@redhat.com> <20041015231816.075969be@saguaro> Subject: Re: [RFA] ppc/rs6000: use gdbarch_ps_regnum Date: Mon, 18 Oct 2004 20:32:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00311.txt.bz2 > On Fri, 15 Oct 2004 17:41:10 -0700 > Michael Snyder wrote: > >> I just happened to notice this. Gdbarch implements PS_REGNUM, >> so there's no reason to keep it privately in the tdep struct. > > Is there some good reason to move it out of the private tdep > struct and into the public eye? > > I'll note that ppc_fp0_regnum is also in the tdep struct, and > something comparable (FP0_REGNUM) is also in the gdbarch name space. > Yet, rs6000-tdep does not set FP0_REGNUM via set_gdbarch_fp0_regnum() > and I happen to like it this way. The reason is that there's no good > reason (that I know of) for the other parts of GDB to be aware of this > register numbering. Also, putting the indexes into the tdep struct > gives a uniform mechanism of accessing (most of) the PPC related > register numbers. If we were to move either the PS or FP0 register > number back out to gdbarch, then we'd be accessing some of the > registers via one mechanism and these others via another. > (Unfortunately, we still have SP_REGNUM and PC_REGNUM in gdbarch land. > But there are good reasons for other, non-ppc specific portions to > know about these register numbers.) No special reason -- I just figured that if there was a public interface, there might be some motivation to use that instead of a private interface. PS_REGNUM is referred to quite a lot -- but mostly in other tdep and nat files that are orthogonal to this one. The major exception being std-regs.c, which sort-of groups PS in there with PC, SP and (cover your ears, Andrew) FP. I have no attachment to it, though, if you prefer it the way it is.