Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Marc Khouzam <marc.khouzam@ericsson.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [Patch] Watchpoint condition fix
Date: Wed, 16 Apr 2008 22:15:00 -0000	[thread overview]
Message-ID: <20080416213350.GC3626@adacore.com> (raw)
In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA04E1BCD0@ecamlmw720.eamcs.ericsson.se>

> Watchpoint conditions are broken because they get deleted when a
> watchpoint gets re-inserted.  When watchpoints get re-inserted, the
> condition string should be always reparsed.

I agree with you and Vladimir.

> @@ -986,7 +986,7 @@
>             value_free (v);
>         }
>  
> -      if (reparse && b->cond_string != NULL)
> +      if (b->cond_string != NULL)

This part of the change is OK, but I would like to see a comment
explaining why we have to re-evaluate the condition regardless of
the value of reparse.  Vladimir's explaination on the gdb@ mailing
list pretty much covers it.

>         {
>           char *s = b->cond_string;
>           if (b->loc->cond)

Also, you can remove the block of code that checks b->loc->cond
and frees when non-NULL, since we've just re-created the bplocs
earlier and we know that their cond field is NULL. As a result,
the temporary variable "s" shouldn't be necessary either.

As an aside, but this is not your doing, I think we have a memory leak.
We appear to be doing an xfree of each bp_location of our watchpoint,
but instead we should call free_bp_location (). Vladimir, do you agree?
(I will take care of doing that if you agree)

Thank you,
-- 
Joel


  reply	other threads:[~2008-04-16 21:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-10 14:21 Marc Khouzam
2008-04-16 22:15 ` Joel Brobecker [this message]
2008-04-17 18:48   ` Marc Khouzam
2008-04-17 21:09     ` Joel Brobecker
2008-04-18 10:10       ` Marc Khouzam
2008-04-19  1:39         ` Doug Evans
2008-04-19  1:58           ` Joel Brobecker
2008-04-22 20:36         ` Joel Brobecker

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=20080416213350.GC3626@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.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