This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch, microblaze]: Port of Linux gdbserver
- From: Pedro Alves <palves at redhat dot com>
- To: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>, Michael Eager <eager at eagercon dot com>, Joel Brobecker <brobecker at adacore dot com>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Vinod Kathail <vinodk at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>
- Date: Wed, 17 Sep 2014 09:14:56 +0100
- Subject: Re: [Patch, microblaze]: Port of Linux gdbserver
- Authentication-results: sourceware.org; auth=none
- References: <2570e3c7-f55b-45cd-aa6e-7f4fa145f32a at BN1BFFO11FD002 dot protection dot gbl> <541052B5 dot 5080503 at eagercon dot com> <20140910134606 dot GO28404 at adacore dot com> <050c6461-c35c-441d-9b63-7636d9164e2e at BL2FFO11FD048 dot protection dot gbl> <20140910144313 dot GP28404 at adacore dot com> <89d100d8-4ebd-4f50-b5e9-59312124db6a at BL2FFO11FD057 dot protection dot gbl> <54131362 dot 1050009 at eagercon dot com> <daf38849-83e4-44a7-8903-a5251b5bbbbd at BY2FFO11FD021 dot protection dot gbl> <54186D95 dot 4000301 at redhat dot com> <84be59b9-9f3c-4789-8313-ca3b6061cd1d at BY2FFO11FD003 dot protection dot gbl>
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
- References:
- [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver
- Re: [Patch, microblaze]: Port of Linux gdbserver
- RE: [Patch, microblaze]: Port of Linux gdbserver