From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 62984 invoked by alias); 29 Jun 2018 12:08:13 -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 62240 invoked by uid 89); 29 Jun 2018 12:08:13 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.128.194, H*RU:209.85.128.194 X-HELO: mail-wr0-f194.google.com Received: from mail-wr0-f194.google.com (HELO mail-wr0-f194.google.com) (209.85.128.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 29 Jun 2018 12:08:11 +0000 Received: by mail-wr0-f194.google.com with SMTP id h10-v6so8612933wrq.8 for ; Fri, 29 Jun 2018 05:08:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=DELHiZPBCaNla17Y7W95lsgw/yd4HPM3EbEBy4W266E=; b=Hh0Yd3uC3UVII0hH4ISJ3f38o3/rH7+vIMZAx16AEatU1eLdimkfsv9HtTNHrzzpPj tijm+VqRHDfJbMuHgllZqDASRrl9dkOKjsjR1ZI75DQtl0O0ciRcJCpFvkLa3K6ISM5x wufM4EhKfWjCFZ06JTy+qLps1tgOzIZOQCEYPXlzUk2F1GdX6Za6WYJ2LlMFlUJyeQRW mnMVoO/SwYYs3t+pdBpU7M8MRwaTMp3cydH+q5yDDv1W0FdU7jeJZOfFOQARSzIJJf6X HZbnnWPNA7AzFvLdMg2Ag9vYZTr8K8JCnerzzjTj0zsCkhZ3THizPR3Hk09l3VryOA38 M6OQ== Return-Path: Received: from localhost (host81-140-212-80.range81-140.btcentralplus.com. [81.140.212.80]) by smtp.gmail.com with ESMTPSA id i14-v6sm7947637wro.11.2018.06.29.05.08.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 29 Jun 2018 05:08:09 -0700 (PDT) Date: Fri, 29 Jun 2018 12:08:00 -0000 From: Andrew Burgess To: Sebastian Huber Cc: gdb-patches@sourceware.org, Jim Wilson Subject: Re: [PATCH] gdb: Prefer RISC-V register name "s0" over "fp" Message-ID: <20180629120807.GG15881@embecosm.com> References: <20180629085731.8439-1-sebastian.huber@embedded-brains.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180629085731.8439-1-sebastian.huber@embedded-brains.de> X-Fortune: If it heals good, say it. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00708.txt.bz2 * Sebastian Huber [2018-06-29 10:57:31 +0200]: > The "fp" register name is an alias for "s0" which is an alias for "x8". > The "fp" name is not understood by the Binutils and thus not used by > GCC. GCC does not emit a frame pointer with common optimization options > such as -Og or -O2. > > It is still possible to use the "fp" register name, e.g. > > (gdb) p/x $fp > $1 = 0x800367c8 > > works. > > However, in the register dump you see now: > > (gdb) info registers > ... > t2 0xffffffffffffffff 18446744073709551615 > s0 0x800367c8 0x800367c8 > s1 0x80033280 2147693184 > ... > > gdb/ > > * riscv-tdep.c (riscv_register_aliases): Swap "fp" and "s0" > entries. This is fine with me based on GCC no generating $fp relative code by default. However, I think we need to get binutils fixed too, $fp _is_ a valid register name. Thanks, Andrew > --- > gdb/riscv-tdep.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c > index 154567136e..4c68ef73fc 100644 > --- a/gdb/riscv-tdep.c > +++ b/gdb/riscv-tdep.c > @@ -128,8 +128,8 @@ static const struct register_alias riscv_register_aliases[] = > { "t0", 5 }, > { "t1", 6 }, > { "t2", 7 }, > - { "fp", 8 }, > { "s0", 8 }, > + { "fp", 8 }, > { "s1", 9 }, > { "a0", 10 }, > { "a1", 11 }, > -- > 2.13.7 >