Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jeff Johnston <jjohnstn@redhat.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sources.redhat.com, uweigand@de.ibm.com
Subject: Re: [RFA]: Fix for watchpoint regressions
Date: Mon, 21 Jun 2004 19:57:00 -0000	[thread overview]
Message-ID: <40D73DC0.5090601@redhat.com> (raw)
In-Reply-To: <2719-Mon21Jun2004220328+0300-eliz@gnu.org>

Eli Zaretskii wrote:
>>Date: Mon, 21 Jun 2004 11:40:31 -0400
>>From: Jeff Johnston <jjohnstn@redhat.com>
>>
>>2004-06-18  Jeff Johnston  <jjohnstn@redhat.com>
>>
>>         * infrun.c (handle_inferior_event): Initialize stopped_by_watchpoint
>>         to -1.
>>         * breakpoint.c (bpstat_stop_status): Move check for ignoring
>>         untriggered watchpoints to a separate if clause.  Update function
>>         comment regarding STOPPED_BY_WATCHPOINT argument.
> 
> 
> Won't this break the cases that caused the addition of testing that
> stopped_by_watchpoint is non-zero in bpstat_stop_status?
>

I took care to try to ensure that the problem the original patch was fixing was 
still being addressed.

The stopped_by_watchpoint flag was only being set by handle_inferior_event if 
HAVE_CONTINUABLE_WATCHPOINT is true.  In the cases where the flag should be 
tested, it will be set correctly to false (0) or true (1).  The problem is that 
there is third state (don't know) which is due to the fact that the flag is not 
set in certain cases and you don't really know if you are stopped by a 
watchpoint or not.  This occurs, for example, when HAVE_NONSTEPPABLE_WATCHPOINT 
or HAVE_STEPPABLE_WATCHPOINT is true as in the case of ia64.  The flags indicate 
that the watchpoint has triggered prior to the actual change or value.  The 
handle_inferior_event function steps through the watchpoint change.  At that 
point, the STOPPED_BY_WATCHPOINT test doesn't return true for ia64, were it to 
be tested.  My original attempt at this was to try and set the flag regardless 
of the HAVE_CONTINUABLE_WATCHPOINT.  It did not work because 
STOPPED_BY_WATCHPOINT is not true after the step.

Things worked in the past for ia64 because the code near the bottom of the loop 
in bpstat_stop_status would check whether a hardware watchpoint value had 
changed.  With Ulrich's original patch in place, this never happens because we 
never get to that piece of code in the loop.  With the revised patch, for the 
original scenario that Ulrich was fixing, we will not get to the watchpoint 
checking code, but for platforms that do not have HAVE_CONTINUABLE_WATCHPOINT, 
we will.  We won't yet be able to handle the breakpoint insn in code scenario 
for ia64 that Ulrich was fixing, but that is a separate fix.

I am looking at making another patch which would mark a watchpoint for the 
stepping cases so we can tell if a particular watchpoint triggered or not prior 
to the step and thus allow gdb to avoid having to randomly test all value 
changes.  This would help to eliminate the cases where we might report n 
different watchpoint changes for a line of code where the code in question may 
only be responsible for one of the value changes.  This would also allow the 
breakpoint insn in code scenario to work on ia64.

-- Jeff J.







  reply	other threads:[~2004-06-21 19:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-21 15:40 Jeff Johnston
2004-06-21 19:07 ` Eli Zaretskii
2004-06-21 19:57   ` Jeff Johnston [this message]
2004-06-22  4:24     ` Eli Zaretskii
2004-06-22 19:47       ` Jeff Johnston
2004-06-21 20:18 Ulrich Weigand

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=40D73DC0.5090601@redhat.com \
    --to=jjohnstn@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=uweigand@de.ibm.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