From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3737 invoked by alias); 23 Jul 2014 18:51:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 3723 invoked by uid 89); 23 Jul 2014 18:51:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-HELO: qmta07.emeryville.ca.mail.comcast.net Received: from qmta07.emeryville.ca.mail.comcast.net (HELO qmta07.emeryville.ca.mail.comcast.net) (76.96.30.64) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Jul 2014 18:51:52 +0000 Received: from omta12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by qmta07.emeryville.ca.mail.comcast.net with comcast id Vu8X1o0040x6nqcA7urr88; Wed, 23 Jul 2014 18:51:51 +0000 Received: from redwood.eagercon.com ([24.7.16.38]) by omta12.emeryville.ca.mail.comcast.net with comcast id Vuro1o0010pGQcg8YurqW9; Wed, 23 Jul 2014 18:51:51 +0000 Message-ID: <53D0043D.6030601@eagercon.com> Date: Wed, 23 Jul 2014 18:56:00 -0000 From: Michael Eager User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Ajit Kumar Agarwal , "gdb-patches@sourceware.org" CC: Vinod Kathail , Vidhumouli Hunsigida , Nagaraju Mekala Subject: Re: [Patch, microblaze]: Communicate in larger blocks with the target. References: <41df2189-0a72-4543-ba31-297f81e663d7@BN1AFFO11FD025.protection.gbl> In-Reply-To: <41df2189-0a72-4543-ba31-297f81e663d7@BN1AFFO11FD025.protection.gbl> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00584.txt.bz2 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 > > * 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