public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH,ARM] Fix single step on vfork
Date: Mon, 06 Sep 2010 14:56:00 -0000	[thread overview]
Message-ID: <201009061524.54659.pedro@codesourcery.com> (raw)
In-Reply-To: <4C84ECB9.8040601@codesourcery.com>

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  <pedro@codesourcery.com>

	* 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");

  reply	other threads:[~2010-09-06 14:25 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-01 16:56 Yao Qi
2010-09-01 17:11 ` Pedro Alves
2010-09-02  3:03   ` Yao Qi
2010-09-06 14:09     ` Pedro Alves
2010-09-06 14:25       ` Yao Qi
2010-09-06 14:56         ` Pedro Alves [this message]
2010-09-08 17:23           ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201009061524.54659.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).