This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [Patch, microblaze]: Fix for remote G Packet message too long error for baremetal.


Hello Pedro:

Please find the updated patch. Incorporated review comments.

    [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-07-02  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

>>If the G guess is triggering OK, and so GDB picks the description with the stack protect registers based on the G packet size, why would the default target description matter at all?  If it >>does, then something sounds broken.
>>What are you doing different from the other ports that use this mechanism?
>>Please debug this a bit further.

Thanks for the above suggestion. The G guesses were not triggering because of the following code.

  register_remote_g_packet_guess (gdbarch,
                                  MICROBLAZE_NUM_CORE_REGS,
                                  tdesc_microblaze);

  register_remote_g_packet_guess (gdbarch,
                                   MICROBLAZE_NUM_REGS,
                                  tdesc_microblaze_with_stack_protect);

I have changed the above code with

  register_remote_g_packet_guess (gdbarch,
                                  4 * MICROBLAZE_NUM_CORE_REGS,
                                  tdesc_microblaze);

  register_remote_g_packet_guess (gdbarch,
                                  4 * MICROBLAZE_NUM_REGS,
                                  tdesc_microblaze_with_stack_protect);

With this change the G Packet guesses are triggered and the 'info registers" were not showing stack protect registers for the design where stack protect registers are not supported.
With the design where the stack protect registers are supported "info registers" were showing the stack protect registers. The target remote command are working fine with and without stack protect registers designs. The default target description is also been set with tdesc_microblaze as you have suggested.

Thanks & Regards
Ajit
-----Original Message-----
From: Pedro Alves [mailto:palves@redhat.com] 
Sent: Monday, June 30, 2014 4:53 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/30/2014 12:13 PM, Ajit Kumar Agarwal wrote:
> -----Original Message-----
> From: Pedro Alves [mailto:palves@redhat.com]
> Sent: Monday, June 30, 2014 4:25 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/30/2014 11:32 AM, Ajit Kumar Agarwal wrote:
>>     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.
> 
>>> Then it sounds like the G packet size guesses you're adding aren't actually triggering.  Why?
> 
> I have checked the guesses are actually triggering as it works fine 
> with backward compatibility with the Designs there is no stack-protect registers. For the Design that has the Stack protect register, it reports the message " G packet too long ".

If the G guess is triggering OK, and so GDB picks the description with the stack protect registers based on the G packet size, why would the default target description matter at all?  If it does, then something sounds broken.
What are you doing different from the other ports that use this mechanism?
Please debug this a bit further.

--
Pedro Alves

Attachment: 0001-Patch-microblaze-Fix-for-remote-G-Packet-message-too.patch
Description: 0001-Patch-microblaze-Fix-for-remote-G-Packet-message-too.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]