This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
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)
- From: Tom Tromey <tromey at redhat dot com>
- To: Giuseppe MONTALTO <giuseppe dot montalto at st dot com>
- Cc: "Abid\, Hafiz" <Hafiz_Abid at mentor dot com>, "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 26 Sep 2012 14:43:39 -0600
- 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)
- References: <76FE3225DF13124EA2D05B290B624C95E65F2D466E@SAFEX1MAIL1.st.com> <87sjf9rzr0.fsf@fleche.redhat.com> <76FE3225DF13124EA2D05B290B624C95E65FECE356@SAFEX1MAIL1.st.com> <871umsqgu8.fsf@fleche.redhat.com> <76FE3225DF13124EA2D05B290B624C95E65FECE48F@SAFEX1MAIL1.st.com> <87397624b9.fsf@fleche.redhat.com> <76FE3225DF13124EA2D05B290B624C95E662A6921F@SAFEX1MAIL1.st.com> <EB3B29AD43CA924DA27099BC851923762992F7@EU-MBX-03.mgc.mentorg.com> <76FE3225DF13124EA2D05B290B624C95E6632A4256@SAFEX1MAIL1.st.com> <878vcc1s9f.fsf@fleche.redhat.com> <76FE3225DF13124EA2D05B290B624C95E66B003EA8@SAFEX1MAIL1.st.com>
>>>>> "Giuseppe" == Giuseppe MONTALTO <giuseppe.montalto@st.com> writes:
Giuseppe> Thanks for your comments: I've reworked the patch taking them
Giuseppe> into account. I have also updated it, so that it should now
Giuseppe> fit the current HEAD
Thanks.
Giuseppe> + * mi/mi-main.c (mi_cmd_data_write_memory): additional
Giuseppe> + parameter for pattern filling of memory regions
Capital "A" in "additional" here.
Your patch has a ^M character on each line...
Giuseppe> + else
Giuseppe> + {
Giuseppe> + /* Pattern is equal to count:
Giuseppe> + we can just use databuf. */
Giuseppe> + back_to = make_cleanup (xfree, data);
Giuseppe> + data = databuf;
This makes a cleanup referencing a garbage value of 'data' -- before
'data' is assigned.
Giuseppe> + r = target_write_memory (addr, data, count);
There was a recent patch to change this line, so you may need to rebase
again.
Giuseppe> + xfree (databuf);
If you fix the above cleanup issue, then this will double-free databuf.
Giuseppe> - if (parse->cmd->suppress_notification != NULL)
Giuseppe> + if (strncmp (parse->command, "break-", sizeof ("break-") - 1 ) == 0)
Giuseppe> {
Giuseppe> - make_cleanup_restore_integer (parse->cmd->suppress_notification);
Giuseppe> - *parse->cmd->suppress_notification = 1;
Giuseppe> + make_cleanup_restore_integer (&mi_suppress_breakpoint_notifications);
Giuseppe> + mi_suppress_breakpoint_notifications = 1;
Giuseppe> }
This looks like an unintentional change.
Tom