From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15487 invoked by alias); 6 Sep 2010 14:25:44 -0000 Received: (qmail 15474 invoked by uid 22791); 6 Sep 2010 14:25:43 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Sep 2010 14:25:01 +0000 Received: (qmail 26684 invoked from network); 6 Sep 2010 14:24:59 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 6 Sep 2010 14:24:59 -0000 From: Pedro Alves To: Yao Qi Subject: Re: [PATCH,ARM] Fix single step on vfork Date: Mon, 06 Sep 2010 14:56:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: gdb-patches@sourceware.org References: <4C7E85C0.3050902@codesourcery.com> <201009061257.20113.pedro@codesourcery.com> <4C84ECB9.8040601@codesourcery.com> In-Reply-To: <4C84ECB9.8040601@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201009061524.54659.pedro@codesourcery.com> 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: 2010-09/txt/msg00158.txt.bz2 On Monday 06 September 2010 14:29:29, Yao Qi wrote: > Pedro Alves wrote: > > > > Thanks. Please go ahead with your patch. Hope you don't mind I tweak > > the comment a bit afterwards. > > > Pedro, > Thanks for your view, and free to tweak the comment. > > Committed to GDB mainline, > http://www.cygwin.com/ml/gdb-cvs/2010-09/msg00042.html > > Once you changed the comment, I'd like to merge it to GDB 7.2 branch then. Okay. I've now applied this to mainline. -- Pedro Alves 2010-09-06 Pedro Alves * infrun.c (resume): Extend comment on ignoring single-step requests on vfork parents waiting for a vfork-done. --- gdb/infrun.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) Index: src/gdb/infrun.c =================================================================== --- src.orig/gdb/infrun.c 2010-09-06 14:33:12.000000000 +0100 +++ src/gdb/infrun.c 2010-09-06 15:13:27.000000000 +0100 @@ -1560,13 +1560,19 @@ resume (int step, enum target_signal sig QUIT; - /* Don't consider single-stepping when the inferior is - waiting_for_vfork_done, either software or hardware step. In - software step, child process will hit the software single step - breakpoint inserted in parent process. In hardware step, GDB - can resumes inferior, and wait for vfork_done event. */ if (current_inferior ()->waiting_for_vfork_done) { + /* Don't try to single-step a vfork parent that is waiting for + the child to get out of the shared memory region (by exec'ing + or exiting). This is particularly important on software + single-step archs, as the child process would trip on the + software single step breakpoint inserted for the parent + process. Since the parent will not actually execute any + instruction until the child is out of the shared region (such + are vfork's semantics), it is safe to simply continue it. + Eventually, we'll see a TARGET_WAITKIND_VFORK_DONE event for + the parent, and tell it to `keep_going', which automatically + re-sets it stepping. */ if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: resume : clear step\n");