From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11474 invoked by alias); 4 Apr 2008 19:18:13 -0000 Received: (qmail 11461 invoked by uid 22791); 4 Apr 2008 19:18:11 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate8.de.ibm.com (HELO mtagate8.de.ibm.com) (195.212.29.157) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 04 Apr 2008 19:17:41 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate8.de.ibm.com (8.13.8/8.13.8) with ESMTP id m34JHdmn093902 for ; Fri, 4 Apr 2008 19:17:39 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.7) with ESMTP id m34JHd0Y3461264 for ; Fri, 4 Apr 2008 21:17:39 +0200 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 m34JHcau029479 for ; Fri, 4 Apr 2008 21:17:39 +0200 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 m34JHcNk029476; Fri, 4 Apr 2008 21:17:38 +0200 Message-Id: <200804041917.m34JHcNk029476@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Fri, 4 Apr 2008 21:17:38 +0200 Subject: Re: [RFC 1/5] Lazy register values To: drow@false.org (Daniel Jacobowitz) Date: Fri, 04 Apr 2008 19:29:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sourceware.org In-Reply-To: <20080331220656.GA22012@caradoc.them.org> from "Daniel Jacobowitz" at Mar 31, 2008 06:06:56 PM 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: 2008-04/txt/msg00108.txt.bz2 Hi Dan, > This patch allows a register value to be lazy. Lazy register values > are created by value_of_register_lazy and fetched by value_fetch_lazy, > like lazy memory values. I went through every check of value_lazy and > updated the ones which assumed this implied memory; the others guard > calls to value_fetch_lazy, which is still correct. I like this approach! However, I'm wondering about some of the value_lazy changes; for example in code like: v = allocate_value (elt_type); if (value_lazy (array)) set_value_lazy (v, 1); else memcpy (value_contents_writeable (v), value_contents (array) + elt_offs, elt_size); if (VALUE_LVAL (array) == lval_internalvar) VALUE_LVAL (v) = lval_internalvar_component; else VALUE_LVAL (v) = VALUE_LVAL (array); VALUE_ADDRESS (v) = VALUE_ADDRESS (array); VALUE_REGNUM (v) = VALUE_REGNUM (array); VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array); set_value_offset (v, value_offset (array) + elt_offs); (in value_subscripted_rvalue), it doesn't seem right to simply change the if to if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) If that function were ever called with a lazy register value, the "else" part would copy from value_contents of that lazy value, which is actually undefined. In fact, it would appear that not changing the if at all might be the correct solution anyway: the new value would then be marked as lazy register value with offset. Of course, that would then require that value_fetch_lazy allows and handles offsets for lazy register values. I've read through the rest of the patches in this series, and they look fine to me. I'd be happy to convert any of the platforms I have access to (s390, ppc, spu, ia64). Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com