Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@sourceware.org>
To: gdb-patches@sourceware.org
Subject: Re: [RFC] win32-nat.c 'set new-console' and interruption
Date: Tue, 24 Jun 2008 18:29:00 -0000	[thread overview]
Message-ID: <20080624180819.GB8439@ednor.casa.cgf.cx> (raw)
In-Reply-To: <200806241331.23092.pedro@codesourcery.com>

On Tue, Jun 24, 2008 at 01:31:22PM +0100, Pedro Alves wrote:
>A Tuesday 24 June 2008 02:13:37, Christopher Faylor wrote:
>
>> Which is not me.
>
>I know.  I really didn't mean to imply you were one of them.
>
>> If you want gdb to be usable on systems other than Windows XP and beyond
>> then you can't use SuspendThread.
>>
>> I'm not speaking from theory.  I'm speaking from experience.
>
>As I said, I know you have been all over this before.  I'm not
>trying to be picky on you.  :-)
>
>Wasn't the conclusion that calling GetThreadContext blocks
>until the thread really suspends, or that GetThreadContext fails
>if the thread hasn't suspend yet?  Like here:
>
>http://cygwin.com/ml/cygwin-developers/2005-12/msg00005.html
>
>What was the outcome of that?

I have no idea.  Cygwin does use SuspendThread but only when it has no
other alternative.  And, it can still cause problems on older windows.

>I really would like to know of a problem it has caused by using
>it from a debugger, that is, from a process which isn't the
>owner of the thread; instead of a problem caused by calling
>SuspendThread on a thread of the current process.
>
>> If this wasn't something that we wanted to do then we shouldn't be
>> carefully autoloading functions that only exist in XP in win32-nat.c.
>
>Right, but that's a bit of a different issue.  SuspendThread has
>been available in win32 since ever.  DebugBreakProcess hasn't.

This has nothing to do with the availability of SuspendThread.  It has
to do with how well SuspendThread works.

Once again: we go out of the way to make sure that gdb works on older
windows.  That means that you can't assume that something that works on
newer windows is ok to use.  SuspendThread does not work reliably on
older windows.

If the consensus here is that we can give up on Windows NT4 (and maybe
even Windows 2000) and before that's fine.  Otherwise, either
SuspendThread calls have to be guarded with OS tests or not used at all.

cgf


  reply	other threads:[~2008-06-24 18:08 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-21 17:05 Pierre Muller
2008-06-21 18:37 ` Christopher Faylor
2008-06-22  3:17   ` Daniel Jacobowitz
2008-06-22  3:18     ` Corinna Vinschen
2008-06-23  1:04       ` Christopher Faylor
2008-06-23  1:10         ` Corinna Vinschen
2008-06-23  7:40         ` Pierre Muller
2008-06-23 12:00           ` Christopher Faylor
2008-06-23 16:05             ` Pierre Muller
2008-06-23 17:00               ` Pedro Alves
2008-06-23 17:25                 ` Pierre Muller
2008-06-23 18:03                 ` Christopher Faylor
2008-06-23 19:24                   ` Pedro Alves
2008-06-23 20:33                     ` Pierre Muller
2008-06-23 21:06                       ` Joel Brobecker
2008-06-24  6:33                         ` Christopher Faylor
2008-06-24 13:36                           ` [RFC-v3] " Pierre Muller
2008-06-24  2:33                     ` [RFC] " Christopher Faylor
2008-06-24 13:54                       ` Pedro Alves
2008-06-24 18:29                         ` Christopher Faylor [this message]
2008-06-22  9:00     ` Christopher Faylor
2008-06-23  8:52   ` [RFC v2] " 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=20080624180819.GB8439@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    /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