From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12249 invoked by alias); 19 Feb 2016 20:22:08 -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 12233 invoked by uid 89); 19 Feb 2016 20:22:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=masks, Hx-languages-length:1510, tracing, reaching X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 19 Feb 2016 20:22:06 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E4BDA8E68D; Fri, 19 Feb 2016 20:22:04 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1JKM3g8012215; Fri, 19 Feb 2016 15:22:04 -0500 Message-ID: <56C7796B.3030504@redhat.com> Date: Fri, 19 Feb 2016 20:22:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Antoine Tremblay , gdb-patches@sourceware.org, qiyaoltc@gmail.com Subject: Re: [PATCH v3] Enable tracing of pseudo-registers on ARM References: <1455910116-13237-1-git-send-email-antoine.tremblay@ericsson.com> In-Reply-To: <1455910116-13237-1-git-send-email-antoine.tremblay@ericsson.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00624.txt.bz2 On 02/19/2016 07:28 PM, Antoine Tremblay wrote: > +/* Map the pseudo register number REG to the proper register number. */ > + > +static int > +arm_pseudo_register_to_register (struct gdbarch *gdbarch, int reg) > +{ > + /* Get the remote/tdesc register number. */ > + double_regnum = gdbarch_remote_register_number (gdbarch, double_regnum); Hmm, I don't think it should be the responsibility of this function to map gdb to remote numbers though. Here I think we should just map gdb pseudo to gdb raw. > + > + return double_regnum; > +} > + > +/* Implementation of the ax_pseudo_register_collect gdbarch function. */ > + > +static int > +arm_ax_pseudo_register_collect (struct gdbarch *gdbarch, > + struct agent_expr *ax, int reg) > +{ > + int rawnum = arm_pseudo_register_to_register (gdbarch, reg); > + > + /* Error. */ > + if (rawnum < 0) > + return 1; > + > + ax_reg_mask (ax, rawnum); Hmm, seems to me that gdb raw -> target raw mapping should be either here, or perhaps even in ax_reg / ax_reg_mask? Consider the case of an expression requiring the collection of a _raw_ register, thus not even reaching here. Looking at ax-gdb.c/ax-general.c I don't see where is anything mapping gdb raw numbers to remote/tdesc numbers? So how does _that_ work? Are the register masks that gdb is computing actually wrong for the target, and things just happen to work because gdbserver ignores them and always collects all registers? Thanks, Pedro Alves