Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: "Maciej W. Rozycki" <macro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] windows-nat: Decode system error numbers
Date: Wed, 09 Nov 2011 15:25:00 -0000	[thread overview]
Message-ID: <20111109152441.GN14508@adacore.com> (raw)
In-Reply-To: <alpine.DEB.1.10.1111091050490.5099@tp.orcam.me.uk>

> and as it stands this is printed by the debuggee GDB:
> 
> error return .../gdb/windows-nat.c:2312 was 6
> 
> but with the patch applied a proper error message is produced instead:
> 
> error return .../gdb/windows-nat.c:2332 was: The handle is invalid. (6)

This is nice, I like it.

>  This code builds and works as manually verified above; these errors
>  never trigger in the test suite so that doesn't really cover it -- my
>  understanding is they are not meant to trigger unless GDB or the
>  system is malfunctioning for some reason.

I don't know of any way to force the triggering of these errors under
"normal" circumstances either.  But I did notice that we get them
occasionally during our testsuite nightly run, with an error number
5 (permissing denied kind of thing?).

This happened when trying to kill the inferior, for instance. It's very
hard to reproduce, very rare and random, so I've never been able to get
to the bottom of it. And the only hints I got on the web was that
Borland had the same problem, and that they "fixed" it. Since I could
not observe any anomaly besides the error message (inferior was killed
as expected, for instance), I was left wondering whether Borland just
disabled the error message...

> 2011-11-09  Maciej W. Rozycki  <macro@codesourcery.com>
> 
> 	gdb/
> 	* windows-nat.c (check): Decode the error number retrieved with 
> 	GetLastError.

A Windows maintainer can approve your code.  I looked at the code, and
nothing really jumped at me, except maybe the fact that you decrement
size and use it change one element in buf at the same time. Personally,
I'm not fond of these practices in general, but I can live with that in
this case.

-- 
Joel


  reply	other threads:[~2011-11-09 15:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-09 12:03 Maciej W. Rozycki
2011-11-09 15:25 ` Joel Brobecker [this message]
2011-11-09 16:45 ` Eli Zaretskii
2011-11-09 16:58   ` Pedro Alves
2011-11-09 17:03     ` Eli Zaretskii
2011-11-09 17:26       ` Pedro Alves
2011-11-09 17:07     ` Corinna Vinschen
2011-11-13 23:47       ` Christopher Faylor

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=20111109152441.GN14508@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@codesourcery.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