From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125879 invoked by alias); 25 Feb 2016 14:37:18 -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 125866 invoked by uid 89); 25 Feb 2016 14:37:18 -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=agent, collection.exp, UD:collection.exp, collectionexp 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:37:17 +0000 Received: from EUSAAHC008.ericsson.se (Unknown_Domain [147.117.188.96]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id E1.3D.12433.36D0FC65; Thu, 25 Feb 2016 15:19:15 +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:37:14 -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: Antoine Tremblay CC: Pedro Alves , Subject: Re: [PATCH] Map registers to remote numbers when encoding an ax_reg or ax_reg_mask operation In-Reply-To: Date: Thu, 25 Feb 2016 14:37:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00793.txt.bz2 Antoine Tremblay writes: > 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. > Pushed.