Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: "Breazeal, Don" <donb@codesourcery.com>,
	lgustavo@codesourcery.com,        gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix for follow-fork: followed child doesn't stop
Date: Mon, 16 Jun 2014 13:19:00 -0000	[thread overview]
Message-ID: <539EEEC4.1080409@redhat.com> (raw)
In-Reply-To: <539A4EB0.6020205@codesourcery.com>

On 06/13/2014 02:06 AM, Breazeal, Don wrote:
> 
> Hi Pedro,
> Thanks for clarifying this for me.

Thanks for working on this.

> 
> On 6/6/2014 4:34 AM, Pedro Alves wrote:

> Set the cloned breakpoint as disabled from the moment it is created.
> This is done by modifying clone_momentary_breakpoint to take an
> additional argument, LOC_ENABLED, which is used as the value of the
> bp_location->enabled member.  The clone must be disabled at that point,
> rather than later, because clone_momentary_breakpoint calls
> update_global_location_list, which will treat the clone as a duplicate
> of the original breakpoint if it is enabled.
> 
> All the calls to clone_momentary_breakpoint had to be modified to pass
> '1' or '0'.  I looked at implementing an enum for the enabled member,
> but concluded that readability would suffer because there are so many
> places it is used as a boolean, e.g. "if (bl->enabled)".
> 
> In follow_inferior_reset_breakpoints, the clone is set to enabled once
> it has been associated with the child process.  With this, the
> bp_location 'inserted' member is maintained correctly throughout the
> follow-fork procedure and the behavior is as expected.
> 
> The same treatment is given to the exception_resume_breakpoint when
> following a fork.
> 
> Testing:
> 
> Ran 'make check' on Linux x64.
> 
> Along with the fix above, the coverage of the follow-fork test
> gdb.base/foll-fork.exp was expanded to:
> 
> 1) cover all the combinations of values for follow-fork-mode and
> detach-on-fork
> 
> 2) make sure that both user breakpoints and single-step breakpoints are
> propagated correctly to the child
> 
> 3) check that the inferior list has the expected contents after
> following the fork.
> 
> 4) check that unfollowed, undetached inferiors can be resumed.
> 

Excellent.

This version is OK.

Thanks!

-- 
Pedro Alves


  reply	other threads:[~2014-06-16 13:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-04 22:19 Don Breazeal
2014-06-05 12:52 ` Pedro Alves
2014-06-05 18:34   ` Breazeal, Don
2014-06-06 11:12     ` Pedro Alves
2014-06-06 11:42       ` Pedro Alves
2014-06-05 13:14 ` Luis Machado
2014-06-05 21:45   ` Breazeal, Don
2014-06-06 11:34     ` Pedro Alves
2014-06-13  1:07       ` Breazeal, Don
2014-06-16 13:19         ` Pedro Alves [this message]
2014-06-06 12:27     ` Luis Machado

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=539EEEC4.1080409@redhat.com \
    --to=palves@redhat.com \
    --cc=donb@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lgustavo@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