From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5824 invoked by alias); 6 May 2009 02:13:25 -0000 Received: (qmail 5795 invoked by uid 22791); 6 May 2009 02:13:24 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.185) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 May 2009 02:13:18 +0000 Received: by ti-out-0910.google.com with SMTP id a1so514234tib.12 for ; Tue, 05 May 2009 19:13:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.110.8.5 with SMTP id 5mr45639tih.14.1241575995967; Tue, 05 May 2009 19:13:15 -0700 (PDT) In-Reply-To: <83d4ane6kb.fsf@gnu.org> References: <83d4ane6kb.fsf@gnu.org> Date: Wed, 06 May 2009 02:13:00 -0000 Message-ID: Subject: Re: [Precord RFA/RFC] Check Linux sys_brk release memory in process record and replay. From: Hui Zhu To: Eli Zaretskii Cc: gdb-patches@sourceware.org, msnyder@vmware.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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-05/txt/msg00098.txt.bz2 Hi Eli, On Wed, May 6, 2009 at 02:41, Eli Zaretskii wrote: >> Date: Tue, 5 May 2009 21:07:13 +0800 >> From: Hui Zhu >> Cc: Michael Snyder >> >> 15 =A0 =A0 =A0 =A0 =A0 =A0sbrk (-10); >> (gdb) >> The next instruction is syscall brk. =A0It will release the memory that >> will cause process record target get error. =A0Do you want to stop the >> inferior?([y] or n) > > Does every sbrk call with a negative argument cause an error in > process record target? =A0What is the reason for that error? > > I'm asking because the message wording sounds very threatening. =A0It > probably needs rephrasing, but I need to understand the reasons better > to suggest how. > Yes, I think we need it. If inferior release some memory, the replay will got big error because prec will set memory old value to this memory. But we are lucky, glibc memory manage (malloc and free) try to doesn't call sbrk to release the memory most of time. I try to let use malloc and free to let glibc to call sbrk to release the memory, but I failed. >> =A0 =A0 =A0 * gdbarch.sh (process_record_reset): This interface point to >> =A0 =A0 =A0 the function that reset the architecture process record and >> =A0 =A0 =A0 replay. > > I think "reset" is not the best name for this. =A0How about > "initialize"? This interface will be call each time when prec open, so it will reset the old value. I think initialize looks like just call once. For example "_initialize_infcall". Thanks, Hui