From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11729 invoked by alias); 17 Jun 2014 16:32:15 -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 11712 invoked by uid 89); 17 Jun 2014 16:32:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.3 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Jun 2014 16:31:45 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5HGUdhh007516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Jun 2014 12:30:39 -0400 Received: from barimba (ovpn-113-103.phx2.redhat.com [10.3.113.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s5HGUcg0026900 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Tue, 17 Jun 2014 12:30:38 -0400 From: Tom Tromey To: Ajit Kumar Agarwal Cc: "gdb-patches\@sourceware.org" , Michael Eager , 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> Date: Tue, 17 Jun 2014 16:32:00 -0000 In-Reply-To: <41df2189-0a72-4543-ba31-297f81e663d7@BN1AFFO11FD025.protection.gbl> (Ajit Kumar Agarwal's message of "Tue, 17 Jun 2014 09:03:29 +0000") Message-ID: <87lhsvh51u.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2014-06/txt/msg00615.txt.bz2 >>>>> "Ajit" == Ajit Kumar Agarwal writes: Ajit> + insn_block = (unsigned long *)calloc(n_insns, sizeof(unsigned long)); Ajit> + buf_block = (gdb_byte *)calloc(n_insns * INST_WORD_SIZE, sizeof(gdb_byte)); Just for future reference -- since from other reviews it looks like the patch will need bigger updates -- gdb doesn't use "calloc". Instead it uses wrapper around the standard allocation functions, e.g., xcalloc... though if one is allocating typed arrays then I think the wrapper macros like XNEWVEC (see include/libiberty.h) are to be preferred, as they are more type-safe. Ajit> + free(insn_block); Ajit> + free(buf_block); Likewise gdb uses xfree. Though in most cases one must use cleanups instead, to be exception-safe. I didn't look to see whether that was the case for your patch. Tom