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: [RFA] gdb/win32-nat.c: do not call CloseHandle on process and 	thread handles
Date: Fri, 23 Nov 2007 01:18:00 -0000	[thread overview]
Message-ID: <20071123011754.GB31180@ednor.casa.cgf.cx> (raw)
In-Reply-To: <4053daab0711220637h2bc01450ra45a19f4013fd44d@mail.gmail.com>

On Thu, Nov 22, 2007 at 02:37:26PM +0000, Pedro Alves wrote:
>Don't know, you'll have to check, but I doubt it.  It just might be
>easier to always open a handle to the process (OpenProcess), and not
>touch the one coming on the event.  Then you would always close the
>process handle, because you know you're the one who opened it.  OTTOMH,
>gdbserver does something similar, but leaks.  This uses an extra handle
>on the normal case, but I don't think I'd care, as long as there are no
>leaks.  Otherwise, you'll just have to keep a flag somewhere.

Are you sure that it's always possible for the debugger to open a handle
to the process?  It is a given that there will always be a handle
available via the debugging interface but I don't know that it is a
given that a nonprivileged process would necessarily be able to open a
handle to a privileged process.  I think I'd prefer a flag.

And, it should be easy to create a program which has no main thread.
Just write a program which has two threads, exit the main thread and
attach to the program.

cgf


  reply	other threads:[~2007-11-23  1:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22 12:49 Pierre Muller
2007-11-22 12:56 ` Pedro Alves
2007-11-22 13:56   ` Pierre Muller
2007-11-22 14:37     ` Pedro Alves
2007-11-23  1:18       ` Christopher Faylor [this message]
2007-11-23 16:21         ` Pierre Muller
2007-11-24  5:44           ` Christopher Faylor
2007-11-26  9:21             ` [RFA 2] " Pierre Muller
2007-12-02  5:46               ` Christopher Faylor
2007-11-23 16:33         ` [RFA] " 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=20071123011754.GB31180@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