public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Tom Tromey <tom@tromey.com>
Cc: Pedro Alves <palves@redhat.com>,
	Simon Marchi <simon.marchi@polymtl.ca>,
	Tim Newsome <tim@sifive.com>, gdb <gdb@sourceware.org>
Subject: Re: gdb requires watchpoints to fire after the write
Date: Thu, 30 Aug 2018 08:05:00 -0000	[thread overview]
Message-ID: <20180830080353.GA2602@adacore.com> (raw)
In-Reply-To: <87ftywx54n.fsf@tromey.com>

> Pedro> Yeah, it's confusing.
> 
> [... great explanation ... ]
> 
> This would be great as comments in gdbarch.sh and target.h.
> None of these things have comments currently.

Agreed. I was going to send a patch doing so when I read Pedro's
message, and then read this. I'm happy to do the patch, but don't
want to start if Pedro is already on it.

> Pedro> We could most probably streamline all of this and come up with a better
> Pedro> design with some thought.  See also the comment in mips-tdep.c:
> 
> Pedro>   /* FIXME: cagney/2003-08-29: The macros target_have_steppable_watchpoint,
> Pedro>      HAVE_NONSTEPPABLE_WATCHPOINT, and target_have_continuable_watchpoint
> Pedro>      need to all be folded into the target vector.  Since they are
> Pedro>      being used as guards for target_stopped_by_watchpoint, why not have
> Pedro>      target_stopped_by_watchpoint return the type of watchpoint that the code
> Pedro>      is sitting on?  */
> Pedro>   set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1);
> 
> I'm curious about why this should be in the target rather than in the
> gdbarch.  It seems like a property of the ISA.
> 
> Is it possible for gdbserver to do the single-step itself, avoiding a
> round trip?  That was the only rationale I could think of.

It might not be gdbserver itself, which I don't think should try
to remain as minimalistic as possible in terms of this kind of
"intelligence", but maybe some other stubs?  For instance, a stub
might be designed to be usable against another kind of debugger
which might be expecting a certain type of behavior forcing
the stub to have to do the single-step itself. (?)

My perspective is that, if we don't have a concrete situation where
this functionality should be a property of the target, and we find
that it simplifies the code or avoids confusion to remove that target
property, then let's. The obvious question then becomes - what to do
with ia64-linux? Is this platform still in use and relevant enough
for us to invest energy into redesigning the watchpoint support on
this platform a bit?

-- 
Joel

  reply	other threads:[~2018-08-30  8:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-28 22:08 Tim Newsome
2018-08-29 15:33 ` Simon Marchi
2018-08-29 15:47   ` Joel Brobecker
2018-08-29 15:56     ` Pedro Alves
2018-08-29 16:02     ` Simon Marchi
2018-08-29 17:29       ` Pedro Alves
2018-08-29 20:13         ` Tim Newsome
2018-08-29 20:58         ` Tom Tromey
2018-08-30  8:05           ` Joel Brobecker [this message]
2018-08-31 15:37             ` Pedro Alves
2018-08-31 15:13           ` Pedro Alves

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=20180830080353.GA2602@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb@sourceware.org \
    --cc=palves@redhat.com \
    --cc=simon.marchi@polymtl.ca \
    --cc=tim@sifive.com \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).