Re: RFA: Support Windows extended error numbers in safe_strerror

Mark Kettenis
2006-02-08T21:08:37Z

> Date: Tue, 7 Feb 2006 19:08:55 -0500
> From: Daniel Jacobowitz <drow@false.org>
>
> On Mon, Feb 06, 2006 at 05:58:29PM -0500, Daniel Jacobowitz wrote:
> > Could you explain why you don't like this one a little more clearly?
> >
> > Of course it'd be possible to write a complete replacement; I'd just
> > replace the call to the system strerror with a switch statement and
> > copy the strings out of the system runtime, or out of some other
> > standard source. But I don't see why that's any better than this, and
> > it's gratuituous duplication of information, so I'd like to understand
> > what you dislike about it.
> >
> > If it's the #define strerror that you dislike, two comments:
> >
> > - I could put an #ifdef around the one and only call to strerror
> > instead, in utils.c. I'd be perfectly happy with that.
> >
> > - I can't override the system strerror by defining my own copy; that
> > would be prone to breakage due to the workings of
> > __attribute__((dllimport)). I discussed that with Chris before posting
> > this version.
>
> Hi Mark,
>
> Have you had a chance to think about this? I realize it's only been a
> day, but I'm trying not to let these patches linger too long. I'd
> really like to understand what folks dislike about this patch, so
> that I can improve it. Same for the other patch; I replied to you
> about select.

I really think that we should drop MinGW support, and that the people
who want GDB on windows should work on fixing the apparent problems
with Cygwin. I cannot image that Cygwin is unique in having "DLL
hell" problem. People certainly must have found a proper solution for
this by now.

My dislike for this stuff is probably there because where I've been
cleaning out much of the host-specific quirks, this MinGW support
seems to add back a lot special tweaks, and since Windows is so
different from Unix-like systems, there's absolutely no hope, things
can be unified. That, together with the reintroduction of xm.h, seems
like a giant leap backwards to me. I really don't like that xm.h is
back now, since it sets a precedent. People have used these files for
quick hacks in the past, and the new xm.h will make it harder to tell
people that's not acceptable. I think there is a better approach
though. How about having the implementation of safe_strerror() and
gdb_select() in mingw-hdep.c and move the (trivial) existing
implementations of these functions to a new posix-hdep.c?

Speaking about gdb_select(), a really bad thing about your patch is
that we now have gdb_select(), but that some code still uses select()
and that the difference matters! Oh and there's a pasto in
gdb_select.h:

+#endif /* !defined(GDB_STRING_H) */

In light of the above, the following comment in ser-tcp.h is a plain
lie ;-):

/* Serial interface for raw TCP connections on Un*x like systems.

Mark