From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29337 invoked by alias); 27 Sep 2009 02:51:57 -0000 Received: (qmail 29325 invoked by uid 22791); 27 Sep 2009 02:51:56 -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-f202.google.com (HELO mail-px0-f202.google.com) (209.85.216.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 27 Sep 2009 02:51:52 +0000 Received: by pxi40 with SMTP id 40so4555118pxi.24 for ; Sat, 26 Sep 2009 19:51:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.7.39 with SMTP id 39mr136226wfg.113.1254019911053; Sat, 26 Sep 2009 19:51:51 -0700 (PDT) In-Reply-To: <4ABE5E8D.8080209@vmware.com> References: <4AA5D713.1060305@vmware.com> <20090908065843.GO30677@adacore.com> <4AA68C92.7070905@vmware.com> <4ABE5E8D.8080209@vmware.com> From: Hui Zhu Date: Sun, 27 Sep 2009 02:51:00 -0000 Message-ID: Subject: Re: [RFA] let record_resume fail immediately on error To: Michael Snyder Cc: Joel Brobecker , "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-09/txt/msg00844.txt.bz2 OK. Thanks, Michael. Hui On Sun, Sep 27, 2009 at 02:33, Michael Snyder wrote: > Personally, I think this one isn't critical for 7.0. > Waiting for 7.1 will allow us more time to assess it. > > Hui Zhu wrote: >> >> Hi Joel, >> >> Sorry to disturb you. =A0Ping >> http://sourceware.org/ml/gdb-patches/2009-09/msg00231.html >> >> Thanks, >> Hui >> >> On Wed, Sep 9, 2009 at 10:05, Hui Zhu wrote: >>> >>> On Wed, Sep 9, 2009 at 00:55, Michael Snyder wrote: >>>> >>>> Hui Zhu wrote: >>>>> >>>>> On Tue, Sep 8, 2009 at 15:25, Hui Zhu wrote: >>>>>> >>>>>> If GDB call error in record_resume, user cannot keep debug the >>>>>> inferior. >>>>>> >>>>>> Hui >>>>>> >>>>>> On Tue, Sep 8, 2009 at 15:23, Hui Zhu wrote: >>>>>>> >>>>>>> The "record_resume_error" in gdb-cvs is to make user after get a >>>>>>> error >>>>>>> of record_message, they can "record stop" close the record and keep >>>>>>> debug the inferior. >>>>>>> >>>>>>> Thanks, >>>>>>> Hui >>>>>>> >>>>>>> On Tue, Sep 8, 2009 at 14:58, Joel Brobecker >>>>>>> wrote: >>>>>>>>> >>>>>>>>> =A0if (!RECORD_IS_REPLAY) >>>>>>>>> =A0 =A0{ >>>>>>>>> =A0 =A0 =A0if (do_record_message (get_current_regcache ())) >>>>>>>>> - =A0 =A0 =A0 =A0{ >>>>>>>>> - =A0 =A0 =A0 =A0 =A0record_resume_error =3D 0; >>>>>>>>> - =A0 =A0 =A0 =A0} >>>>>>>>> - =A0 =A0 =A0else >>>>>>>>> - =A0 =A0 =A0 =A0{ >>>>>>>>> - =A0 =A0 =A0 =A0 =A0record_resume_error =3D 1; >>>>>>>>> - =A0 =A0 =A0 =A0 =A0return; >>>>>>>>> - =A0 =A0 =A0 =A0} >>>>>>>>> + =A0 =A0 internal_error (__FILE__, __LINE__, >>>>>>>>> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 _("record_resume: do_re= cord_message >>>>>>>>> failed.")); >>>>>>>>> + >>>>>>>> >>>>>>>> Forgive me if I'm wrong, as I don't know the record.c code at all, >>>>>>>> but >>>>>>>> I cannot help but think that the internal_error is suspicious here. >>>>>>>> Why is this an internal_error? >>>>>>>> >>>>>>>> -- >>>>>>>> Joel >>>>>>>> >>>>> Hi guys, >>>>> >>>>> I make a patch that make "record_resume_error" work better. =A0I did >>>>> some test. =A0It seems better than before. >>>> >>>> Could you explain what you mean by better? >>>> I mean, what behavior are you looking for here? >>>> >>>> Here is the behavior that I see --- I am making a recording, >>>> I say "continue", and after a while this "record_resume_error" >>>> is triggered, and gdb stops and says "No more reverse-execution >>>> history." >>>> >>>> I would never expect to see that message during recording. >>> >>> In before, GDB cannot throw error in record_resume (It just in my >>> memory, maybe I am wrong). >>> If we try to do it, it will get: >>> (gdb) c >>> Continuing. >>> Cannot execute this command while the selected thread is running. >>> So I add record_resume_error to let record_wait to handle it. >>> >>> But record_wait cannot call error too. =A0So I let it: >>> =A0 =A0 =A0 =A0 /* If record_resume get error, return directly. =A0*/ >>> =A0 =A0 =A0 =A0 status->kind =3D TARGET_WAITKIND_STOPPED; >>> =A0 =A0 =A0 =A0 status->value.sig =3D TARGET_SIGNAL_0; >>> =A0 =A0 =A0 =A0 return inferior_ptid; >>> >>> But I found that record_resume can call error now. =A0So I make a new >>> patch for it. >>> >>> Could you help me try it? >>> >>> >>> Thanks, >>> Hui >>> >>> 2009-09-09 =A0Hui Zhu =A0 >>> >>> =A0 =A0 =A0 * record.c (record_resume_error): Deleted. >>> =A0 =A0 =A0 (record_resume): Call record_message. >>> =A0 =A0 =A0 (record_wait): Deleted record_resume_error. >>> >>> --- >>> =A0record.c | =A0 19 +------------------ >>> =A01 file changed, 1 insertion(+), 18 deletions(-) >>> >>> --- a/record.c >>> +++ b/record.c >>> @@ -516,7 +516,6 @@ record_close (int quitting) >>> =A0} >>> >>> =A0static int record_resume_step =3D 0; >>> -static int record_resume_error; >>> >>> =A0static void >>> =A0record_resume (struct target_ops *ops, ptid_t ptid, int step, >>> @@ -526,15 +525,7 @@ record_resume (struct target_ops *ops, p >>> >>> =A0if (!RECORD_IS_REPLAY) >>> =A0 =A0{ >>> - =A0 =A0 =A0if (do_record_message (get_current_regcache ())) >>> - =A0 =A0 =A0 =A0{ >>> - =A0 =A0 =A0 =A0 =A0record_resume_error =3D 0; >>> - =A0 =A0 =A0 =A0} >>> - =A0 =A0 =A0else >>> - =A0 =A0 =A0 =A0{ >>> - =A0 =A0 =A0 =A0 =A0record_resume_error =3D 1; >>> - =A0 =A0 =A0 =A0 =A0return; >>> - =A0 =A0 =A0 =A0} >>> + =A0 =A0 =A0record_message (get_current_regcache ()); >>> =A0 =A0 =A0record_beneath_to_resume (record_beneath_to_resume_ops, ptid= , 1, >>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0siggnal); >>> =A0 =A0} >>> @@ -586,14 +577,6 @@ record_wait (struct target_ops *ops, >>> >>> =A0if (!RECORD_IS_REPLAY) >>> =A0 =A0{ >>> - =A0 =A0 =A0if (record_resume_error) >>> - =A0 =A0 =A0 { >>> - =A0 =A0 =A0 =A0 /* If record_resume get error, return directly. =A0*/ >>> - =A0 =A0 =A0 =A0 status->kind =3D TARGET_WAITKIND_STOPPED; >>> - =A0 =A0 =A0 =A0 status->value.sig =3D TARGET_SIGNAL_ABRT; >>> - =A0 =A0 =A0 =A0 return inferior_ptid; >>> - =A0 =A0 =A0 } >>> - >>> =A0 =A0 =A0if (record_resume_step) >>> =A0 =A0 =A0 { >>> =A0 =A0 =A0 =A0 /* This is a single step. =A0*/ >>> > >