This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [PATCH] enhancement of mi_cmd_data_write_memory_bytes for filling memory regions (was [PATCH] new MI command for pattern filling of memory regions)


New patch attached:
- removed trivial comments
- removed redundant "else if" clause 

Any further feedback is always welcome,
	Giuseppe.

> -----Original Message-----
> From: Tom Tromey [mailto:tromey@redhat.com]
> Sent: Friday, September 28, 2012 10:07 PM
> To: Giuseppe MONTALTO
> Cc: gdb-patches@sourceware.org; Abid, Hafiz
> Subject: Re: [PATCH] enhancement of mi_cmd_data_write_memory_bytes
> for filling memory regions (was [PATCH] new MI command for pattern filling
> of memory regions)
> 
> >>>>> "Giuseppe" == Giuseppe MONTALTO <giuseppe.montalto@st.com>
> writes:
> 
> Giuseppe> the attached patch should fix all the issues.
> 
> Thanks.  Unfortunately I thought of one more little thing.
> 
> Giuseppe> +      remainder = count % len; /* there may be some spare bytes.
> */
> 
> Comment should start with a capital letter.
> Though TBH you could also just remove this comment since I think the
> code is already clear.
> 
> Giuseppe> +      if (remainder > 0) /* copy spare bytes too.  */
> 
> Likewise on both counts.
> 
> Giuseppe> +  else if (len > count)
> Giuseppe> +    {
> Giuseppe> +      /* Pattern is longer than count:
> Giuseppe> +         just copy len bytes.  */
> Giuseppe> +      data = xmalloc (len);
> Giuseppe> +      make_cleanup (xfree, data);
> Giuseppe> +      memcpy (data, databuf, len);
> 
> There's no need to copy the data here.
> Just set data=databuf.
> 
> Tom

Attachment: patch-V.7.patch
Description: patch-V.7.patch


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]