From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32203 invoked by alias); 3 Nov 2009 18:57:02 -0000 Received: (qmail 32190 invoked by uid 22791); 3 Nov 2009 18:57:01 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from smtp-outbound-1.vmware.com (HELO smtp-outbound-1.vmware.com) (65.115.85.69) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 03 Nov 2009 18:56:56 +0000 Received: from mailhost2.vmware.com (mailhost2.vmware.com [10.16.67.167]) by smtp-outbound-1.vmware.com (Postfix) with ESMTP id 3CFFC13667; Tue, 3 Nov 2009 10:56:55 -0800 (PST) Received: from [10.20.94.141] (msnyder-server.eng.vmware.com [10.20.94.141]) by mailhost2.vmware.com (Postfix) with ESMTP id 1CFF78E638; Tue, 3 Nov 2009 10:56:55 -0800 (PST) Message-ID: <4AF07CF2.1050902@vmware.com> Date: Tue, 03 Nov 2009 18:57:00 -0000 From: Michael Snyder User-Agent: Thunderbird 1.5.0.12 (X11/20090624) MIME-Version: 1.0 To: Hui Zhu CC: Joel Brobecker , "gdb-patches@sourceware.org" Subject: Re: [RFA] let record_resume fail immediately on error References: <20090928160728.GB9003@adacore.com> <20091014024202.GQ5272@adacore.com> <20091015045834.GY5272@adacore.com> <20091015162326.GA5272@adacore.com> <4AD75806.9070705@vmware.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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/msg00065.txt.bz2 Hui Zhu wrote: > Hi Michael, > > 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. You 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. Now you have two different ways of calling record_message. Seems inconsistant. No explanation, no comments explaining the difference. > 2009-11-03 Hui Zhu > > * record.c (record_resume_error): Deleted. > (record_resume): Call record_message. > (record_wait): Deleted record_resume_error. > Set status when do_record_message need stop the inferior. > > --- > record.c | 29 ++++++++++------------------- > 1 file changed, 10 insertions(+), 19 deletions(-) > > --- a/record.c > +++ b/record.c > @@ -954,7 +954,6 @@ record_close (int quitting) > } > > static int record_resume_step = 0; > -static int record_resume_error; > > /* "to_resume" target method. Resume the process record target. */ > > @@ -966,15 +965,11 @@ record_resume (struct target_ops *ops, p > > if (!RECORD_IS_REPLAY) > { > - if (do_record_message (get_current_regcache (), signal)) > - { > - record_resume_error = 0; > - } > - else > - { > - record_resume_error = 1; > - return; > - } > + struct record_message_args args; > + > + args.regcache = get_current_regcache (); > + args.signal = signal; > + record_message (&args); > record_beneath_to_resume (record_beneath_to_resume_ops, ptid, 1, > signal); > } > @@ -1038,14 +1033,6 @@ record_wait (struct target_ops *ops, > > if (!RECORD_IS_REPLAY && ops != &record_core_ops) > { > - if (record_resume_error) > - { > - /* If record_resume get error, return directly. */ > - status->kind = TARGET_WAITKIND_STOPPED; > - status->value.sig = TARGET_SIGNAL_ABRT; > - return inferior_ptid; > - } > - > if (record_resume_step) > { > /* This is a single step. */ > @@ -1091,7 +1078,11 @@ record_wait (struct target_ops *ops, > Therefore we will not return to gdb. > Record the insn and resume. */ > if (!do_record_message (regcache, TARGET_SIGNAL_0)) > - break; > + { > + status->kind = TARGET_WAITKIND_STOPPED; > + status->value.sig = TARGET_SIGNAL_0; > + break; > + } > > record_beneath_to_resume (record_beneath_to_resume_ops, > ptid, 1,