From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30075 invoked by alias); 16 Oct 2009 03:37:07 -0000 Received: (qmail 30066 invoked by uid 22791); 16 Oct 2009 03:37:06 -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; Fri, 16 Oct 2009 03:37:02 +0000 Received: by pwj3 with SMTP id 3so245949pwj.8 for ; Thu, 15 Oct 2009 20:37:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.9.32 with SMTP id 32mr89625wfi.112.1255664221062; Thu, 15 Oct 2009 20:37:01 -0700 (PDT) In-Reply-To: <4AD75806.9070705@vmware.com> References: <20090928160728.GB9003@adacore.com> <20091014021007.GO5272@adacore.com> <20091014024202.GQ5272@adacore.com> <20091015045834.GY5272@adacore.com> <20091015162326.GA5272@adacore.com> <4AD75806.9070705@vmware.com> From: Hui Zhu Date: Fri, 16 Oct 2009 03:37: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 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/msg00359.txt.bz2 > Hui, try returning signal zero. GDB will just report that you > stopped, without saying anything about a signal. > > Old trick of mine. ;-) Cool! The signal 0 make the output like following: The next instruction is syscall exit_group. It will make the program exit. Do you want to stop the program?([y] or n) Process record: inferior program stopped. [process 25901] #1 stopped. 0xb7fe3405 in __kernel_vsyscall () (gdb) rc Or: Process record doesn't support instruction rdtsc. Process record doesn't support instruction 0xf31 at address 0x8048391. Process record: failed to record execution log. [process 25947] #1 stopped. main (argc=, argv=, envp=) at 2.c:16 16 asm ("rdtsc"); I make a new patch for it. Please help me with it. Thanks, Hui 2009-10-16 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 | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) --- a/record.c +++ b/record.c @@ -643,7 +643,6 @@ record_close (int quitting) } static int record_resume_step = 0; -static int record_resume_error; static void record_resume (struct target_ops *ops, ptid_t ptid, int step, @@ -653,15 +652,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); } @@ -713,14 +708,6 @@ record_wait (struct target_ops *ops, if (!RECORD_IS_REPLAY) { - 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. */ @@ -766,6 +753,8 @@ record_wait (struct target_ops *ops, if (!do_record_message (get_current_regcache (), TARGET_SIGNAL_0)) { + status->kind = TARGET_WAITKIND_STOPPED; + status->value.sig = TARGET_SIGNAL_0; break; } record_beneath_to_resume (record_beneath_to_resume_ops,