[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 MONTALTO
giuseppe.montalto@st.com
Tue Sep 18 15:19:00 GMT 2012
Hi Tom,
Thanks for your comments: I've reworked the patch taking them into account.
I have also updated it, so that it should now fit the current HEAD
Please, find it attached.
Regards,
Giuseppe.
> -----Original Message-----
> From: Tom Tromey [mailto:tromey@redhat.com]
> Sent: Friday, September 14, 2012 6:31 PM
> To: Giuseppe MONTALTO
> Cc: Abid, Hafiz; gdb-patches@sourceware.org
> 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> New version of the patch.
>
> I'm sorry about the delay on this.
>
> I know it feels uncomfortable, but it really is good to ping patches -- say every
> week or so. Otherwise they tend to slide off the radar.
>
> Giuseppe> + int len, r, i, steps, reminder; long int count, j;
>
> I think now size_t is preferred. (This changed since your patch
> submission.)
>
> Typo: should be "remainder", not "reminder".
>
> Giuseppe> + count = strtol (argv[2], NULL, 10);
>
> I think strtoul instead.
>
> Giuseppe> + if (len < count)
> Giuseppe> + {
> Giuseppe> + /* pattern is made of less bytes than count:
> Giuseppe> + repeat pattern to fill memory. */
>
> Comments should start with an uppercase letter.
>
> Giuseppe> + else
> Giuseppe> + {
> Giuseppe> + /* pattern is longer than (or equal to) count:
> Giuseppe> + just copy len bytes. */
>
> Likewise.
>
> Giuseppe> + xfree (databuf);
>
> It seems like you could do less work for the usual case where len==count.
> That is, avoid the extra malloc and memcpy.
>
> Giuseppe> +set testfile "mi-read-memory"
> Giuseppe> +set srcfile ${testfile}.c
> Giuseppe> +set binfile ${objdir}/${subdir}/${testfile}
>
> Use standard_testfile now.
>
> Giuseppe> +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}"
> executable {debug additional_flags=-DFAKEARGV}] != "" } {
> Giuseppe> + untested mi-read-memory.exp
>
> Use build_executable instead and don't call untested.
>
> Giuseppe> +return 0
>
> No need for a return at the end of a .exp file.
>
> Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mi_cmd_data_write_memory_bytes.patch
Type: application/octet-stream
Size: 6806 bytes
Desc: mi_cmd_data_write_memory_bytes.patch
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20120918/e163ecda/attachment.obj>
More information about the Gdb-patches
mailing list