From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13184 invoked by alias); 17 Sep 2014 08:15:11 -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 13166 invoked by uid 89); 17 Sep 2014 08:15:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 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, 17 Sep 2014 08:15:08 +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 (8.14.4/8.14.4) with ESMTP id s8H8F1aw002465 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Sep 2014 04:15:01 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8H8EvAZ028440; Wed, 17 Sep 2014 04:14:58 -0400 Message-ID: <54194300.5090908@redhat.com> Date: Wed, 17 Sep 2014 08:15:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.0 MIME-Version: 1.0 To: Ajit Kumar Agarwal , Michael Eager , Joel Brobecker CC: "gdb-patches@sourceware.org" , Vinod Kathail , Vidhumouli Hunsigida , Nagaraju Mekala Subject: Re: [Patch, microblaze]: Port of Linux gdbserver References: <2570e3c7-f55b-45cd-aa6e-7f4fa145f32a@BN1BFFO11FD002.protection.gbl> <541052B5.5080503@eagercon.com> <20140910134606.GO28404@adacore.com> <050c6461-c35c-441d-9b63-7636d9164e2e@BL2FFO11FD048.protection.gbl> <20140910144313.GP28404@adacore.com> <89d100d8-4ebd-4f50-b5e9-59312124db6a@BL2FFO11FD057.protection.gbl> <54131362.1050009@eagercon.com> <54186D95.4000301@redhat.com> <84be59b9-9f3c-4789-8313-ca3b6061cd1d@BY2FFO11FD003.protection.gbl> In-Reply-To: <84be59b9-9f3c-4789-8313-ca3b6061cd1d@BY2FFO11FD003.protection.gbl> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-09/txt/msg00569.txt.bz2 On 09/17/2014 07:16 AM, Ajit Kumar Agarwal wrote: > From: Pedro Alves [mailto:palves@redhat.com] > On 09/16/2014 07:41 AM, Ajit Kumar Agarwal wrote: >> This is needed as gdbserver code expects the register pc as "pc" instead of "rpc" for baremetel. The microblaze-linux-core.xml is changed from "rpc" to "pc" for gdbserver code to work. > >>> This doesn't make much sense to me. Can you expand please? Why would you want the register to be named differently on Linux? We've defined the >>org.gnu.gdb.microblaze.core with "rpc", presumably because that's what the architecture calls that core register. > >>> Not reporting all the registers with the exact names GDB reports should be making GDB consider the description invalid. Aren't you seeing that happen? > > In Microblaze gdbserver code linux-microblaze-low.c we have are passing the "pc" in supply_register_by_name and the baremetal org.gnu.gdb.microblaze.core its been defined as "rpc". Due to this in regcache.c where the find_regno function compares "pc" passed with "rpc" and reports failures. That is why we have create microblaze-linux-core.xml to have "pc" instead of "rpc". > > static void > microblaze_set_pc (struct regcache *regcache, CORE_ADDR pc) > { > unsigned long newpc = pc; > supply_register_by_name (regcache, "pc", &newpc); > } But that is port-specific code that you're adding with this patch. So just write instead: supply_register_by_name (regcache, "rpc", &newpc); Why wouldn't that work? But maybe I'm missing something. >>> Note nothing is done with valid_p. It's write-only. Compare with other ports, like arm-tdep.c or mips-tdep.c. > > Would look into this and will make the modification. Thanks. Pedro Alves