From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20751 invoked by alias); 18 Aug 2009 04:18:40 -0000 Received: (qmail 20738 invoked by uid 22791); 18 Aug 2009 04:18:39 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Aug 2009 04:18:31 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 908E91C00F; Mon, 17 Aug 2009 21:18:25 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost2.vmware.com (Postfix) with ESMTP id 6FEAB8E5B3; Mon, 17 Aug 2009 21:18:25 -0700 (PDT) Message-ID: <4A8A2ACD.9000208@vmware.com> Date: Tue, 18 Aug 2009 05:35:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: Hui Zhu CC: gdb-patches ml Subject: Re: Bug in i386_process_record? References: <4A7BA1DE.6010103@vmware.com> <4A8097B4.2080709@vmware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2009-08/txt/msg00268.txt.bz2 Hui Zhu wrote: > On Tue, Aug 11, 2009 at 05:57, Michael Snyder wrote: >> Yes, this seems to be better. It records only 4 bytes each time >> it is called. >> >> But there seems to be still an off-by-one error? With the test >> program that I provided, we call memset with an argument of >> 1024, but we actually record 1025 bytes... this code gets hit >> 257 times, with the last time recording only 1 byte. >> >> > > Hi Michael, > > This issue is because: > > 0xb7edf4e7 : rep stos %eax,%es:(%edi) > 0xb7edf4e9 : mov %edx,%ecx > 0xb7edf4eb : rep stos %al,%es:(%edi) > 0xb7edf4ed : mov 0x8(%esp),%eax > 0xb7edf4f1 : pop %edi > > If the memcpy size is not align with 4, it will handle by second rep stos. > Then rep stos will not execute if %ecx is 0. > i386_process_record doesn't check %ecx, so it get this error. > > I make a new patch for it. Please help me review it. This seems much better. Please give us a change log and post it for review. By the way, I'm sorry, I only just realized that I posted two completely different bug reports with the exact same subject line. ;-( Cheers, Michael