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: Tue, 17 Jun 2014 07:47:09 -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.
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