From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25228 invoked by alias); 24 Sep 2009 03:10:42 -0000 Received: (qmail 25219 invoked by uid 22791); 24 Sep 2009 03:10:41 -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; Thu, 24 Sep 2009 03:10:36 +0000 Received: by pxi40 with SMTP id 40so1155554pxi.24 for ; Wed, 23 Sep 2009 20:10:35 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.24.40 with SMTP id b40mr225792wfj.0.1253761834070; Wed, 23 Sep 2009 20:10:34 -0700 (PDT) In-Reply-To: References: <4AA5D713.1060305@vmware.com> <20090908065843.GO30677@adacore.com> <4AA68C92.7070905@vmware.com> From: Hui Zhu Date: Thu, 24 Sep 2009 03:10:00 -0000 Message-ID: Subject: Re: [RFA] let record_resume fail immediately on error To: Michael Snyder , Joel Brobecker Cc: "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/msg00738.txt.bz2 Hi Joel, Sorry to disturb you. Ping 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 inferio= r. >>>> >>>> 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: >>>>>>> >>>>>>> =A0 if (!RECORD_IS_REPLAY) >>>>>>> =A0 =A0 { >>>>>>> =A0 =A0 =A0 if (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_reco= rd_message failed.")); >>>>>>> + >>>>>> >>>>>> Forgive me if I'm wrong, as I don't know the record.c code at all, b= ut >>>>>> 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 =A0/* If record_resume get error, return directly. =A0*/ > =A0 =A0 =A0 =A0 =A0status->kind =3D TARGET_WAITKIND_STOPPED; > =A0 =A0 =A0 =A0 =A0status->value.sig =3D TARGET_SIGNAL_0; > =A0 =A0 =A0 =A0 =A0return 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 =A0* record.c (record_resume_error): Deleted. > =A0 =A0 =A0 =A0(record_resume): Call record_message. > =A0 =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 > > =A0 if (!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 =A0 record_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 =A0 siggnal); > =A0 =A0 } > @@ -586,14 +577,6 @@ record_wait (struct target_ops *ops, > > =A0 if (!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 =A0 if (record_resume_step) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0/* This is a single step. =A0*/ >