From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115848 invoked by alias); 24 Feb 2016 18:33:58 -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 115830 invoked by uid 89); 24 Feb 2016 18:33:57 -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=s390specific, s390-specific, Hx-languages-length:2204, agent 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; Wed, 24 Feb 2016 18:33:57 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 04501804EC; Wed, 24 Feb 2016 18:33:56 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1OIXsa4019963; Wed, 24 Feb 2016 13:33:54 -0500 Message-ID: <56CDF792.3040604@redhat.com> Date: Wed, 24 Feb 2016 18:33: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: =?UTF-8?B?TWFyY2luIEtvxZtjaWVsbmlja2k=?= , Antoine Tremblay CC: 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> <56C7796B.3030504@redhat.com> <56CDF23A.8000007@redhat.com> <56CDF48B.5040008@0x04.net> In-Reply-To: <56CDF48B.5040008@0x04.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2016-02/txt/msg00745.txt.bz2 On 02/24/2016 06:20 PM, Marcin Kościelnicki wrote: > On 24/02/16 19:11, Pedro Alves wrote: >> On 02/22/2016 04:51 PM, Antoine Tremblay wrote: >>> >>> While looking at fixing this for all the archs involved it would be >>> much simpler to test if gdbserver would make use of it. >>> >>> As it is now, I'm concerned that calling gdbarch_remote_register_number >>> in ax_reg, ax_mask_reg could break things if the arch already considers >>> the gdb raw -> target raw mapping like s390 and x86 do already (I'm not >>> 100% sure the mapping is already ok)? >> >> WDTM? Where do they do this already? > > FWIW, I failed to look at the numbering used when I wrote the x86 and > s390 ax functions, so they're most likely wrong (I just copied the > regnum computation logic from pseudo_read/write, which uses gdb > numbers). s390 hasn't landed yet, so it's only x86 that you'd have to > fix now (and mips, I think, but that doesn't support tracepoints yet...). I don't think there's anything that needs fixing in the i386 implementation. The x86 implementation maps gdb pseudo register numbers to whatever raw gdb registers back the former up, like: ax_reg_mask (ax, I387_FSTAT_REGNUM (tdep)); That OK. The trouble is that in the end we send gdb numbers to the target in the ax, instead of tdesc/remote numbers. We never noticed because gdbserver always collects all raw registers anyway. Seems to me that the fix is to make ax_reg / ax_reg_mask take gdb raw numbers as input (as it does today), and then make it map those to tdesc/remote number just before it puts the reg number in the agent expression bytecode / reg mask. And that covers all archs. > > Testing this is possible if you write some conditions that involve > reading pseudo-registers (since ax_pseudo_register_push_stack will be > called), the problem is that I only implemented > ax_pseudo_register_collect for x86... > > Are you going to make some higher-level patch that will magically fix it > for my s390 patch, or do I have to fix that on my own? I haven't memorized your s390 patch :-) but there's probably nothing to do on the s390-specific bits. Thanks, Pedro Alves