From: Michael Eager <eager@eagercon.com>
To: Ajit Kumar Agarwal <ajit.kumar.agarwal@xilinx.com>,
Pedro Alves <palves@redhat.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]: Fix for remote G Packet message too long error for baremetal.
Date: Mon, 30 Jun 2014 14:47:00 -0000 [thread overview]
Message-ID: <53B17884.1060202@eagercon.com> (raw)
In-Reply-To: <aff81eb4-90b2-4509-8790-6fcbede578b1@BL2FFO11FD005.protection.gbl>
On 06/30/14 03:32, Ajit Kumar Agarwal wrote:
> Based on the feedback, updated the patch with the review comments.
How has this been tested? Please be specific.
>
> [Patch, microblaze]: Fix for remote G Packet message too long error for baremetal.
>
> Prior to version MicroBlaze v8.10.a,EDK 13.1, XMD's gdbserver stub returned 57
> registers in response to GDB's G request. Starting with version MicroBlaze
> v8.10.a, EDK 13.1, XMD added the slr and shr register, for a count of 59
> registers. This patch adds these registers to the expected G response. This patch
> fixes the above problem for baremetal and also supports the backward compatibility.
>
> ChangeLog:
> 2014-06-26 Ajit Agarwal <ajitkum@xilinx.com>
>
> * microblaze-tdep.c (microblaze_register_names): Add
> the rshr and rslr register names.
> (microblaze_gdbarch_init): Use of tdesc_has_registers.
> Use of tdesc_find_feature. Use of tdesc_data_alloc.
> Use of tdesc_numbered_register. Use of
> microblaze_register_g_packet_guesses. Use of
> tdesc_use_registers. Use of set_gdbarch_register_type.
> (microblaze_register_g_packet_guesses): New.
> * microblaze-tdep.h (microblaze_reg_num): Add
> field MICROBLAZE_SLR_REGNUM MICROBLAZE_SHR_REGNUM
> MICROBLAZE_NUM_REGS and MICROBLAZE_NUM_CORE_REGS.
> (microblaze_frame_cache): Use of MICROBLAZE_NUM_REGS.
> * features/microblaze-core.xml: New file.
> * features/microblaze-stack-protect.xml: New file.
> * features/microblaze-with-stack-protect.c: New file.
> * features/microblaze-with-stack-protect.xml: New file.
> * features/microblaze.xml: New file.
> * features/microblaze.c: New file.
> * features/Makefile (microblaze-with-stack-protect): Add
> microblaze-with-stack-protect microblaze and
> microblaze-expedite.
> * regformats/microblaze-with-stack-protect.dat: New file.
> * regformats/microblaze.dat: New file.
> * doc/gdb.texinfo (MicroBlaze Features): New.
>
> Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
>
>> In this case is it correct to say
>> If (tdesc == NULL)
>> tdesc = tdesc_microblaze;
>>
>> instead of tdesc_microblaze_with_stack_protect?
>
>>> Yes.
>
> Instead of tdesc_microblaze_with_stack_protect if I use tdesc_microblaze the "G Packet message is too long" error is not resolved.
> The patch is unchanged with tdesc_microblaze_stack_protect.
>
> Thanks & Regards
> Ajit
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Tuesday, June 24, 2014 6:17 PM
> To: Ajit Kumar Agarwal
> Cc: gdb-patches@sourceware.org; Michael Eager; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
> Subject: Re: [Patch, microblaze]: Fix for remote G Packet message too long error for baremetal.
>
> On 06/24/2014 01:31 PM, Ajit Kumar Agarwal wrote:
>
>>>
>>> The default is choosen to assume stack protect to make compatible with the handling of stack protect registers in XMD Debugger.
>>
>>>> But you've already added the G packet size guess for that.
>>
>> In this case is it correct to say
>> If (tdesc == NULL)
>> tdesc = tdesc_microblaze;
>>
>> instead of tdesc_microblaze_with_stack_protect?
>
> Yes.
>
>>
>>>> -
>>>> + if (tdesc_data != NULL)
>>>> + {
>>>> + tdesc_use_registers (gdbarch, tdesc, tdesc_data);
>>>> + set_gdbarch_register_type (gdbarch,
>>>> + microblaze_register_type);
>>>
>>>>> Hmm, why is this set_gdbarch_register_type call necessary?
>>>
>>> /* Override tdesc_register_type to adjust the types of VFP
>>> registers for NEON. */
>>> This is done for arm target to set the different type for VFP
>>> registers for Neon with Boolean flags is set before this call for VFP
>>> registers. In the microblaze target it's not required for special
>>> case of stack protect as
>> the microblaze_register_type always return builtin_int for these stack protect registers.
>>
>> Right.
>
> Actually, not right... This comment doesn't really appear to be correct:
>
>> In the microblaze target it's not required for special case of stack
>> protect as the microblaze_register_type always return builtin_int for these stack protect registers.
>
>
> static struct type *
> microblaze_register_type (struct gdbarch *gdbarch, int regnum) {
> if (regnum == MICROBLAZE_SP_REGNUM)
> return builtin_type (gdbarch)->builtin_data_ptr;
>
> if (regnum == MICROBLAZE_PC_REGNUM)
> return builtin_type (gdbarch)->builtin_func_ptr;
>
> return builtin_type (gdbarch)->builtin_int; }
>
> MICROBLAZE_SP_REGNUM and MICROBLAZE_PC_REGNUM clearly aren't builtin_int...
>
> Doesn't your patch change the output of "ptype $sp" and "ptype $pc" ?
>
> That points at something missing in the target description:
>
>> +<!DOCTYPE feature SYSTEM "gdb-target.dtd"> <feature
>> +name="org.gnu.gdb.microblaze.core">
>> + <reg name="r1" bitsize="32"/>
> ...
>> + <reg name="rpc" bitsize="32"/>
>
> AFAICS, SP is "r1", and PC is "rpc". These should be marked with type="data_ptr" and type="code_ptr" .
>
>>
>>>>> As I mentioned before, please don't forget to document the new target features in the manual.
>>>
>>> Would you mind in explaining which manual need to be changed for the new target.
>>
>>>> The GDB manual, gdb/doc/gdb.texinfo, describes all the standard XML target features. See the "Standard Target Features" node, and add a new subsection for MicroBlaze.
>>
>> Thanks !! I will add subsection for Microblaze target.
>
> Thank you.
>
> --
> Pedro Alves
>
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
next prev parent reply other threads:[~2014-06-30 14:47 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 8:56 Ajit Kumar Agarwal
2014-06-12 14:52 ` Michael Eager
2014-06-17 11:17 ` Pedro Alves
2014-06-18 11:06 ` Ajit Kumar Agarwal
2014-06-18 14:58 ` Michael Eager
2014-06-18 15:10 ` Pedro Alves
2014-06-18 15:30 ` Pedro Alves
2014-06-18 15:40 ` Ajit Kumar Agarwal
2014-06-18 15:54 ` Pedro Alves
2014-06-18 15:57 ` Ajit Kumar Agarwal
2014-06-18 19:56 ` Ajit Kumar Agarwal
2014-06-23 13:18 ` Pedro Alves
2014-06-23 19:36 ` Ajit Kumar Agarwal
2014-06-24 9:13 ` Pedro Alves
2014-06-24 10:28 ` Ajit Kumar Agarwal
2014-06-24 12:06 ` Pedro Alves
2014-06-24 12:31 ` Ajit Kumar Agarwal
2014-06-24 12:46 ` Pedro Alves
2014-06-24 13:27 ` Ajit Kumar Agarwal
2014-06-30 10:32 ` Ajit Kumar Agarwal
2014-06-30 10:55 ` Pedro Alves
2014-06-30 11:13 ` Ajit Kumar Agarwal
2014-06-30 11:23 ` Pedro Alves
2014-06-30 16:29 ` Ajit Kumar Agarwal
2014-07-01 19:36 ` Ajit Kumar Agarwal
2014-07-20 12:57 ` Michael Eager
2014-06-30 14:47 ` Michael Eager [this message]
2014-07-01 16:07 ` Ajit Kumar Agarwal
2014-07-01 16:46 ` Michael Eager
2014-07-02 10:40 ` Ajit Kumar Agarwal
2014-06-24 14:11 ` Michael Eager
2014-06-25 13:00 ` Ajit Kumar Agarwal
2014-06-25 14:09 ` Pedro Alves
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=53B17884.1060202@eagercon.com \
--to=eager@eagercon.com \
--cc=ajit.kumar.agarwal@xilinx.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).