Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: Re: [patch 1/3] Clear stale specific locs, not whole bpts [rediff]
Date: Mon, 24 May 2010 12:18:00 -0000	[thread overview]
Message-ID: <201005232240.17414.pedro@codesourcery.com> (raw)
In-Reply-To: <20100517212243.GA25843@host0.dyn.jankratochvil.net>

On Monday 17 May 2010 22:22:43, Jan Kratochvil wrote:
>  static void free_bp_location (struct bp_location *loc)
>  {
> +  /* Be sure no bpstat's are pointing at it after it's been freed.  */
> +  /* FIXME, how can we find all bpstat's?
> +     We just check stop_bpstat for now.  Note that we cannot just
> +     remove bpstats pointing at bpt from the stop_bpstat list
> +     entirely, as breakpoint commands are associated with the bpstat;
> +     if we remove it here, then the later call to
> +         bpstat_do_actions (&stop_bpstat);
> +     in event-top.c won't do anything, and temporary breakpoints
> +     with commands won't work.  */
> +
> +  iterate_over_threads (bpstat_remove_bp_location_callback, loc);
> +

I think this isn't the best place for this, considering moribund
breakpoint locations --- it's too late.  When you delete a
breakpoint in non-stop/always-inserted modes, you'll delete
the breakpoint, but deleting the bp_location itself is deferred.
This means that in that case, the thread's bpstat chains may still
contain references to bp_locations that are now in the moribund list
(those will be still valid objects, not xfree'd yet), but their owner
breakpoint is gone, meaning bpstat walks can still dereference those
now invalid bp_location->owner pointers.

Instead, can you move this to within in the `if (!found_object)' branch
of update_global_location_list?  That is, move it close to where we
detected we had unlinked the bp_location from the global
location list?

-- 
Pedro Alves


  reply	other threads:[~2010-05-23 21:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-03 20:02 [patch 1/3] Clear stale specific locs, not whole bpts Jan Kratochvil
2010-05-17 21:25 ` [patch 1/3] Clear stale specific locs, not whole bpts [rediff] Jan Kratochvil
2010-05-24 12:18   ` Pedro Alves [this message]
2010-06-04 19:19     ` Jan Kratochvil
2010-06-07 11:50       ` Pedro Alves
2010-06-07 13:40         ` Jan Kratochvil
2010-06-10 14:09           ` Frederic Riss
2010-06-10 20:39             ` Jan Kratochvil
2010-06-11  7:58               ` Frederic Riss
2010-06-11 13:00                 ` Jan Kratochvil
2010-06-11 10:50               ` Pedro Alves
2010-06-11 16:24               ` Ulrich Weigand
2010-06-11 18:34                 ` Jan Kratochvil
2010-06-11 21:51                   ` Ulrich Weigand
2010-06-11 21:59                     ` Jan Kratochvil

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=201005232240.17414.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jan.kratochvil@redhat.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