[Patch, microblaze]: Communicate in larger blocks with the target.

Michael Eager eager@eagercon.com
Wed Jul 23 18:56:00 GMT 2014


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



More information about the Gdb-patches mailing list