Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [patch] Simplify breakpoint.c function parameters
Date: Mon, 08 Dec 2008 07:35:00 -0000	[thread overview]
Message-ID: <ghiilu$rud$1@ger.gmane.org> (raw)
In-Reply-To: <20081207222253.GA6749@host0.dyn.jankratochvil.net>

Jan Kratochvil wrote:

> Hi,
> 
> the patch has no effect on the functionality but I find the simplified code
> less magic to understand.
> 
> It fixes a small bug - update_watchpoint() for bp_watchpoint (software
> watchpoint) created breakpoint locations bp_loc_hardware_watchpoint 

update_watchpoint() is documented thusly:

        /* Assuming that B is a hardware watchpoint:
           - Reparse watchpoint expression, is REPARSE is non-zero
           - Evaluate expression and store the result in B->val
           - Update the list of values that must be watched in B->loc.

           If the watchpoint is disabled, do nothing.  If this is
           local watchpoint that is out of scope, delete it.  */
        static void
        update_watchpoint (struct breakpoint *b, int reparse)

but it appears to be actually called from breakpoint_re_set_one for the
software watchpoint, too. I suspect it's a bug -- for software watchpoint
we don't have to get a list of values to watch, which update_watchpoint()
does more or less unconditionally. But this bug might be benign -- we probably
never actually insert the computed locations.

> while it 
> should be bp_loc_other.  But I am not aware of any (possibly negative) effect
> it had.
> 
> No regressions on {x86_64,ia64}-unknown-linux-gnu.

FWIW, this sounds reasonable and safe to me.

- Volodya



  reply	other threads:[~2008-12-08  7:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-07 22:24 Jan Kratochvil
2008-12-08  7:35 ` Vladimir Prus [this message]
2008-12-08 13:36   ` Jan Kratochvil
2008-12-08 11:06 ` 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='ghiilu$rud$1@ger.gmane.org' \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@sources.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