From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v4 2/3] Forget watchpoint locations when inferior exits or is killed/detached
Date: Fri, 24 Jun 2016 19:10:00 -0000 [thread overview]
Message-ID: <29fd882b-a60e-ed27-ff15-2399c9551668@redhat.com> (raw)
In-Reply-To: <86oa70rpv7.fsf@gmail.com>
On 06/17/2016 12:55 PM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
>
>> + /* Get rid of existing locations, which are no longer
>> + valid. New ones will be created in
>> + update_watchpoint, when the inferior is
>> + restarted. */
>> + b->loc = NULL;
>
> Use decref_bp_location or is it intended?
>
It's intended. The b->loc chain doesn't count for incr/decref.
It really holds weak references. The strong references are either
in the global location chain or the bpstat chains. So the next time
update_global_location_list is called, locations that are found
to not be referenced by any breakpoint are garbage collected then,
via decref_bp_location.
See how update_breakpoint_locations simply hoists old locations
out of the breakpoint, but doesn't decref them. [Used to clearer
before c2f4122d5cc2 ("Limit breakpoint re-set to the current
program space") though].
Thanks,
Pedro Alves
next prev parent reply other threads:[~2016-06-24 19:10 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-16 23:33 [PATCH v4 0/3] Fix failure to detach if process exits while detaching on Linux Pedro Alves
2016-06-16 23:32 ` [PATCH v4 1/3] Factor out "Detaching from program" message printing Pedro Alves
2016-06-17 11:31 ` Yao Qi
2016-06-16 23:33 ` [PATCH v4 3/3] Fix failure to detach if process exits while detaching on Linux Pedro Alves
2016-06-17 13:03 ` Antoine Tremblay
2016-06-24 19:30 ` Pedro Alves
2016-06-17 15:07 ` Yao Qi
2016-06-24 19:28 ` Pedro Alves
2016-06-16 23:33 ` [PATCH v4 2/3] Forget watchpoint locations when inferior exits or is killed/detached Pedro Alves
2016-06-17 11:56 ` Yao Qi
2016-06-24 19:10 ` Pedro Alves [this message]
2016-07-01 10:49 ` Pedro Alves
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=29fd882b-a60e-ed27-ff15-2399c9551668@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=qiyaoltc@gmail.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).