From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8731 invoked by alias); 5 Dec 2001 21:58:47 -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 8011 invoked from network); 5 Dec 2001 21:57:30 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 5 Dec 2001 21:57:30 -0000 Received: from cse.cygnus.com (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id NAA21035; Wed, 5 Dec 2001 13:57:27 -0800 (PST) Received: (from kev@localhost) by cse.cygnus.com (8.9.3/8.9.3) id OAA05798; Wed, 5 Dec 2001 14:56:41 -0700 Date: Wed, 05 Dec 2001 13:58:00 -0000 From: Kevin Buettner Message-Id: <1011205215641.ZM5797@ocotillo.lan> In-Reply-To: Elena Zannoni "Re: [RFA] config/rs6000/tm-rs6000.h STAB_REG_TO_REGNUM" (Nov 30, 4:14pm) References: <15367.50385.770078.559327@krustylu.cygnus.com> <3C07CD1A.4010403@cygnus.com> <15367.63139.561172.481628@krustylu.cygnus.com> X-Mailer: Z-Mail (4.0.1 13Jan97 Caldera) To: Elena Zannoni Subject: Re: [RFA] config/rs6000/tm-rs6000.h STAB_REG_TO_REGNUM Cc: gdb-patches@sources.redhat.com, vmakarov@redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2001-12/txt/msg00151.txt.bz2 On Nov 30, 4:14pm, Elena Zannoni wrote: > +/* Convert a dbx stab register number (from `r' declaration) to a gdb > + REGNUM */ > +static int > +rs6000_stab_reg_to_regnum (int num) > +{ > + int regnum; > + switch (num) > + { > + case 64: /* mq */ > + if (TARGET_ARCHITECTURE->mach == bfd_mach_ppc_601) > + regnum = 124; Hmm... I wish we had a symbolic constant for this one. (It took me a while to figure out why this register number was different.) > + else > + regnum = 70; I'd prefer to see PPC_MQ_REGNUM used here in place of the constant 70. > + break; > + case 65: regnum = 67; /* lr */ Likewise, here I'd like to see PPC_LR_REGNUM in place of 67. > + break; > + case 66: regnum = 68; /* ctr */ Likewise, here I'd like to see PPC_CTR_REGNUM in place of 68. > + break; > + case 76: regnum = 69; /* xer */ Likewise, here I'd like to see PPC_XER_REGNUM in place of 69. > + break; > + default: regnum = num; > + break; > + } > + return regnum; > +} > + > /* Store the address of the place in which to copy the structure the > subroutine will return. This is called from call_function. > > @@ -2340,6 +2366,7 @@ rs6000_gdbarch_init (struct gdbarch_info > rs6000_frameless_function_invocation); > set_gdbarch_frame_chain (gdbarch, rs6000_frame_chain); > set_gdbarch_frame_saved_pc (gdbarch, rs6000_frame_saved_pc); > + set_gdbarch_stab_reg_to_regnum (gdbarch, rs6000_stab_reg_to_regnum); After examining the gcc sources, it appears to me that we need this for Linux/PPC too. Either add a similar statement to the Linux/PPC part or move this statement up above the ``if (osabi == ELFOSABI_LINUX)'' statement. (I'd prefer the latter.) Thanks, Kevin