From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65501 invoked by alias); 25 Feb 2016 14:30:06 -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 65447 invoked by uid 89); 25 Feb 2016 14:30:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=agent, UD:collection.exp, collectionexp, collection.exp X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 25 Feb 2016 14:30:04 +0000 Received: from EUSAAHC008.ericsson.se (Unknown_Domain [147.117.188.96]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id D9.DC.12433.3BB0FC65; Thu, 25 Feb 2016 15:12:03 +0100 (CET) Received: from elxa4wqvvz1 (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.96) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 25 Feb 2016 09:30:01 -0500 References: <1456406745-27854-1-git-send-email-antoine.tremblay@ericsson.com> <56CF0EF9.70807@redhat.com> User-agent: mu4e 0.9.17; emacs 24.4.1 From: Antoine Tremblay To: Pedro Alves CC: Antoine Tremblay , Subject: Re: [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation In-Reply-To: <56CF0EF9.70807@redhat.com> Date: Thu, 25 Feb 2016 14:30:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00792.txt.bz2 Pedro Alves writes: > On 02/25/2016 01:25 PM, Antoine Tremblay wrote: >> When encoding the agent expression operation ax_reg or ax_reg_mask, the >> register number used is internal to GDB. However GDBServer expects a tdesc >> based number. >> >> This usually does not cause a problem since at the moment, for raw >> registers GDBServer R trace action ignores the register mask and just >> collects all registers. >> >> It can be a problem, however with pseudo registers on some platforms if the >> tdesc number doesn't match the GDB internal register number. >> >> This is the case with ARM, the upcoming ARM tracepoint support, fails >> these test cases without this patch: >> >> gdb.trace/collection.exp: collect register locals collectively:* >> >> GDBSever would exit with: unhandled register size >> Since the register number is not mapped. >> >> This patch fixes these issues by calling gdbarch_remote_register_number >> before encoding the register number in the ax_reg or ax_reg_mask operation. >> >> Tested on x86 native-gdbserver no regressions observed. > >> else >> { >> - int byte = reg / 8; >> + int byte = 0; > > No need to zero initialize. OK. > >> + >> + /* Get the remote register number. */ >> + reg = gdbarch_remote_register_number (ax->gdbarch, reg); >> + byte = reg / 8; >> >> /* Grow the bit mask if necessary. */ >> if (byte >= ax->reg_mask_len) >> > > OK with ChangeLog entry. Oops, yes I'll add a ChangeLog sorry about that. Thanks, Antoine