Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@sourceware.org>
To: Pedro Alves <pedro_alves@portugalmail.pt>,
	gdb-patches@sourceware.org,
		Pierre Muller <muller@ics.u-strasbg.fr>
Subject: Re: [RFC] win32-nat.c: Handle EXCEPTION_INVALID_HANDLE as SIGSYS
Date: Mon, 29 Oct 2007 03:07:00 -0000	[thread overview]
Message-ID: <20071029030556.GA18776@trixie.casa.cgf.cx> (raw)
In-Reply-To: <4053daab0710240139o1898369jc54fbb75c6c48cef@mail.gmail.com>

On Wed, Oct 24, 2007 at 09:39:58AM +0100, Pedro Alves wrote:
>Pierre Muller wrote:
>>
>>   If I cut my patch into three parts:
>> 3) Remove wrong CloseHandle calls
>
>I'd prefer if this went in first.  I'm convinced this is the correct
>thing to do everywhere.

I agree.  I thought that I noticed that these handles needed to be
closed so I'd rather that my confusion go away as soon as possible.

>(Hey, I'm happy in that allows me to remove an ugly #ifdef in
>gdbserver/win32-low.c.)
>
>( ( ( If it isn't [the correct thing to do everywhere], then we can
>follow Cygwin's lead, and
>install a top level SEH handler in gdb that handles this exception.
>It could have
>always have been done in gdb the first place, even for Cygwin.  Remember, the
>exception is only thrown iff a debugger is attached, and a debugger
>can easilly not
>pass it to the inferior.  That would mean 0 changes to win32-nat.c debug API
>usage.  Of course, any other inferior that throws that exception will have
>the same problem. ) ) )
>
>> 1) Handle EXCEPTION_INVALID_HANDLE exception as a SIGSYS target signal
>> 2) Add the stoponinvalidhandle
>
>EXCEPTION_INVALID_HANDLE is not quite a SIGSYS.  Plus, a Cygwin inferior should
>never see this, as you shouldn't be using CloseHandle in user apps there anyway.
>Maybe we can take the oportunity to implement more generic Windows exceptions
>support, not just EXCEPTION_INVALID_HANDLE.  Something similar to the "handle"
>command.

That seems like a better way to go to me.

However, even if it isn't the need to do something like:

if (something)
  DoSomething(arg)

should really make you think "Hey, I guess I'd better use a function" which
tests something and then calls DoSomething with the arg.

>> then, after the 1) is applied,
>> you will get several SIGSYS when debugging gdb with itself.
>>   I suppose that this would introduce lots of
>> new failures to the testsuite, especially in the gdb.gdb subdirectory.
>>
>
>Only on MinGW gdb, so they wouldn't qualify as "new" failures.  And only on
>tests that load gdb in gdb, or that have a `close' with a broken argument.
>
>>   I would really prefer to keep trace of
>> the old CloseHandles, in case we discover that under special
>> circumstances, or for some versions of the system,
>> these calls are needed.
>>
>
>I'd prefer we don't add such ugliness.

Ditto.

cgf


      parent reply	other threads:[~2007-10-29  3:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22 14:14 Pierre Muller
2007-10-22 21:15 ` Eli Zaretskii
2007-10-23 22:06 ` Christopher Faylor
2007-10-23 22:26   ` Daniel Jacobowitz
2007-10-24  5:21   ` Eli Zaretskii
2007-10-24  8:40     ` Pierre Muller
2007-10-24 19:07       ` Eli Zaretskii
2007-10-24 11:47     ` Pedro Alves
2007-10-24  8:13   ` Pierre Muller
2007-10-24  8:51     ` Pedro Alves
2007-10-24 19:19       ` Eli Zaretskii
2007-10-24 19:37         ` Mark Kettenis
2007-10-24 19:40         ` Daniel Jacobowitz
2007-10-24 20:15           ` Eli Zaretskii
2007-10-29  8:25           ` Christopher Faylor
2007-10-29  3:07       ` Christopher Faylor [this message]

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=20071029030556.GA18776@trixie.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@sourceware.org \
    --cc=gdb-patches@sourceware.org \
    --cc=muller@ics.u-strasbg.fr \
    --cc=pedro_alves@portugalmail.pt \
    /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