From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26964 invoked by alias); 23 Oct 2009 05:35:14 -0000 Received: (qmail 26953 invoked by uid 22791); 23 Oct 2009 05:35:13 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-px0-f175.google.com (HELO mail-px0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 23 Oct 2009 05:35:09 +0000 Received: by pxi5 with SMTP id 5so5033426pxi.12 for ; Thu, 22 Oct 2009 22:35:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.25.36 with SMTP id c36mr732538wfj.1.1256276108082; Thu, 22 Oct 2009 22:35:08 -0700 (PDT) In-Reply-To: <4AE0B40B.5020802@vmware.com> References: <4AD91D72.1030802@vmware.com> <83k4ytgxh5.fsf@gnu.org> <4ADA93C9.5040601@vmware.com> <4ADCA7DC.5040006@vmware.com> <4ADE1612.9040708@vmware.com> <4ADE167F.2020309@vmware.com> <4AE0B40B.5020802@vmware.com> From: Hui Zhu Date: Fri, 23 Oct 2009 05:35:00 -0000 Message-ID: Subject: Re: [RFA, 3 of 3] save/restore process record, part 3 (save/restore) To: Michael Snyder Cc: Eli Zaretskii , "gdb-patches@sourceware.org" 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-10/txt/msg00556.txt.bz2 Cool. Thanks, Michael. I got some fail with testsuite: consecutive-precsave.exp solib-precsave.exp until-precsave.exp I will try to fix them. Hui On Fri, Oct 23, 2009 at 03:35, Michael Snyder wrote: > Hui Zhu wrote: >> >> On Wed, Oct 21, 2009 at 03:58, Michael Snyder wrote: >>> >>> Michael Snyder wrote: >>>> >>>> Hui Zhu wrote: >>>>> >>>>> On Tue, Oct 20, 2009 at 01:54, Michael Snyder >>>>> wrote: >>>>>> >>>>>> Hui Zhu wrote: >>>>>>> >>>>>>> Hi Michael, >>>>>>> >>>>>>> I think you want unlink the gdb_record when save get some error. = =A0It >>>>>>> maybe need "discard_cleanups" the old_cleanups and bfd_close (obfd); >>>>>>> >>>>>>> After change the code, everything is OK. >>>>>> >>>>>> Yes. =A0Thanks. =A0Like this: >>>>>> + =A0 =A0 =A0if (record_list->prev) >>>>>> + =A0 =A0 =A0 =A0record_list =3D record_list->prev; >>>>>> + =A0 =A0} >>>>>> + >>>>>> + =A0do_cleanups (set_cleanups); >>>>>> + =A0bfd_close (obfd); >>>>>> + =A0discard_cleanups (old_cleanups); >>>>>> + >>>>>> + =A0/* Succeeded. =A0*/ >>>>> >>>>> I suggest: >>>>> + =A0discard_cleanups (old_cleanups); >>>>> + =A0bfd_close (obfd); >>>> >>>> The reason I did the bfd_close first is because I wasn't >>>> sure if it was safe to delete the file first. =A0In any way, >>>> it seems more logical to close the file before delete it. >>> >>> Oh, oops, never mind. =A0My head's fuzzy today. >>> >>> Why do you suggest to change the order? >>> Just curious, I don't have an issue with it... >>> >> >> Sorry I didn't talk the function very clear. >> >>>>>> + =A0bfd_close (obfd); >>>>>> + =A0discard_cleanups (old_cleanups); >> >> Before "discard_cleanups (old_cleanups);", the "record_save_cleanups" >> will be call sometime. =A0"record_save_cleanups" will call "bfd_close >> (obfd)". >> If the record_save_cleanups will happen after "bfd_close (obfd)". >> "bfd_close (obfd)" will be call twice. >> >> Of curse, most of time it will not happen. =A0 So I just suggest. =A0:) > > OK, done and committed. > >