From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19468 invoked by alias); 16 Apr 2014 15:29:33 -0000 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 Received: (qmail 19366 invoked by uid 89); 16 Apr 2014 15:29:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Wed, 16 Apr 2014 15:29:31 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2E2101160EB; Wed, 16 Apr 2014 11:29:29 -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 E5jlAzu5gyhW; Wed, 16 Apr 2014 11:29:29 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 058D41160CD; Wed, 16 Apr 2014 11:29:28 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 59209E041B; Wed, 16 Apr 2014 08:29:35 -0700 (PDT) Date: Wed, 16 Apr 2014 15:29:00 -0000 From: Joel Brobecker To: Ulrich Weigand Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Use address_from_register in dwarf2-frame.c:read_addr_from_reg Message-ID: <20140416152935.GU4250@adacore.com> References: <201404141700.s3EH0F7v020732@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201404141700.s3EH0F7v020732@d06av02.portsmouth.uk.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-04/txt/msg00314.txt.bz2 > ChangeLog: > > * gdbarch.sh (value_from_register): Make class "m" instead of "f". > Replace FRAME argument with FRAME_ID. > * gdbarch.c, gdbarch.h: Regenerate. > * findvar.c (default_value_from_register): Add GDBARCH argument; > replace FRAME by FRAME_ID. No longer call get_frame_id. > (value_from_register): Update call to gdbarch_value_from_register. > * value.h (default_value_from_register): Update prototype. > * s390-linux-tdep.c (s390_value_from_register): Update interface > and call to default_value_from_register. > * spu-tdep.c (spu_value_from_register): Likewise. > > * findvar.c (address_from_register): Remove TYPE argument. > Do not call value_from_register; use gdbarch_value_from_register > with null_frame_id instead. > * value.h (address_from_register): Update prototype. > * dwarf2-frame.c (read_addr_from_reg): Use address_from_register. > * dwarf2loc.c (dwarf_expr_read_addr_from_reg): Update for > address_from_register interface change. FWIW, I am not a specialist here, but it seemed reasonable to me. It took me a minute or two to figure out that you needed to make value_from_register a class "m" because you don't have access to the gdbarch via the frame anymore, so you have to have it passed directly. Perhaps it's worth a sentence in the revision log when you commit the patch? Thanks for the detailed comment explaining why we use a null_frame_id in address_from_register, and why it's OK to do so. Very helpful! -- Joel