From: Ajit Kumar Agarwal <ajit.kumar.agarwal@xilinx.com>
To: Pedro Alves <palves@redhat.com>,
Michael Eager <eager@eagercon.com>,
Joel Brobecker <brobecker@adacore.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
Vinod Kathail <vinodk@xilinx.com>,
Vidhumouli Hunsigida <vidhum@xilinx.com>,
"Nagaraju Mekala" <nmekala@xilinx.com>
Subject: RE: [Patch, microblaze]: Port of Linux gdbserver
Date: Wed, 17 Sep 2014 06:16:00 -0000 [thread overview]
Message-ID: <84be59b9-9f3c-4789-8313-ca3b6061cd1d@BY2FFO11FD003.protection.gbl> (raw)
In-Reply-To: <54186D95.4000301@redhat.com>
Hello Pedro:
-----Original Message-----
From: Pedro Alves [mailto:palves@redhat.com]
Sent: Tuesday, September 16, 2014 10:34 PM
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
On 09/16/2014 07:41 AM, Ajit Kumar Agarwal wrote:
>>> >>This is identical to microblaze-with-stack-protect.c. Both
>>> >>specify tdesc_create_feature (result, "org.gnu.gdb.microblaze.core"); Why is this needed?
> 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);
}
/me looks at code
>>Oh, microblaze_gdbarch_init is incomplete...
/* Check any target description for validity. */
>> if (tdesc_has_registers (tdesc))
>>{
>>const struct tdesc_feature *feature;
>>int valid_p;
>> int i;
>>feature = tdesc_find_feature (tdesc,
>> "org.gnu.gdb.microblaze.core");
>>if (feature == NULL)
>>return NULL;
>>tdesc_data = tdesc_data_alloc ();
>>valid_p = 1;
>>for (i = 0; i < MICROBLAZE_NUM_CORE_REGS; i++)
>> valid_p &= tdesc_numbered_register (feature, tdesc_data, i,
>> microblaze_register_names[i]);
>>feature = tdesc_find_feature (tdesc,
>> "org.gnu.gdb.microblaze.stack-protect");
>> if (feature != NULL)
>> {
>> valid_p = 1;
>>valid_p &= tdesc_numbered_register (feature, tdesc_data,
>> MICROBLAZE_SLR_REGNUM,
>> "rslr");
>>valid_p &= tdesc_numbered_register (feature, tdesc_data,
>> MICROBLAZE_SHR_REGNUM,
>> "rshr");
>>}
>>}
>>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
next prev parent reply other threads:[~2014-09-17 6:16 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-10 10:14 Ajit Kumar Agarwal
2014-09-10 13:31 ` Michael Eager
2014-09-10 13:46 ` Joel Brobecker
2014-09-10 14:23 ` Ajit Kumar Agarwal
2014-09-10 14:39 ` Michael Eager
2014-09-10 14:59 ` Ajit Kumar Agarwal
2014-09-10 15:12 ` Ajit Kumar Agarwal
2014-09-10 15:27 ` Michael Eager
2014-09-10 15:30 ` Ajit Kumar Agarwal
[not found] ` <54106FCF.4060305@eagercon.com>
2014-09-10 15:51 ` Ajit Kumar Agarwal
2014-09-10 14:43 ` Joel Brobecker
[not found] ` <40bc6b14-7a94-4118-9e88-c76dc03a0a67@BN1BFFO11FD016.protection.gbl>
[not found] ` <20140910155436.GR28404@adacore.com>
2014-09-10 16:10 ` Ajit Kumar Agarwal
2014-09-12 8:01 ` Ajit Kumar Agarwal
2014-09-12 8:39 ` Ajit Kumar Agarwal
2014-09-12 15:38 ` Michael Eager
2014-09-16 6:42 ` Ajit Kumar Agarwal
2014-09-16 12:06 ` Michael Eager
2014-09-17 9:36 ` Ajit Kumar Agarwal
2014-09-17 14:12 ` Michael Eager
2014-09-16 17:04 ` Pedro Alves
2014-09-17 6:16 ` Ajit Kumar Agarwal [this message]
[not found] ` <54194300.5090908@redhat.com>
2014-09-17 8:20 ` Ajit Kumar Agarwal
2014-09-23 12:49 ` Ajit Kumar Agarwal
2014-09-30 11:43 ` Pedro Alves
2014-09-30 13:27 ` Ajit Kumar Agarwal
[not found] ` <542AB217.9040307@redhat.com>
2014-09-30 14:21 ` Ajit Kumar Agarwal
2014-10-08 13:52 [Patch] Microblaze: " Ajit Kumar Agarwal
2014-10-09 16:29 ` Michael Eager
2014-10-09 18:54 ` Ajit Kumar Agarwal
2014-10-09 23:42 ` Michael Eager
2014-10-13 16:00 ` Ajit Kumar Agarwal
2014-10-13 17:49 ` Michael Eager
2014-10-14 3:03 ` Ajit Kumar Agarwal
2014-10-14 15:07 ` Michael Eager
2014-10-14 15:33 ` Ajit Kumar Agarwal
2014-10-15 13:27 ` Pedro Alves
2014-10-17 19:22 ` Ajit Kumar Agarwal
2014-12-15 18:02 ` Pedro Alves
2014-12-15 18:13 ` Michael Eager
[not found] ` <03105cda11564e60a2ef365cbe36688e@BY2FFO11FD023.protection.gbl>
2014-12-18 16:10 ` Michael Eager
2014-12-18 8:57 ` Ajit Kumar Agarwal
2014-12-18 11:28 ` Pedro Alves
2014-12-18 16:53 ` Ajit Kumar Agarwal
2014-12-18 17:40 ` Pedro Alves
2014-12-19 8:27 ` Ajit Kumar Agarwal
2014-12-19 10:56 ` Pedro Alves
2014-12-19 10:26 ` Ajit Kumar Agarwal
2014-12-19 11:02 ` Pedro Alves
2014-12-19 18:06 ` Ajit Kumar Agarwal
2014-11-26 12:13 ` Ajit Kumar Agarwal
2014-12-15 16:08 ` Ajit Kumar Agarwal
2014-10-08 14:59 Ajit Kumar Agarwal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84be59b9-9f3c-4789-8313-ca3b6061cd1d@BY2FFO11FD003.protection.gbl \
--to=ajit.kumar.agarwal@xilinx.com \
--cc=brobecker@adacore.com \
--cc=eager@eagercon.com \
--cc=gdb-patches@sourceware.org \
--cc=nmekala@xilinx.com \
--cc=palves@redhat.com \
--cc=vidhum@xilinx.com \
--cc=vinodk@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox