This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [Patch, microblaze]: Communicate in larger blocks with the target.
- From: Michael Eager <eager at eagercon dot com>
- To: Ajit Kumar Agarwal <ajit dot kumar dot agarwal at xilinx dot com>, "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>
- Cc: Vinod Kathail <vinodk at xilinx dot com>, Vidhumouli Hunsigida <vidhum at xilinx dot com>, Nagaraju Mekala <nmekala at xilinx dot com>
- Date: Wed, 23 Jul 2014 11:51:41 -0700
- Subject: Re: [Patch, microblaze]: Communicate in larger blocks with the target.
- Authentication-results: sourceware.org; auth=none
- References: <41df2189-0a72-4543-ba31-297f81e663d7 at BN1AFFO11FD025 dot protection dot gbl>
On 06/17/14 02:03, Ajit Kumar Agarwal wrote:
Please find the following patch.
[Patch, microblaze]: Communicate in larger blocks with the target.
Communicate in larger blocks with the target. The chunk of memory
will be read from the target and then used in microblaze_analyze_prologue.
The above process minimizes the transaction with the Debug Agent.
ChangeLog:
2014-06-17 Ajit Agarwal <ajitkum@xilinx.com>
* microblaze-tdep.c (microblaze_analyze_prologue): Use of
target_read_memory. Populate insn_block. Use of insn_block.
Signed-off-by:Ajit Agarwal ajitkum@xilinx.com
Please follow GNU coding conventions:
Remove trailing whitespace.
+ /*Do a block read to minimize the transaction with the Debug Agent */
Comments need space after /* and period and two spaces before */.
+ n_insns = (stop == func_addr) ? 1 : ((stop - func_addr) / INST_WORD_SIZE);
Recommend parens around conditional expression.
+ insn_block = (unsigned long *)calloc(n_insns, sizeof(unsigned long));
+ buf_block = (gdb_byte *)calloc(n_insns * INST_WORD_SIZE, sizeof(gdb_byte));
Spaces before function name.
+ for (ti = 0; ti < n_insns; ti++) {
+ insn_block[ti] = 0;
+ for (tj = ti * INST_WORD_SIZE; tj < (ti + 1) * INST_WORD_SIZE; tj++)
+ insn_block[ti] = (insn_block[ti] << 8) | buf_block[tj];
+ }
GNU does not use the "one true brace" format. Please use GNU brace
and indent format.
+ free(insn_block);
+ free(buf_block);
Spaces before function name.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077