From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4681 invoked by alias); 17 Jun 2014 14:47:36 -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 4642 invoked by uid 89); 17 Jun 2014 14:47:32 -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: qmta13.emeryville.ca.mail.comcast.net Received: from qmta13.emeryville.ca.mail.comcast.net (HELO qmta13.emeryville.ca.mail.comcast.net) (76.96.27.243) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Jun 2014 14:47:11 +0000 Received: from omta14.emeryville.ca.mail.comcast.net ([76.96.30.60]) by qmta13.emeryville.ca.mail.comcast.net with comcast id FRYo1o0061HpZEsADSnAxc; Tue, 17 Jun 2014 14:47:10 +0000 Received: from redwood.eagercon.com ([24.7.16.38]) by omta14.emeryville.ca.mail.comcast.net with comcast id FSn91o0030pGQcg8aSn9cq; Tue, 17 Jun 2014 14:47:09 +0000 Message-ID: <53A054ED.1010509@eagercon.com> Date: Tue, 17 Jun 2014 14:47: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-06/txt/msg00594.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. 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