* [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
@ 2014-05-20 16:25 Ajit Kumar Agarwal
2014-05-20 21:14 ` Michael Eager
0 siblings, 1 reply; 14+ messages in thread
From: Ajit Kumar Agarwal @ 2014-05-20 16:25 UTC (permalink / raw)
To: gdb-patches, Joel Brobecker
Cc: Michael Eager, Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]
Hello Joel:
I have split the patches as you have recommended and the following is the first of the patch.
[Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
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.
(microblaze_breakpoint_from_pc): Added Declaration of byte_order
and break_insn_le. Check of byte order by BFD_ENDIAN_BIG.
* gdb/microblaze-tdep.h (microblaze_reg_num): Addition of
field MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
(MICROBLAZE_BREAKPOINT_LE): New Macro.
(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
Thanks & Regards
Ajit
[-- Attachment #2: 0001-Patch-microblaze-Add-slr-and-shr-regs-and-little-end.patch --]
[-- Type: application/octet-stream, Size: 5378 bytes --]
From bb5d08fbf07d559df7506944cbe328b98e3e02fd Mon Sep 17 00:00:00 2001
From: Ajit Kumar Agarwal <ajitkum@xhdspdgnu.(none)>
Date: Tue, 20 May 2014 21:16:24 +0530
Subject: [PATCH] [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
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.
(microblaze_breakpoint_from_pc): Added Declaration of byte_order
and break_insn_le. Check of byte order by BFD_ENDIAN_BIG.
* gdb/microblaze-tdep.h (microblaze_reg_num): Addition of
field MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
(MICROBLAZE_BREAKPOINT_LE): New Macro.
(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 | 10 +++++++-
gdb/microblaze-tdep.h | 8 +++++-
gdb/regformats/reg-microblaze.dat | 41 +++++++++++++++++++++++++++++++++++++
4 files changed, 59 insertions(+), 5 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..4402c99 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)
@@ -160,10 +161,15 @@ static const gdb_byte *
microblaze_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pc,
int *len)
{
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
static gdb_byte break_insn[] = MICROBLAZE_BREAKPOINT;
+ static gdb_byte break_insn_le[] = MICROBLAZE_BREAKPOINT_LE;
*len = sizeof (break_insn);
- return break_insn;
+ if (byte_order == BFD_ENDIAN_BIG)
+ return break_insn;
+ else
+ return break_insn_le;
}
\f
/* Allocate and initialize a frame cache. */
diff --git a/gdb/microblaze-tdep.h b/gdb/microblaze-tdep.h
index a532092..3f2bdc3 100644
--- a/gdb/microblaze-tdep.h
+++ b/gdb/microblaze-tdep.h
@@ -32,6 +32,7 @@ struct microblaze_frame_cache
CORE_ADDR base;
CORE_ADDR pc;
+ CORE_ADDR saved_sp;
/* Do we have a frame? */
int frameless_p;
@@ -42,7 +43,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 +108,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. */
@@ -116,5 +119,6 @@ enum microblaze_regnum
/* MICROBLAZE_BREAKPOINT defines the breakpoint that should be used.
Only used for native debugging. */
#define MICROBLAZE_BREAKPOINT {0xb9, 0xcc, 0x00, 0x60}
+#define MICROBLAZE_BREAKPOINT_LE {0x18, 0x00, 0x0c, 0xba}
#endif /* microblaze-tdep.h */
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] 14+ messages in thread* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-20 16:25 [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint Ajit Kumar Agarwal
@ 2014-05-20 21:14 ` Michael Eager
2014-05-21 6:20 ` Ajit Kumar Agarwal
0 siblings, 1 reply; 14+ messages in thread
From: Michael Eager @ 2014-05-20 21:14 UTC (permalink / raw)
To: Ajit Kumar Agarwal, gdb-patches, Joel Brobecker
Cc: Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala
On 05/20/14 09:25, Ajit Kumar Agarwal wrote:
> Hello Joel:
>
> I have split the patches as you have recommended and the following is the first of the patch.
>
> [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
What is the relationship between adding slr/shr registers and little-endian breapoints?
>
> 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.
> (microblaze_breakpoint_from_pc): Added Declaration of byte_order
> and break_insn_le. Check of byte order by BFD_ENDIAN_BIG.
>
> * gdb/microblaze-tdep.h (microblaze_reg_num): Addition of
> field MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
> (MICROBLAZE_BREAKPOINT_LE): New Macro.
> (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
>
> Thanks & Regards
> Ajit
>
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-20 21:14 ` Michael Eager
@ 2014-05-21 6:20 ` Ajit Kumar Agarwal
2014-05-21 7:47 ` Michael Eager
0 siblings, 1 reply; 14+ messages in thread
From: Ajit Kumar Agarwal @ 2014-05-21 6:20 UTC (permalink / raw)
To: Michael Eager, gdb-patches, Joel Brobecker
Cc: Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 1569 bytes --]
On 05/20/14 09:25, Ajit Kumar Agarwal wrote:
> Hello Joel:
>
> I have split the patches as you have recommended and the following is the first of the patch.
>
> [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
>>What is the relationship between adding slr/shr registers and little-endian breapoints?
The shr/slr registers and little endian breakpoints are related as it fixed the common problem of Packet
Transfer error when connecting to the target remote host through tar remote in gdb for microblaze.
>
> 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.
> (microblaze_breakpoint_from_pc): Added Declaration of byte_order
> and break_insn_le. Check of byte order by BFD_ENDIAN_BIG.
>
> * gdb/microblaze-tdep.h (microblaze_reg_num): Addition of
> field MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
> (MICROBLAZE_BREAKPOINT_LE): New Macro.
> (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
>
> Thanks & Regards
> Ajit
>
Thanks & Regards
Ajit
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
\x16º&Öéj×!zÊÞ¶êç×]º×¹b²Ö«r\x18\x1dnr\x17¬
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-21 6:20 ` Ajit Kumar Agarwal
@ 2014-05-21 7:47 ` Michael Eager
2014-05-21 12:55 ` Ajit Kumar Agarwal
2014-05-21 13:41 ` Ajit Kumar Agarwal
0 siblings, 2 replies; 14+ messages in thread
From: Michael Eager @ 2014-05-21 7:47 UTC (permalink / raw)
To: Ajit Kumar Agarwal, Michael Eager, gdb-patches, Joel Brobecker
Cc: Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala
On 05/20/14 23:20, Ajit Kumar Agarwal wrote:
>
>
> On 05/20/14 09:25, Ajit Kumar Agarwal wrote:
>> Hello Joel:
>>
>> I have split the patches as you have recommended and the following is the first of the patch.
>>
>> [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
>
>>> What is the relationship between adding slr/shr registers and little-endian breapoints?
>
> The shr/slr registers and little endian breakpoints are related as it fixed the common problem of Packet
> Transfer error when connecting to the target remote host through tar remote in gdb for microblaze.
What "common" problem? How do either of these changes related
to a packet transfer error?
These changes don't appear related. Split independent changes in to separate patches.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-21 7:47 ` Michael Eager
@ 2014-05-21 12:55 ` Ajit Kumar Agarwal
2014-05-21 13:45 ` Joel Brobecker
2014-05-21 13:41 ` Ajit Kumar Agarwal
1 sibling, 1 reply; 14+ messages in thread
From: Ajit Kumar Agarwal @ 2014-05-21 12:55 UTC (permalink / raw)
To: Michael Eager, Michael Eager, gdb-patches, Joel Brobecker
Cc: Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala
-----Original Message-----
From: Michael Eager [mailto:eager@eagerm.com]
Sent: Wednesday, May 21, 2014 1:18 PM
To: Ajit Kumar Agarwal; Michael Eager; gdb-patches@sourceware.org; Joel Brobecker
Cc: Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
On 05/20/14 23:20, Ajit Kumar Agarwal wrote:
>
>
> On 05/20/14 09:25, Ajit Kumar Agarwal wrote:
>> Hello Joel:
>>
>> I have split the patches as you have recommended and the following is the first of the patch.
>>
>> [Patch, microblaze]: Add slr and shr regs and little-endian
>> breakpoint
>
>>> What is the relationship between adding slr/shr registers and little-endian breapoints?
>
> The shr/slr registers and little endian breakpoints are related as it
> fixed the common problem of Packet Transfer error when connecting to the target remote host through tar remote in gdb for microblaze.
>>>What "common" problem? How do either of these changes related to a packet transfer error?
Here is the problem description. The problem is 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".
This is happening when tar remote machine:1234 command is run in gdb.
>>>These changes don't appear related. Split independent changes in to separate patches.
I will split the changes and send the separate patch with shr and shl reg changes and the little endian breakpoint support.
Thanks & Regards
Ajit
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-21 12:55 ` Ajit Kumar Agarwal
@ 2014-05-21 13:45 ` Joel Brobecker
2014-05-22 17:58 ` Ajit Kumar Agarwal
0 siblings, 1 reply; 14+ messages in thread
From: Joel Brobecker @ 2014-05-21 13:45 UTC (permalink / raw)
To: Ajit Kumar Agarwal
Cc: Michael Eager, Michael Eager, gdb-patches, Vinod Kathail,
Vidhumouli Hunsigida, Nagaraju Mekala
> Here is the problem description. The problem is 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".
>
> This is happening when tar remote machine:1234 command is run in gdb.
>
> >>>These changes don't appear related. Split independent changes in
> >>>to separate patches.
>
> I will split the changes and send the separate patch with shr and shl
> reg changes and the little endian breakpoint support.
Thanks, Ajit. FWIW, I agree with Michael.
Also, when submitting the new patches, please include the description
of the problem you are trying to solve in the revision log of your
patch. Something like the description you gave above, for instance.
This makes archeology a lot easier for us. The good news when doing
that is that submitting the patch could be as simple as "git
send-email"-ing the patch; that's what I personally do for my own
patches, and it's been a real time saver.
--
Joel
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-21 13:45 ` Joel Brobecker
@ 2014-05-22 17:58 ` Ajit Kumar Agarwal
2014-05-22 19:44 ` Michael Eager
0 siblings, 1 reply; 14+ messages in thread
From: Ajit Kumar Agarwal @ 2014-05-22 17:58 UTC (permalink / raw)
To: Joel Brobecker
Cc: Michael Eager, Michael Eager, gdb-patches, Vinod Kathail,
Vidhumouli Hunsigida, Nagaraju Mekala
[-- Attachment #1: Type: text/plain, Size: 3839 bytes --]
Thanks Joel for the review comments. Will make sure to consider your suggestions
when Submitting the new patches.
Based on the feedback, the updated patch is given below.
Okay for the upstream?
[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
Thanks & Regards
Ajit
-----Original Message-----
From: Joel Brobecker [mailto:brobecker@adacore.com]
Sent: Wednesday, May 21, 2014 7:16 PM
To: Ajit Kumar Agarwal
Cc: Michael Eager; Michael Eager; gdb-patches@sourceware.org; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
> Here is the problem description. The problem is 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".
>
> This is happening when tar remote machine:1234 command is run in gdb.
>
> >>>These changes don't appear related. Split independent changes in
> >>>to separate patches.
>
> I will split the changes and send the separate patch with shr and shl
> reg changes and the little endian breakpoint support.
Thanks, Ajit. FWIW, I agree with Michael.
Also, when submitting the new patches, please include the description of the problem you are trying to solve in the revision log of your patch. Something like the description you gave above, for instance.
This makes archeology a lot easier for us. The good news when doing that is that submitting the patch could be as simple as "git send-email"-ing the patch; that's what I personally do for my own patches, and it's been a real time saver.
--
Joel
[-- 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] 14+ messages in thread* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-22 17:58 ` Ajit Kumar Agarwal
@ 2014-05-22 19:44 ` Michael Eager
2014-05-23 4:17 ` Ajit Kumar Agarwal
2014-05-23 5:57 ` Eli Zaretskii
0 siblings, 2 replies; 14+ messages in thread
From: Michael Eager @ 2014-05-22 19:44 UTC (permalink / raw)
To: Ajit Kumar Agarwal, Joel Brobecker
Cc: Michael Eager, gdb-patches, Vinod Kathail, Vidhumouli Hunsigida,
Nagaraju Mekala
On 05/22/14 10:58, Ajit Kumar Agarwal wrote:
> Thanks Joel for the review comments. Will make sure to consider your suggestions
> when Submitting the new patches.
Please don't top post. Please trim your responses so they don't contain
multiple copies of the same text.
> Based on the feedback, the updated patch is given below.
>
> Okay for the upstream?
An OK would only be appropriate if you had write access to the repository.
> [Patch, microblaze]: Add slr and shr regs
>
> This patch add the support of slr and shr regs and also solves the problem
also? Is there another unmentioned 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".
Please make the description of the problem reasonably succinct. A detailed
analysis of how you identified the problem is not needed, especially when you
mention the error message and the cause of the error multiple times.
What is running on the target?
If this a problem using the XMD gdbserver stub which is returning more registers
than GDB expects? If that is the case, then say so. Otherwise, what is the cause
of the mismatch between the gdb G packet and the target?
>
> 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
>
> Thanks & Regards
> Ajit
>
> -----Original Message-----
> From: Joel Brobecker [mailto:brobecker@adacore.com]
> Sent: Wednesday, May 21, 2014 7:16 PM
> To: Ajit Kumar Agarwal
> Cc: Michael Eager; Michael Eager; gdb-patches@sourceware.org; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
> Subject: Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
>
>> Here is the problem description. The problem is 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".
>>
>> This is happening when tar remote machine:1234 command is run in gdb.
>>
>>>>> These changes don't appear related. Split independent changes in
>>>>> to separate patches.
>>
>> I will split the changes and send the separate patch with shr and shl
>> reg changes and the little endian breakpoint support.
>
> Thanks, Ajit. FWIW, I agree with Michael.
>
> Also, when submitting the new patches, please include the description of the problem you are trying to solve in the revision log of your patch. Something like the description you gave above, for instance.
> This makes archeology a lot easier for us. The good news when doing that is that submitting the patch could be as simple as "git send-email"-ing the patch; that's what I personally do for my own patches, and it's been a real time saver.
>
> --
> Joel
>
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-22 19:44 ` Michael Eager
@ 2014-05-23 4:17 ` Ajit Kumar Agarwal
2014-05-23 5:57 ` Eli Zaretskii
1 sibling, 0 replies; 14+ messages in thread
From: Ajit Kumar Agarwal @ 2014-05-23 4:17 UTC (permalink / raw)
To: Michael Eager, Joel Brobecker
Cc: Michael Eager, gdb-patches, Vinod Kathail, Vidhumouli Hunsigida,
Nagaraju Mekala
-----Original Message-----
From: Michael Eager [mailto:eager@eagerm.com]
Sent: Friday, May 23, 2014 1:15 AM
To: Ajit Kumar Agarwal; Joel Brobecker
Cc: Michael Eager; gdb-patches@sourceware.org; Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
On 05/22/14 10:58, Ajit Kumar Agarwal wrote:
> Thanks Joel for the review comments. Will make sure to consider your suggestions
> when Submitting the new patches.
Please don't top post. Please trim your responses so they don't contain multiple copies of the same text.
> Based on the feedback, the updated patch is given below.
>
> Okay for the upstream?
An OK would only be appropriate if you had write access to the repository.
> [Patch, microblaze]: Add slr and shr regs
>
> This patch add the support of slr and shr regs and also solves
> the problem
also? Is there another unmentioned 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".
>>Please make the description of the problem reasonably succinct. A detailed analysis of how you identified the problem is not needed, especially when you mention the error message >>and the cause of the error multiple times.
I have addressed the Joel comments and incorporated his suggestions.
What is running on the target?
>>If this a problem using the XMD gdbserver stub which is returning more registers than GDB expects?
This is not XMD gdbserver stub but related to number of registers we define microblaze-tdep.c.
>> If that is the case, then say so. Otherwise, what is the cause of the mismatch >>between the gdb G packet and the target?
I have already replied the cause of the error and let me know if you need additional info.
Thanks & Regards
Ajit
>
> 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
>
> Thanks & Regards
> Ajit
>
> -----Original Message-----
> From: Joel Brobecker [mailto:brobecker@adacore.com]
> Sent: Wednesday, May 21, 2014 7:16 PM
> To: Ajit Kumar Agarwal
> Cc: Michael Eager; Michael Eager; gdb-patches@sourceware.org; Vinod
> Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
> Subject: Re: [Patch, microblaze]: Add slr and shr regs and
> little-endian breakpoint
>
>> Here is the problem description. The problem is 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".
>>
>> This is happening when tar remote machine:1234 command is run in gdb.
>>
>>>>> These changes don't appear related. Split independent changes in
>>>>> to separate patches.
>>
>> I will split the changes and send the separate patch with shr and
>> shl reg changes and the little endian breakpoint support.
>
> Thanks, Ajit. FWIW, I agree with Michael.
>
> Also, when submitting the new patches, please include the description of the problem you are trying to solve in the revision log of your patch. Something like the description you gave above, for instance.
> This makes archeology a lot easier for us. The good news when doing that is that submitting the patch could be as simple as "git send-email"-ing the patch; that's what I personally do for my own patches, and it's been a real time saver.
>
> --
> Joel
>
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-22 19:44 ` Michael Eager
2014-05-23 4:17 ` Ajit Kumar Agarwal
@ 2014-05-23 5:57 ` Eli Zaretskii
2014-05-23 7:21 ` Michael Eager
1 sibling, 1 reply; 14+ messages in thread
From: Eli Zaretskii @ 2014-05-23 5:57 UTC (permalink / raw)
To: Michael Eager
Cc: ajit.kumar.agarwal, brobecker, eager, gdb-patches, vinodk,
vidhum, nmekala
> Date: Thu, 22 May 2014 12:44:45 -0700
> From: Michael Eager <eager@eagerm.com>
> CC: Michael Eager <eager@eagercon.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>, Vinod Kathail <vinodk@xilinx.com>, Vidhumouli Hunsigida <vidhum@xilinx.com>, Nagaraju Mekala <nmekala@xilinx.com>
>
> > Based on the feedback, the updated patch is given below.
> >
> > Okay for the upstream?
>
> An OK would only be appropriate if you had write access to the repository.
An OK is appropriate even if the OP doesn't have write access. An OK
just means the patch is approved for committing.
> > This patch add the support of slr and shr regs and also solves the problem
>
> also? Is there another unmentioned problem?
There is indeed another problem, but it _is_ mentioned: the missing
support for slr and shr registers.
> > 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".
>
> Please make the description of the problem reasonably succinct. A detailed
> analysis of how you identified the problem is not needed, especially when you
> mention the error message and the cause of the error multiple times.
I see no reason to object to detailed descriptions like the one above
from the POV of their length. They don't hurt, and aren't terribly
long to begin with.
> What is running on the target?
>
> If this a problem using the XMD gdbserver stub which is returning more registers
> than GDB expects? If that is the case, then say so. Otherwise, what is the cause
> of the mismatch between the gdb G packet and the target?
If you want to suggest a rewording, it is much better IME to just show
precisely your suggestion. After all, for most of us here (present
parties included) English is not our first language, maybe not even
the second.
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-23 5:57 ` Eli Zaretskii
@ 2014-05-23 7:21 ` Michael Eager
2014-05-23 7:35 ` Eli Zaretskii
0 siblings, 1 reply; 14+ messages in thread
From: Michael Eager @ 2014-05-23 7:21 UTC (permalink / raw)
To: Eli Zaretskii, Michael Eager
Cc: ajit.kumar.agarwal, brobecker, gdb-patches, vinodk, vidhum, nmekala
On 05/22/14 22:57, Eli Zaretskii wrote:
>> Date: Thu, 22 May 2014 12:44:45 -0700
>> From: Michael Eager <eager@eagerm.com>
>> CC: Michael Eager <eager@eagercon.com>, "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>, Vinod Kathail <vinodk@xilinx.com>, Vidhumouli Hunsigida <vidhum@xilinx.com>, Nagaraju Mekala <nmekala@xilinx.com>
>>
>>> Based on the feedback, the updated patch is given below.
>>>
>>> Okay for the upstream?
>>
>> An OK would only be appropriate if you had write access to the repository.
>
> An OK is appropriate even if the OP doesn't have write access. An OK
> just means the patch is approved for committing.
>
>>> This patch add the support of slr and shr regs and also solves the problem
>>
>> also? Is there another unmentioned problem?
>
> There is indeed another problem, but it _is_ mentioned: the missing
> support for slr and shr registers.
>
>>> 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".
>>
>> Please make the description of the problem reasonably succinct. A detailed
>> analysis of how you identified the problem is not needed, especially when you
>> mention the error message and the cause of the error multiple times.
>
> I see no reason to object to detailed descriptions like the one above
> from the POV of their length. They don't hurt, and aren't terribly
> long to begin with.
Eli -- The problem with this description is that it doesn't describe
the actual problem, but more describes the debugging process. Describing
the if statement which tests the packet length doesn't tell what caused
it to be incorrect.
>> What is running on the target?
>>
>> If this a problem using the XMD gdbserver stub which is returning more registers
>> than GDB expects? If that is the case, then say so. Otherwise, what is the cause
>> of the mismatch between the gdb G packet and the target?
>
> If you want to suggest a rewording, it is much better IME to just show
> precisely your suggestion. After all, for most of us here (present
> parties included) English is not our first language, maybe not even
> the second.
I'm happy to suggest better wording, but at the moment I have no more
than a guess what the root cause of the problem is. Ajit says my guess is
wrong, and he didn't respond to my questions about what is running on
the target which does cause the packet length mismatch.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-23 7:21 ` Michael Eager
@ 2014-05-23 7:35 ` Eli Zaretskii
0 siblings, 0 replies; 14+ messages in thread
From: Eli Zaretskii @ 2014-05-23 7:35 UTC (permalink / raw)
To: Michael Eager
Cc: ajit.kumar.agarwal, brobecker, gdb-patches, vinodk, vidhum, nmekala
> Date: Fri, 23 May 2014 00:21:19 -0700
> From: Michael Eager <eager@eagercon.com>
> CC: ajit.kumar.agarwal@xilinx.com, brobecker@adacore.com,
> gdb-patches@sourceware.org, vinodk@xilinx.com, vidhum@xilinx.com,
> nmekala@xilinx.com
>
> >>> 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".
> >>
> >> Please make the description of the problem reasonably succinct. A detailed
> >> analysis of how you identified the problem is not needed, especially when you
> >> mention the error message and the cause of the error multiple times.
> >
> > I see no reason to object to detailed descriptions like the one above
> > from the POV of their length. They don't hurt, and aren't terribly
> > long to begin with.
>
> Eli -- The problem with this description is that it doesn't describe
> the actual problem, but more describes the debugging process. Describing
> the if statement which tests the packet length doesn't tell what caused
> it to be incorrect.
The numbers don't match, so that inequality seems to be fragile.
That's my understanding.
> > If you want to suggest a rewording, it is much better IME to just show
> > precisely your suggestion. After all, for most of us here (present
> > parties included) English is not our first language, maybe not even
> > the second.
>
> I'm happy to suggest better wording, but at the moment I have no more
> than a guess what the root cause of the problem is. Ajit says my guess is
> wrong, and he didn't respond to my questions about what is running on
> the target which does cause the packet length mismatch.
Well, perhaps no Ajit understand better what we didn't understand in
his original description, and will hopefully follow up.
^ permalink raw reply [flat|nested] 14+ messages in thread
* RE: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-21 7:47 ` Michael Eager
2014-05-21 12:55 ` Ajit Kumar Agarwal
@ 2014-05-21 13:41 ` Ajit Kumar Agarwal
2014-05-21 14:06 ` Pedro Alves
1 sibling, 1 reply; 14+ messages in thread
From: Ajit Kumar Agarwal @ 2014-05-21 13:41 UTC (permalink / raw)
To: Michael Eager, Michael Eager, gdb-patches, Joel Brobecker
Cc: Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala
[-- Attachment #1: Type: text/plain, Size: 3420 bytes --]
Based on the feedback I have splitted the patch and the following is the patch for Add slr and shr regs support.
[Patch, microblaze]: Add slr and shr regs
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
Thanks & Regards
Ajit
-----Original Message-----
From: Ajit Kumar Agarwal
Sent: Wednesday, May 21, 2014 6:25 PM
To: 'Michael Eager'; Michael Eager; gdb-patches@sourceware.org; Joel Brobecker
Cc: Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: RE: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
-----Original Message-----
From: Michael Eager [mailto:eager@eagerm.com]
Sent: Wednesday, May 21, 2014 1:18 PM
To: Ajit Kumar Agarwal; Michael Eager; gdb-patches@sourceware.org; Joel Brobecker
Cc: Vinod Kathail; Vidhumouli Hunsigida; Nagaraju Mekala
Subject: Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
On 05/20/14 23:20, Ajit Kumar Agarwal wrote:
>
>
> On 05/20/14 09:25, Ajit Kumar Agarwal wrote:
>> Hello Joel:
>>
>> I have split the patches as you have recommended and the following is the first of the patch.
>>
>> [Patch, microblaze]: Add slr and shr regs and little-endian
>> breakpoint
>
>>> What is the relationship between adding slr/shr registers and little-endian breapoints?
>
> The shr/slr registers and little endian breakpoints are related as it
> fixed the common problem of Packet Transfer error when connecting to the target remote host through tar remote in gdb for microblaze.
>>>What "common" problem? How do either of these changes related to a packet transfer error?
Here is the problem description. The problem is 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".
This is happening when tar remote machine:1234 command is run in gdb.
>>>These changes don't appear related. Split independent changes in to separate patches.
I will split the changes and send the separate patch with shr and shl reg changes and the little endian breakpoint support.
Thanks & Regards
Ajit
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
[-- Attachment #2: 0001-Patch-microblaze-Add-slr-and-shr-regs.patch --]
[-- Type: application/octet-stream, Size: 4179 bytes --]
From 1c7e6cf6490caee5c01c32ba21f01e3c0ce0d01e 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
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] 14+ messages in thread* Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
2014-05-21 13:41 ` Ajit Kumar Agarwal
@ 2014-05-21 14:06 ` Pedro Alves
0 siblings, 0 replies; 14+ messages in thread
From: Pedro Alves @ 2014-05-21 14:06 UTC (permalink / raw)
To: Ajit Kumar Agarwal, Michael Eager, Michael Eager, gdb-patches,
Joel Brobecker
Cc: Vinod Kathail, Vidhumouli Hunsigida, Nagaraju Mekala
On 05/21/2014 02:40 PM, Ajit Kumar Agarwal wrote:
> Based on the feedback I have splitted the patch and the following is the patch for Add slr and shr regs support.
>
> [Patch, microblaze]: Add slr and shr regs
>
> 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
>
> Thanks & Regards
> ChangeLog:
> 2014-05-20 Ajit Agarwal <ajitkum@xilinx.com>
>
> * gdb/gdbserver/Makefile.in (microblaze-linux.c): New rule.
gdb and gdbserver each have their own ChangeLog files. Filenames
in entries should be relative to the corresponding ChangeLog file.
So:
* Makefile.in (microblaze-linux.c): New rule.
But looks like microblaze-linux.c is missing from the patch?
>
> * gdb/microblaze-tdep.c (microblaze_register_names): Added
> the rshr and rslr register names.
And:
* microblaze-tdep.c (microblaze_register_names): Added
the rshr and rslr register names.
But use present tense "Add".
>
> * gdb/microblaze-tdep.h (microblaze_reg_num): Addition of
> field MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
* microblaze-tdep.h (microblaze_reg_num): Add
MICROBLAZE_SLR_REGNUM and MICROBLAZE_SHR_REGNUM.
> (microblaze_frame_cache): Change in the index of
> register_offsets.
What change?
>
> * gdb/regformats/reg-microblaze.dat: New Register data file.
What for upper/lower case mixups. "New file." is sufficient though:
* regformats/reg-microblaze.dat: New file.
> /* Offsets to saved registers. */
> - int register_offsets[57]; /* Must match MICROBLAZE_NUM_REGS. */
> + int register_offsets[59]; /* Must match MICROBLAZE_NUM_REGS. */
How about we let the compiler worry about this?
Define MICROBLAZE_NUM_REGS like:
enum microblaze_regnum
...
MICROBLAZE_RTLBX_REGNUM,
MICROBLAZE_RTLBSX_REGNUM,
MICROBLAZE_RTLBLO_REGNUM,
MICROBLAZE_RTLBHI_REGNUM
MICROBLAZE_RTLBHI_REGNUM,
MICROBLAZE_SLR_REGNUM,
MICROBLAZE_SHR_REGNUM
+
+ MICROBLAZE_NUM_REGS
And then you can write:
int register_offsets[MICROBLAZE_NUM_REGS];
But, most importantly, I've no clue what these slr and
shr registers are, but, do all microblaze cpus have those?
--
Pedro Alves
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2014-05-23 7:35 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-20 16:25 [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint Ajit Kumar Agarwal
2014-05-20 21:14 ` Michael Eager
2014-05-21 6:20 ` Ajit Kumar Agarwal
2014-05-21 7:47 ` Michael Eager
2014-05-21 12:55 ` Ajit Kumar Agarwal
2014-05-21 13:45 ` Joel Brobecker
2014-05-22 17:58 ` Ajit Kumar Agarwal
2014-05-22 19:44 ` Michael Eager
2014-05-23 4:17 ` Ajit Kumar Agarwal
2014-05-23 5:57 ` Eli Zaretskii
2014-05-23 7:21 ` Michael Eager
2014-05-23 7:35 ` Eli Zaretskii
2014-05-21 13:41 ` Ajit Kumar Agarwal
2014-05-21 14:06 ` Pedro Alves
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox