Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix cygwin compilation failure due to nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing
Date: Wed, 18 Dec 2013 17:03:00 -0000	[thread overview]
Message-ID: <834n66ccs9.fsf@gnu.org> (raw)
In-Reply-To: <20131218160707.GV30010@calimero.vinschen.de>

> Date: Wed, 18 Dec 2013 17:07:07 +0100
> From: Corinna Vinschen <vinschen@redhat.com>
> 
> 
> [1:text/plain Hide]
> 
> On Dec 18 17:45, Eli Zaretskii wrote:
> > > Date: Wed, 18 Dec 2013 12:20:45 +0100
> > > From: Corinna Vinschen <vinschen@redhat.com>
> > > 
> > > In theory, you should never use the ANSI API on Windows, unless you're
> > > still building GDB for Windows 9x, which should be really, really dead
> > > by now, hopefully.
> > 
> > Did we decide to drop Windows 9X support?  Unicode APIs will not work
> > on Windows 9X (in fact, I think Windows will refuse to run such a
> > gdb.exe), unless we link against unicows.dll.
> 
> I didn't say that.  I said I *hoped* that 9x is dead by now.

It's still widely used in some parts of the world, I'm told.

> > > - The ANSI API only supports a single- or doublebyte codeset in almost
> > >   all language versions of Windows.  There are only a handful languages
> > >   which are using UTF-8 as ANSI codeset on Windows, most use something
> > >   like CP1252 or some other codeset which is not capable of handling all
> > >   UNICODE characters.
> > > 
> > > - The ANSI API restricts filenames to MAX_PATH (260) characters, while
> > >   the UNICODE API and the underlying OS allow paths of up to 32K.
> > 
> > But the MinGW build of GDB is still in the ANSI codepage world, and
> > will probably remain there for the observable future, because Windows
> > runtime and file APIs don't understand UTF-8 encoding,
> 
> They do understand UNICODE if you use the wide char functions.

That requires conversion back and forth, something best done in
wrapper functions, because otherwise we will need ugly ifdef's all
over the place.

> Implementing wrappers for the msvcrt functions used elsewhere in the
> code at one point shouldn't be that hard, just a bit of boring work.

Well, I just came up from such boring work (in Emacs), and I can tell
you it's nowhere near "a bit".  Maybe someone who can work on this
full-time could do this quickly, but there's no such person on board
for MinGW GDB at this time, AFAIK.

> > Are you sure that 32K capability cannot be had with ANSI file names
> > using the \\?\ notation?
> 
> Yes.  The \\?\ notation only works in the UNICODE API[*].  The reason
> is that the ANSI API is just a thin layer over the actual UNICODE
> functionality, and the conversion from ANSI to UNICODE is done using a
> per-thread fixed-size buffer of 520 bytes.

Does this mean that using \\?\ with ANSI-encoded file names buys us
520-byte file names?

>  The ANSI API is really something which should be avoided these
> days.

Unfortunately, given the way most Unix packages are written (using
'char *' for file names), this is easier said than done.  E.g., I'm
not aware of any other GNU package except Emacs that supports Unicode
APIs, and I don't think that's an accident.


  reply	other threads:[~2013-12-18 17:03 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <52ab8d0e.8aa2420a.30ff.ffffd8f1SMTPIN_ADDED_BROKEN@mx.google.com>
2013-12-16 17:13 ` Pedro Alves
2013-12-16 22:50   ` Pierre Muller
2013-12-18 11:20   ` Corinna Vinschen
     [not found]     ` <83bo0ecgdw.fsf@gnu.org>
2013-12-18 16:07       ` Corinna Vinschen
2013-12-18 17:03         ` Eli Zaretskii [this message]
2013-12-18 17:18           ` Corinna Vinschen
2013-12-18 17:29             ` Eli Zaretskii
2013-12-18 17:31               ` Corinna Vinschen
2013-12-18 18:19                 ` Eli Zaretskii
2013-12-18 19:18                   ` Corinna Vinschen
2013-12-18 20:01                     ` Eli Zaretskii
2013-12-18 20:54                       ` Corinna Vinschen
2013-12-19 18:33                         ` Eli Zaretskii
2013-12-28  3:17                           ` Joel Brobecker
2013-12-28  9:02                             ` Eli Zaretskii
2013-12-13 22:41 Pierre Muller
2013-12-16  2:21 ` Yao Qi
2013-12-16 18:05   ` Pedro Alves
2013-12-17  0:43     ` Yao Qi
2013-12-17  8:43       ` Pierre Muller
2013-12-18  3:37 ` Yao Qi

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=834n66ccs9.fsf@gnu.org \
    --to=eliz@gnu.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