Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Paul Koning <pkoning@equallogic.com>
To: eliz@gnu.org
Cc: weigand@i1.informatik.uni-erlangen.de, orjan.friberg@axis.com,
	kettenis@chello.nl, gdb-patches@sources.redhat.com,
	drow@false.org
Subject: Re: Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT
Date: Thu, 06 May 2004 13:44:00 -0000	[thread overview]
Message-ID: <16538.16676.33000.80626@gargle.gargle.HOWL> (raw)
In-Reply-To: <uekpyqe5t.fsf@gnu.org>

>>>>> "Eli" == Eli Zaretskii <eliz@gnu.org> writes:

 >> The trouble I ran into is that this doesn't work because (on
 >> remote target support for MIPS anyway) the watchpoint handling
 >> does an effective "stepi" after the watchpoint stop.  After that
 >> stepi, stopped_by_watchpoint() would return false because the most
 >> recent stop was due to a break (the stepi).

 Eli> But that is something the target-side code could handle, right?
 Eli> I mean, stopped_by_watchpoint has intimate knowledge about the
 Eli> target's particulars, so it could fiddle the stop reason if it
 Eli> saw the indication that a watchpoint fired _and_ that the most
 Eli> recent stop was due to a single-step, right?

 Eli> Failing that, we could have something like
 Eli> AUTO_STEPI_AFTER_WATCHPOINT in higher-level code in GDB
 Eli> (infrun.c or breakpoint.c) to handle such targets, but I
 Eli> generally think that the GDB application-level code should not
 Eli> bother itself with target-specific peculiarities if we can avoid
 Eli> that.

I'd have to do a bunch of memory refreshing to remind myself of the
various possibilities you're talking about...

History: I started from a remote stub that was very poorly
implemented, and handled things by faking a single-step locally.  This
was extremely ugly.

I observed that gdb had machinery to handle all this cleanly from the
gdb end, so I turned it on.  And sure enough, it worked for some
cases.  But not for all, for the reasons I mentioned.  I then looked
for a way to fix that with minimal perturbation to the existing
machinery.  

My conclusion was: the bug is that the internally generated stepi
causese the "stopped by watchpoint" status and associated address to
be forgotten, so the best fix is not to forget them.  That's what I
did.  The other bug was that the break/watch point list traversal
routine would mishandle some cases where no match was found, which is
why I changed that area, again trying to do minimal change to the
logic and fixing only the place where the code didn't do what the
apparent intent was.

As for gdb not doing target-specific peculiarities -- I'd say that
HAVE_NONSTEPPABLE_WATCHPOINTS is the way to pass that knowledge
around.  Having it where it lives today is clean because (as far as I
can tell) it puts the necessary special handling near where
break/watch/step live.  Trying to do it further down means you end up
replicating a lot more of the magic involved in stepping.  The mess I
started out with (stepi "implemented" at the remote stub, transparent
to gdb) convinced me of this.

	 paul


  reply	other threads:[~2004-05-06 13:44 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-04 22:10 Ulrich Weigand
2004-05-05  5:08 ` Eli Zaretskii
2004-05-05  8:26   ` Orjan Friberg
2004-05-06  4:58     ` Eli Zaretskii
2004-05-06 14:21       ` Daniel Jacobowitz
2004-05-06 18:02         ` Eli Zaretskii
2004-05-06 18:05           ` Daniel Jacobowitz
2004-05-07  8:18             ` Eli Zaretskii
2004-05-06 21:34   ` Ulrich Weigand
2004-05-06 21:36     ` Daniel Jacobowitz
2004-05-07  8:22       ` Eli Zaretskii
2004-05-07  8:23     ` Eli Zaretskii
2004-05-10 17:39       ` [PATCH] Fix watchpoints on s390 Ulrich Weigand
2004-05-11  6:27         ` Eli Zaretskii
2004-05-05 13:44 ` Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT Paul Koning
2004-05-06  5:08   ` Eli Zaretskii
2004-05-06 13:44     ` Paul Koning [this message]
2004-05-06 21:38   ` Ulrich Weigand
2004-05-06 21:49     ` Paul Koning
2004-05-07  8:18     ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2003-10-08  8:50 Orjan Friberg
2003-10-08 10:26 ` Eli Zaretskii
2003-10-08 13:36   ` Orjan Friberg
2003-10-08 16:02     ` Paul Koning
2004-04-06 10:14   ` Orjan Friberg
2004-04-06 14:22     ` Daniel Jacobowitz
2004-04-07  9:11       ` Orjan Friberg
2004-04-15  8:17       ` Eli Zaretskii
2004-04-15 13:24         ` Orjan Friberg
2004-04-16  7:18           ` Eli Zaretskii
2004-04-16  9:46             ` Orjan Friberg
2004-04-16 11:42           ` Orjan Friberg
2004-04-17  8:27             ` Eli Zaretskii
2004-04-19 14:59               ` Orjan Friberg
2004-04-22 15:08                 ` Orjan Friberg
2004-04-22 15:48                   ` Paul Koning
2004-04-22 18:40                   ` Eli Zaretskii
2004-04-22 19:07                     ` Paul Koning
2004-04-22 19:09                       ` Paul Koning
2004-04-23 18:20                       ` Eli Zaretskii
2004-04-23 18:22                   ` Eli Zaretskii
2004-04-26  9:04                     ` Orjan Friberg
2004-04-26  9:25                       ` Eli Zaretskii
2004-05-01 21:18                   ` Mark Kettenis
2004-05-02  4:48                     ` Eli Zaretskii
2004-05-03 11:25                       ` Orjan Friberg
2004-05-03 15:05                         ` Andrew Cagney
2004-05-03 18:01                           ` Eli Zaretskii
2004-05-03 18:36                             ` Andrew Cagney
2004-05-03 17:49                         ` Eli Zaretskii
2004-05-04  7:31                           ` Orjan Friberg
2004-05-04 23:52                             ` Daniel Jacobowitz

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=16538.16676.33000.80626@gargle.gargle.HOWL \
    --to=pkoning@equallogic.com \
    --cc=drow@false.org \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@chello.nl \
    --cc=orjan.friberg@axis.com \
    --cc=weigand@i1.informatik.uni-erlangen.de \
    /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