Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [ping] [patch] related_breakpoint stale ref crash fix
Date: Thu, 11 Feb 2010 22:29:00 -0000	[thread overview]
Message-ID: <20100211222846.GA4761@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <201002111917.05254.pedro@codesourcery.com>

On Thu, 11 Feb 2010 20:17:05 +0100, Pedro Alves wrote:
> On Thursday 11 February 2010 15:25:51, Jan Kratochvil wrote:
> > 2009-12-23  Jan Kratochvil  <jan.kratochvil@redhat.com>
> > 
> >         * breakpoint.c (delete_breakpoint <bpt->related_breakpoint != NULL>):
> >         New.
> 
> Yeah, OK.

Checked-in.


> I think you wanted:
> 
>    * breakpoint.c (delete_breakpoint) <bpt->related_breakpoint != NULL>:
> 
> It's 6.8.5 in the GCS.

I have remembered it wrong, fixed.


Thanks,
Jan


http://sourceware.org/ml/gdb-cvs/2010-02/msg00081.html

--- src/gdb/ChangeLog	2010/02/11 21:45:25	1.11348
+++ src/gdb/ChangeLog	2010/02/11 22:25:26	1.11349
@@ -1,3 +1,8 @@
+2010-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* breakpoint.c (delete_breakpoint) <bpt->related_breakpoint != NULL>:
+	New.
+
 2010-02-11  Pedro Alves  <pedro@codesourcery.com>
 
 	* ax-gdb.c (gen_exp_binop_rest) [BINOP_SUBSCRIPT]: Error out on
--- src/gdb/breakpoint.c	2010/01/26 23:56:53	1.452
+++ src/gdb/breakpoint.c	2010/02/11 22:25:27	1.453
@@ -8691,6 +8691,16 @@
   if (bpt->type == bp_none)
     return;
 
+  /* At least avoid this stale reference until the reference counting of
+     breakpoints gets resolved.  */
+  if (bpt->related_breakpoint != NULL)
+    {
+      gdb_assert (bpt->related_breakpoint->related_breakpoint == bpt);
+      bpt->related_breakpoint->disposition = disp_del_at_next_stop;
+      bpt->related_breakpoint->related_breakpoint = NULL;
+      bpt->related_breakpoint = NULL;
+    }
+
   observer_notify_breakpoint_deleted (bpt->number);
 
   if (breakpoint_chain == bpt)


      reply	other threads:[~2010-02-11 22:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-23 22:48 Jan Kratochvil
2010-02-11 15:26 ` [ping] " Jan Kratochvil
2010-02-11 19:17   ` Pedro Alves
2010-02-11 22:29     ` Jan Kratochvil [this message]

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=20100211222846.GA4761@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@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