From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15834 invoked by alias); 5 Nov 2007 15:14:07 -0000 Received: (qmail 15824 invoked by uid 22791); 5 Nov 2007 15:14:07 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 05 Nov 2007 15:13:59 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id lA5FDtrb454992 for ; Mon, 5 Nov 2007 15:13:55 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id lA5FDtxF2338824 for ; Mon, 5 Nov 2007 16:13:55 +0100 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id lA5FDsmv007737 for ; Mon, 5 Nov 2007 16:13:54 +0100 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id lA5FDqfb007670; Mon, 5 Nov 2007 16:13:52 +0100 Message-Id: <200711051513.lA5FDqfb007670@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 5 Nov 2007 16:13:51 +0100 Subject: Re: [rfc] [04/09] Get rid of current_gdbarch (SIZEOF_FRAME_SAVED_REGS macro) To: drow@false.org (Daniel Jacobowitz), mark.kettenis@xs4all.nl, deuling@de.ibm.com Date: Mon, 05 Nov 2007 15:14:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20071105140039.GA30087@caradoc.them.org> from "Daniel Jacobowitz" at Nov 05, 2007 09:00:39 AM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-11/txt/msg00060.txt.bz2 Daniel Jacobowitz wrote: > On Mon, Nov 05, 2007 at 02:43:29PM +0100, Mark Kettenis wrote: > > > Date: Mon, 05 Nov 2007 13:21:29 +0100 > > > From: Markus Deuling > > > > > > Hi, > > > > > > this patch replaces SIZEOF_FRAME_SAVED_REGS macro by its expression. > > > > > > Tested by gdb_mbuild with alpha target. Is this ok to commit? > > > > I'm not thrilled, since this replaces a #define that has a sensible > > name with some sort of complicated expression, and therefore makes the > > code much more difficult to read. > > Ditto. frame_zalloc_saved_regs (frame)? As far as I can see SIZEOF_FRAME_SAVED_REGS is really just a remainder of the old frame logic that happens to be still in local use on alpha for some reason -- I do not think it makes sense to "generalize" it like that, it should be removed from common code. Note that the expression #define SIZEOF_FRAME_SAVED_REGS \ (sizeof (CORE_ADDR) * (gdbarch_num_regs (current_gdbarch)\ + gdbarch_num_pseudo_regs (current_gdbarch))) would likely be incorrect on most other platforms anyway nowadays. However, on the alpha, this is actually constant: num_regs is alway ALPHA_NUM_REGS, pseudo registers are not used, and sizeof (CORE_ADDR) should always be 8 in a gdb build targetting the alpha. In fact, there exists already an alpha-specific macro that should have just the correct value: #define ALPHA_REGISTER_BYTES (ALPHA_NUM_REGS * 8) Why not just replace SIZEOF_FRAME_SAVED_REGS with ALPHA_REGISTER_BYTES in the alpha files and remove it from common code? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com