From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11345 invoked by alias); 12 Oct 2009 16:39:56 -0000 Received: (qmail 11334 invoked by uid 22791); 12 Oct 2009 16:39:55 -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-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Oct 2009 16:39:52 +0000 Received: from mailhost3.vmware.com (mailhost3.vmware.com [10.16.27.45]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id C5E19130D4; Mon, 12 Oct 2009 09:39:50 -0700 (PDT) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost3.vmware.com (Postfix) with ESMTP id BC728CD99E; Mon, 12 Oct 2009 09:39:50 -0700 (PDT) Message-ID: <4AD35AB6.2050903@vmware.com> Date: Mon, 12 Oct 2009 16:39:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20080411) MIME-Version: 1.0 To: "gdb-patches@sourceware.org" , Hui Zhu Subject: [RFA] Fix off-by-one error in record.c (record_list_release_first) Content-Type: multipart/mixed; boundary="------------020806000209000107040008" 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-10/txt/msg00237.txt.bz2 This is a multi-part message in MIME format. --------------020806000209000107040008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 492 Hui, My "info record" patch helped me to find a bug. I found that, once we start calling record_list_release_first, we start adding two instructions to the log for every one instruction we remove. Therefore the log continues to grow, even though it is supposed to remain constant in size. This is because record_insn_num is not incremented if we call record_list_release_first -- but record_list_release_first does decrement it. A one line fix corrects this problem (attached). Michael --------------020806000209000107040008 Content-Type: text/plain; name="insn_num.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="insn_num.txt" Content-length: 570 2009-10-12 Michael Snyder * record.c (record_list_release_first): Do not decrement record_insn_num. Index: record.c =================================================================== RCS file: /cvs/src/src/gdb/record.c,v retrieving revision 1.20 diff -u -p -r1.20 record.c --- record.c 27 Sep 2009 02:49:34 -0000 1.20 +++ record.c 12 Oct 2009 16:33:44 -0000 @@ -209,8 +211,6 @@ record_list_release_first (void) if (type == record_end) break; } - - record_insn_num--; } /* Add a struct record_entry to record_arch_list. */ --------------020806000209000107040008--