From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17251 invoked by alias); 23 Feb 2016 19:34:09 -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 17231 invoked by uid 89); 23 Feb 2016 19:34:07 -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,SPF_PASS autolearn=ham version=3.3.2 spammy=coupled, objective, solely X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 23 Feb 2016 19:34:06 +0000 Received: from EUSAAHC005.ericsson.se (Unknown_Domain [147.117.188.87]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 23.A7.32102.214BCC65; Tue, 23 Feb 2016 20:33:39 +0100 (CET) Received: from elxa4wqvvz1 (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.87) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 23 Feb 2016 14:34:03 -0500 References: <1455910116-13237-1-git-send-email-antoine.tremblay@ericsson.com> <56C7796B.3030504@redhat.com> User-agent: mu4e 0.9.17; emacs 24.4.1 From: Antoine Tremblay To: Pedro Alves CC: Antoine Tremblay , , Subject: Re: [PATCH v3] Enable tracing of pseudo-registers on ARM In-Reply-To: <56C7796B.3030504@redhat.com> Date: Tue, 23 Feb 2016 19:34:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00694.txt.bz2 Pedro Alves writes: >> + >> + 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? > After more investigation, this can't be in ax_reg / ax_reg_mask for pseudo registers as this function is solely reponsible to encode the right number here. > 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? However yes it should be in ax_reg/ax_reg_mask for non-pseudo registers, but this is not the objective of this patch, I suggest that such a change be the subject of another patch maybe coupled with better gdbserver handling of the R action. I will send a v5 with the ax_pseudo_register_collect inside the arm_ax_pseudo_register_collect/arm_ax_pseudo_register_push stack function.