This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
- From: Pedro Alves <palves at redhat dot com>
- To: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>, Michael Eager <eager at eagerm dot com>, Michael Eager <eager at eagercon dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Joel Brobecker <brobecker at adacore dot com>
- Cc: Vinod Kathail <vinodk at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>
- Date: Wed, 21 May 2014 15:05:18 +0100
- Subject: Re: [Patch, microblaze]: Add slr and shr regs and little-endian breakpoint
- Authentication-results: sourceware.org; auth=none
- References: <c9001031-69c7-47c7-a7ab-1f57b7e493e0 at BN1BFFO11FD036 dot protection dot gbl> <537BC5B9 dot 10601 at eagercon dot com> <dfcc599b-b040-446d-bd46-723b67dbf286 at BL2FFO11FD042 dot protection dot gbl> <537C5A25 dot 9000003 at eagerm dot com> <f074d924-496d-4c10-97e4-0e6e3d069039 at BY2FFO11FD034 dot protection dot gbl>
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