From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31000 invoked by alias); 18 Oct 2012 17:30:35 -0000 Received: (qmail 30991 invoked by uid 22791); 18 Oct 2012 17:30:34 -0000 X-SWARE-Spam-Status: No, hits=-4.5 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout22.012.net.il (HELO mtaout22.012.net.il) (80.179.55.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Oct 2012 17:30:27 +0000 Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0MC300400MVTIY00@a-mtaout22.012.net.il> for gdb-patches@sourceware.org; Thu, 18 Oct 2012 19:30:24 +0200 (IST) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MC3003U2NAOVWE0@a-mtaout22.012.net.il>; Thu, 18 Oct 2012 19:30:24 +0200 (IST) Date: Thu, 18 Oct 2012 17:30:00 -0000 From: Eli Zaretskii 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) In-reply-to: <76FE3225DF13124EA2D05B290B624C95E66B370299@SAFEX1MAIL1.st.com> To: Giuseppe MONTALTO Cc: palves@redhat.com, tromey@redhat.com, gdb-patches@sourceware.org, Hafiz_Abid@mentor.com Reply-to: Eli Zaretskii Message-id: <83pq4f1yda.fsf@gnu.org> 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> <76FE3225DF13124EA2D05B290B624C95E6632A4256@SAFEX1MAIL1.st.com> <878vcc1s9f.fsf@fleche.redhat.com> <76FE3225DF13124EA2D05B290B624C95E66B003EA8@SAFEX1MAIL1.st.com> <87wqzgwm4k.fsf@fleche.redhat.com> <76FE3225DF13124EA2D05B290B624C95E66B004AC6@SAFEX1MAIL1.st.com> <50802300.6040304@redhat.com> <76FE3225DF13124EA2D05B290B624C95E66B370299@SAFEX1MAIL1.st.com> X-IsSubscribed: yes 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 X-SW-Source: 2012-10/txt/msg00334.txt.bz2 > From: Giuseppe MONTALTO > Cc: Tom Tromey , "gdb-patches@sourceware.org" , "Abid, Hafiz" > Date: Thu, 18 Oct 2012 18:16:34 +0200 > > Please, find attached a new patch with all the requested changes (also includes > The additons to NEWS and gdb.texinfo that I previously posted in a separate patch). Thanks. > + ** New optional parameter added to the "-data-write-memory-bytes" command, > + to allow pattern filling of memory areas. Please name the new parameter. Otherwise, this part is OK. > +@item @var{count} > +Optional argument indicating the number of bytes to be written. If @var{count} is bigger than @var{contents}' length, pattern filling occurs. What exactly does "pattern filling" mean? This should be explained. Looking at the code, I think you mean If @var{count} is greater than @var{contents}' length, @value{GDBN} will repeatedly write @var{contents} until it fills @var{count} bytes. The patch for the manual is OK with these changes. > for (i = 0; i < len; ++i) > { > int x; > sscanf (cdata + i * 2, "%02x", &x); > - data[i] = (gdb_byte) x; > + databuf[i] = (gdb_byte) x; > + } Sorry for chiming in late wrt the code parts, but: . you don't test the return value of sscanf, is that a good idea? . won't it be better to use strtoul here? that would avoid the need to cast to gdb_byte, AFAIU