Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Ajit Kumar Agarwal <ajit.kumar.agarwal@xilinx.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>,
	       Michael Eager <eager@eagercon.com>,
	Vinod Kathail <vinodk@xilinx.com>,
	       Vidhumouli Hunsigida <vidhum@xilinx.com>,
	       Nagaraju Mekala	<nmekala@xilinx.com>
Subject: Re: [Patch, microblaze]: Communicate in larger blocks with the target.
Date: Tue, 17 Jun 2014 16:32:00 -0000	[thread overview]
Message-ID: <87lhsvh51u.fsf@fleche.redhat.com> (raw)
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")

>>>>> "Ajit" == Ajit Kumar Agarwal <ajit.kumar.agarwal@xilinx.com> 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


  parent reply	other threads:[~2014-06-17 16:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-17  9:03 Ajit Kumar Agarwal
2014-06-17 13:49 ` Pedro Alves
2014-06-17 16:34   ` Pedro Alves
2014-06-17 16:49     ` Ajit Kumar Agarwal
2014-06-17 16:52       ` Pedro Alves
2014-06-17 18:09         ` Ajit Kumar Agarwal
2014-06-17 18:13         ` Ajit Kumar Agarwal
2014-06-18  9:28           ` Pedro Alves
2014-07-24  2:39           ` Michael Eager
2014-06-17 14:47 ` Michael Eager
2014-06-17 16:32 ` Tom Tromey [this message]
2014-07-23 18:56 ` Michael Eager
2014-07-23 20:04   ` Michael Eager

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lhsvh51u.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=ajit.kumar.agarwal@xilinx.com \
    --cc=eager@eagercon.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nmekala@xilinx.com \
    --cc=vidhum@xilinx.com \
    --cc=vinodk@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox