From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27235 invoked by alias); 25 Oct 2011 20:30:43 -0000 Received: (qmail 27224 invoked by uid 22791); 25 Oct 2011 20:30:41 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 25 Oct 2011 20:30:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 3AC672BAB74; Tue, 25 Oct 2011 16:30:26 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id H-GE+GB9Kj7P; Tue, 25 Oct 2011 16:30:26 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id EE8742BAB53; Tue, 25 Oct 2011 16:30:25 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 08622145615; Tue, 25 Oct 2011 16:30:22 -0400 (EDT) Date: Tue, 25 Oct 2011 20:37:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [RFA/RFC] Restore old handling of multi-register variables Message-ID: <20111025203022.GQ19246@adacore.com> References: <1317675787-7351-1-git-send-email-brobecker@adacore.com> <201110061854.52856.pedro@codesourcery.com> <20111021233802.GJ19246@adacore.com> <201110252002.38708.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201110252002.38708.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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: 2011-10/txt/msg00683.txt.bz2 Hi Pedro, Thanks for the review. One question: > > +/* VALUE must be an lval_register value. If regnum is the value's > > + associated register number, and len the length of the values type, > > + read one or more registers in FRAME, starting with register REGNUM, > > + until we've read LEN bytes. */ > > + > > +void > > +read_frame_register_value (struct value *value, struct frame_info *frame) > > I think this should be in frame.c instead. value.c is for core > struct value stuff. That's what I thought originally too. The reason why I didn't put that function there is because I thought that the only way to access some of the fields was by using the deprecated_[...]_hack functions. So I thought we weren't supposed to be able to access those components of a struct value. But looking closer, I think I get the reason why it's called a hack and deprecated - it's to allow the previous usage of using the VALUE_something macros to change the value of the associated component. So I'm assuming that... regnum = VALUE_REGNUM (val) ... is OK. While... VALUE_REGNUM (val) = regnum ... is definitely frowned upon. I will make that change if you agree. > > + const int len = TYPE_LENGTH (value_type (value)); > > Do we need check_typedefs here? I haven't faced a situation where this might make a difference, but I think you are right. When taking the length of a type, it should never be a typedef. One might even wonder if it would make sense to adjust TYPE_LENGTH to to a check_typedef systematically... -- Joel