Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@is.elta.co.il>
To: Christopher Faylor <cgf@redhat.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA 2] Debug register support in win32-nat.c (need opinions)
Date: Mon, 14 Jan 2002 00:15:00 -0000	[thread overview]
Message-ID: <Pine.SUN.3.91.1020114101332.14027I-100000@is> (raw)
In-Reply-To: <20020114015821.GA1584@redhat.com>


On Sun, 13 Jan 2002, Christopher Faylor wrote:

> >I agree that the linux implementation does not set the debug registers
> >for all threads but this means that if a watched expression is modified
> >by another thread than the current thread at the time of setting the
> >watchpoint will not be caught and that is much worse...
> 
> You described this in your original email.  I should have responded to
> it.
> 
> I don't think it makes sense to make gratuitous changes to the way gdb
> works.  If you're implementing an improvement for gdb for Windows then
> I think it should probably work the same way for Windows as it does
> for linux.
> 
> I guess I need a ruling from more experienced maintainers about this.
> 
> How should gdb behave in this scenario?

I'm not an expert, so this is FWIW:

The basic assumption behind the generic x86 watchpoint code in
i386-nat.c is that the watchpoints are not thread-specific.  That's
why i386-nat.c stores the info in a single array that doesn't have
thread information, and that's why the I386_DR_LOW_* macros don't
accept a thread id as an argument.

IIRC, this issue was discussed back when I published the first draft
of the watchpoint API, and the general consensus was that I shouldn't
bother about thread-specific watchpoints.  You may wish to reread that
discussion (I can dig out a pointer to it if you cannot find it.)

I also agree with Pierre that global watchpoints are much better than
thread-local ones.  For starters, you can always write a condition for
a global watchpoint that lets the debuggee continue if the thread id
is not what you want; but pulling the reverse trick with thread-local
watchpoints is impossible.

So if indeed GNU/Linux versions of GDB set watchpoints on a per thread
basis (I'm surprised they do), I think that's a misfeature, to say the
least.


  reply	other threads:[~2002-01-14  8:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-08  1:21 [RFA 2] Debug register support in win32-nat.c Pierre Muller
2002-01-08  1:26 ` Pierre Muller
2002-01-13 10:38   ` Christopher Faylor
2002-01-13 15:21     ` muller
2002-01-13 17:58       ` [RFA 2] Debug register support in win32-nat.c (need opinions) Christopher Faylor
2002-01-14  0:15         ` Eli Zaretskii [this message]
2002-01-14  0:33           ` Pierre Muller
2002-01-30  9:20             ` Christopher Faylor
2002-02-04  3:04               ` Pierre Muller

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=Pine.SUN.3.91.1020114101332.14027I-100000@is \
    --to=eliz@is.elta.co.il \
    --cc=cgf@redhat.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