public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [Patch, microblaze]: Add slr and shr regs
@ 2014-05-23  6:54 Ajit Kumar Agarwal
  2014-05-23  7:34 ` Michael Eager
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Ajit Kumar Agarwal @ 2014-05-23  6:54 UTC (permalink / raw)
  To: gdb-patches
  Cc: Joel Brobecker, Michael Eager, Vinod Kathail,
	Vidhumouli Hunsigida, Nagaraju Mekala

[-- Attachment #1: Type: text/plain, Size: 2682 bytes --]

  Hello Michael:

  Based on the feedback, resubmitting the patch once again with all your replies and suggestions.

    [Patch, microblaze]: Add slr and shr regs
    
    This patch add the support of slr and shr regs and also solves the problem
    related to process_g_packet where the buf_len > 2 * rsa->sizeof_g_packet
    and throwing the Error that 'g' packet message reply is too long. This is
    because the buf_len calculated in the init_remote_state function for
    microblaze target is based On the sizeof_g_packet and remote_packet_size
    and the memory_packet_config->size. The sizeof_g_packet is 236 because the
    number of reg num is 59 and 2* sizeof_g_packet comes to 472 .With shr and
    shl entry and the buf_len is 472. This does not match the greater than
    conditional statement  and works fine. Without shr and shl entry,the
    sizeof_g_packets comes to 57*4 *2 = 456.  This doesn't match the criteria
    in the process_g_packet function  leading to throwing of error message as
    " 'g' packet message reply is too long".
    
    ChangeLog:
    2014-05-20 Ajit Agarwal <ajitkum@xilinx.com>
    
        * gdb/gdbserver/Makefile.in (microblaze-linux.c): New rule.
    
        * gdb/microblaze-tdep.c (microblaze_register_names): Added
        the rshr and rslr register names.
    
        * gdb/microblaze-tdep.h (microblaze_reg_num): Addition of
        field MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
        (microblaze_frame_cache): Change in the index of
        register_offsets.
    
        * gdb/regformats/reg-microblaze.dat: New Register data file.
    
    Signed-off-by:Ajit Agarwal ajitkum@xilinx.com

I am confused with your comments whereas it seems I have answered all queries(including yours) and incorporated your review comments. 
Just to make sure I repeat, see below answers to your queries.

>>Make sure you address my comments and incorporate my suggestions as well.

I made sure that the description is not too long at the same time it gives the complete picture. Hope this addresses your comments.

>>>I asked what is running on the target which is returning a different sized G packet.

It is  the gdbserver which is checking for the buf_len and 2* size_of_g_packet  in process_g_packet function which is not matching 
and returning with error mentioning that 'g' packet is too long. The G Packet initialization is done in init_remote_state function which 
is all happening when tar remote machine:1234 command is used.
Hope this clarifies as this error is nothing to do with what is running on target. On target the XMD is running.

Thanks & Regards
Ajit


[-- Attachment #2: 0001-Patch-microblaze-Add-slr-and-shr-regs.patch --]
[-- Type: application/octet-stream, Size: 5022 bytes --]

From a939e32e0012fb611fcc7831750ddd925e9718b1 Mon Sep 17 00:00:00 2001
From: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
Date: Wed, 21 May 2014 18:55:23 +0530
Subject: [PATCH] [Patch, microblaze]: Add slr and shr regs

This patch add the support of slr and shr regs and also solves the problem
related to process_g_packet where the buf_len > 2 * rsa->sizeof_g_packet
and throwing the Error that 'g' packet message reply is too long. This is
because the buf_len calculated in the init_remote_state function for
microblaze target is based On the sizeof_g_packet and remote_packet_size
and the memory_packet_config->size. The sizeof_g_packet is 236 because the
number of reg num is 59 and 2* sizeof_g_packet comes to 472 .With shr and
shl entry and the buf_len is 472. This does not match the greater than
conditional statement  and works fine. Without shr and shl entry,the
sizeof_g_packets comes to 57*4 *2 = 456.  This doesn't match the criteria
in the process_g_packet function  leading to throwing of error message as
" 'g' packet message reply is too long".

ChangeLog:
2014-05-20 Ajit Agarwal <ajitkum@xilinx.com>

	* gdb/gdbserver/Makefile.in (microblaze-linux.c): New rule.

	* gdb/microblaze-tdep.c (microblaze_register_names): Added
	the rshr and rslr register names.

	* gdb/microblaze-tdep.h (microblaze_reg_num): Addition of
	field MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
	(microblaze_frame_cache): Change in the index of
	register_offsets.

	* gdb/regformats/reg-microblaze.dat: New Register data file.

Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
---
 gdb/gdbserver/Makefile.in         |    5 +++-
 gdb/microblaze-tdep.c             |    3 +-
 gdb/microblaze-tdep.h             |    6 +++-
 gdb/regformats/reg-microblaze.dat |   41 +++++++++++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 4 deletions(-)
 create mode 100644 gdb/regformats/reg-microblaze.dat

diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index f773fa2..2454003 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -348,7 +348,8 @@ clean:
 	rm -f amd64-avx.c amd64-avx-linux.c
 	rm -f amd64-mpx.c amd64-mpx-linux.c
 	rm -f amd64-avx512.c amd64-avx512-linux.c
-	rm -f i386-mmx.c i386-mmx-linux.c
+	rm -f i386-mmx.c i386-mmx-linux.c 
+	rm -f microblaze-linux.c
 	rm -f x32.c x32-linux.c
 	rm -f x32-avx.c x32-avx-linux.c
 	rm -f x32-avx512.c x32-avx512-linux.c
@@ -614,6 +615,8 @@ reg-cf.c : $(srcdir)/../regformats/reg-cf.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-cf.dat reg-cf.c
 mips-linux.c : $(srcdir)/../regformats/mips-linux.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips-linux.dat mips-linux.c
+microblaze-linux.c : $(srcdir)/../regformats/reg-microblaze.dat $(regdat_sh)
+	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/reg-microblaze.dat mips-linux.c
 mips-dsp-linux.c : $(srcdir)/../regformats/mips-dsp-linux.dat $(regdat_sh)
 	$(SHELL) $(regdat_sh) $(srcdir)/../regformats/mips-dsp-linux.dat mips-dsp-linux.c
 mips64-linux.c : $(srcdir)/../regformats/mips64-linux.dat $(regdat_sh)
diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c
index 14c1b52..4d63909 100644
--- a/gdb/microblaze-tdep.c
+++ b/gdb/microblaze-tdep.c
@@ -73,7 +73,8 @@ static const char *microblaze_register_names[] =
   "rpc",  "rmsr", "rear", "resr", "rfsr", "rbtr",
   "rpvr0", "rpvr1", "rpvr2", "rpvr3", "rpvr4", "rpvr5", "rpvr6",
   "rpvr7", "rpvr8", "rpvr9", "rpvr10", "rpvr11",
-  "redr", "rpid", "rzpr", "rtlbx", "rtlbsx", "rtlblo", "rtlbhi"
+  "redr", "rpid", "rzpr", "rtlbx", "rtlbsx", "rtlblo", "rtlbhi",
+  "rslr", "rshr"
 };
 
 #define MICROBLAZE_NUM_REGS ARRAY_SIZE (microblaze_register_names)
diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
index a532092..f7acfd6 100644
--- a/gdb/microblaze-tdep.h
+++ b/gdb/microblaze-tdep.h
@@ -42,7 +42,7 @@ struct microblaze_frame_cache
   int fp_regnum;
 
   /* Offsets to saved registers.  */
-  int register_offsets[57];	/* Must match MICROBLAZE_NUM_REGS.  */
+  int register_offsets[59];	/* Must match MICROBLAZE_NUM_REGS.  */
 
   /* Table of saved registers.  */
   struct trad_frame_saved_reg *saved_regs;
@@ -107,7 +107,9 @@ enum microblaze_regnum
   MICROBLAZE_RTLBX_REGNUM,
   MICROBLAZE_RTLBSX_REGNUM,
   MICROBLAZE_RTLBLO_REGNUM,
-  MICROBLAZE_RTLBHI_REGNUM
+  MICROBLAZE_RTLBHI_REGNUM,
+  MICROBLAZE_SLR_REGNUM,
+  MICROBLAZE_SHR_REGNUM
 };
 
 /* All registers are 32 bits.  */
diff --git a/gdb/regformats/reg-microblaze.dat b/gdb/regformats/reg-microblaze.dat
new file mode 100644
index 0000000..936bc44
--- /dev/null
+++ b/gdb/regformats/reg-microblaze.dat
@@ -0,0 +1,41 @@
+name:microblaze 
+expedite:r1,pc 
+32:r0 
+32:r1 
+32:r2 
+32:r3 
+32:r4 
+32:r5 
+32:r6 
+32:r7 
+32:r8 
+32:r9 
+32:r10 
+32:r11 
+32:r12 
+32:r13 
+32:r14 
+32:r15 
+32:r16 
+32:r17 
+32:r18 
+32:r19 
+32:r20 
+32:r21 
+32:r22 
+32:r23 
+32:r24 
+32:r25 
+32:r26 
+32:r27 
+32:r28 
+32:r29 
+32:r30 
+32:r31 
+32:pc 
+32:msr 
+32:ear 
+32:esr 
+32:fsr 
+32:slr
+32:shr
-- 
1.7.1


^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2014-06-12  8:34 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-23  6:54 [Patch, microblaze]: Add slr and shr regs Ajit Kumar Agarwal
2014-05-23  7:34 ` Michael Eager
2014-05-23  9:47   ` Ajit Kumar Agarwal
2014-05-23 22:42     ` Michael Eager
2014-05-26 10:04       ` Ajit Kumar Agarwal
2014-05-27  6:34         ` Michael Eager
2014-05-27  7:46           ` Ajit Kumar Agarwal
2014-05-27  8:53             ` Pedro Alves
2014-06-09 17:26               ` Ajit Kumar Agarwal
2014-06-09 17:57                 ` Pedro Alves
2014-06-09 19:35                   ` Ajit Kumar Agarwal
2014-05-29  7:20             ` Michael Eager
2014-06-05 15:54             ` Michael Eager
2014-06-09 17:26               ` Ajit Kumar Agarwal
2014-06-09 18:28                 ` Michael Eager
2014-06-09 19:31                   ` Ajit Kumar Agarwal
2014-06-09 20:06                     ` Michael Eager
2014-06-10 13:51                       ` Ajit Kumar Agarwal
2014-06-10 14:12                         ` Michael Eager
2014-06-10 14:49                           ` Ajit Kumar Agarwal
2014-06-10 15:27                             ` Michael Eager
2014-06-12  8:34                               ` Ajit Kumar Agarwal
2014-05-23  8:32 ` Yao Qi
2014-05-23 20:33   ` Ajit Kumar Agarwal
2014-05-23  8:44 ` Pedro Alves
2014-05-23 20:36   ` Ajit Kumar Agarwal

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).