This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

There are coding standard issues:

1.  Comments have space after opening /*, end with a period, two spaces, */.

2.  Space before left paren in function call.

3.  Space after cast.

There may be others.  Please review GDB/GNU coding standards:
https://sourceware.org/gdb/wiki/Internals%20GDB-C-Coding-Standards


+  n_insns = (stop == func_addr) ? 1 : ((stop - func_addr) / INST_WORD_SIZE);
...
   for (addr = func_addr; addr < stop; addr += INST_WORD_SIZE)

It looks to me that if (stop == func_addr), this loop will not be executed.
If that's as intended, then there's no need for the conditional expression, and
likely execution of the function can be terminated early.  If this is not intended,
then a gdb_assert (stop != func_addr) can be inserted and the conditional
expression removed.


--
Michael Eager	 eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306  650-325-8077


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]