From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29408 invoked by alias); 4 Nov 2009 05:15:34 -0000 Received: (qmail 29399 invoked by uid 22791); 4 Nov 2009 05:15:31 -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-pw0-f49.google.com (HELO mail-pw0-f49.google.com) (209.85.160.49) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 04 Nov 2009 05:15:24 +0000 Received: by pwj3 with SMTP id 3so3195338pwj.8 for ; Tue, 03 Nov 2009 21:15:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.142.55.20 with SMTP id d20mr100324wfa.322.1257311723095; Tue, 03 Nov 2009 21:15:23 -0800 (PST) In-Reply-To: <4AF07CF2.1050902@vmware.com> References: <20090928160728.GB9003@adacore.com> <20091015045834.GY5272@adacore.com> <20091015162326.GA5272@adacore.com> <4AD75806.9070705@vmware.com> <4AF07CF2.1050902@vmware.com> From: Hui Zhu Date: Wed, 04 Nov 2009 05:15: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-11/txt/msg00073.txt.bz2 >> Now we have a lot of patch in running. >> Could you please help me review this patch first? > > OK, could you help me understand it? > > You have an error-handler routine called do_record_message, > which calls record_message by way of catch_errors. =A0You call > do_record_message from two places, record_wait and record_resume. > > But now you want to bypass the error-handler routine when > you call record_message from record_resume, but keep it in > place for record_wait. =A0Now you have two different ways of > calling record_message. =A0Seems inconsistant. =A0No explanation, > no comments explaining the difference. > OK. I will try to talk clear about it. I make do_record_message because in before, call a error in record_resume and record_wait will make inferior cannot keep running. Now, I found that call error in record_resume will not affect anything. So I change do_record_message to record_message in record_resume. But in record_wait, call error still make inferior cannot keep running, so I keep do_record_message. Thanks, Hui > > >> 2009-11-03 =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. >> =A0 =A0 =A0 =A0Set status when do_record_message need stop the inferior. >> >> --- >> =A0record.c | =A0 29 ++++++++++------------------- >> =A01 file changed, 10 insertions(+), 19 deletions(-) >> >> --- a/record.c >> +++ b/record.c >> @@ -954,7 +954,6 @@ record_close (int quitting) >> =A0} >> >> =A0static int record_resume_step =3D 0; >> -static int record_resume_error; >> >> =A0/* "to_resume" target method. =A0Resume the process record target. = =A0*/ >> >> @@ -966,15 +965,11 @@ record_resume (struct target_ops *ops, p >> >> =A0 if (!RECORD_IS_REPLAY) >> =A0 =A0 { >> - =A0 =A0 =A0if (do_record_message (get_current_regcache (), signal)) >> - =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 =A0struct record_message_args args; >> + >> + =A0 =A0 =A0args.regcache =3D get_current_regcache (); >> + =A0 =A0 =A0args.signal =3D signal; >> + =A0 =A0 =A0record_message (&args); >> =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 signal); >> =A0 =A0 } >> @@ -1038,14 +1033,6 @@ record_wait (struct target_ops *ops, >> >> =A0 if (!RECORD_IS_REPLAY && ops !=3D &record_core_ops) >> =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*/ >> @@ -1091,7 +1078,11 @@ record_wait (struct target_ops *ops, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Therefore we will not re= turn to gdb. >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Record the insn and resu= me. =A0*/ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (!do_record_message (regca= che, TARGET_SIGNAL_0)) >> - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 { >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 status->kind =3D T= ARGET_WAITKIND_STOPPED; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 status->value.sig = =3D TARGET_SIGNAL_0; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 break; >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 } >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0record_beneath_to_resume >> (record_beneath_to_resume_ops, >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0ptid, 1, > >