Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] FW: [RFA] windows-nat.c: Cygwin: Port to Cygwin 1.7

Since we're talking about Cygwin and GDB recently,
here's a mail from the GDB mailing list about trying to get
the latest GDB HEAD to run on Cygwin 1.7.

-----Original Message-----
From: gdb-patches-owner@xxxxxxxxxxxxxx [mailto:gdb-patches-owner@xxxxxxxxxxxxxx] On Behalf Of Corinna Vinschen
Sent: February-28-10 10:09 AM
To: gdb-patches@xxxxxxxxxxxxxx
Subject: [RFA] windows-nat.c: Cygwin: Port to Cygwin 1.7

Hi,

the below patch ports GDB to the latest Cygwin version 1.7.

Three problems have to be fixed:

- The maximum path length in Cygwin is no longer MAX_PATH.  Rather it
  is PATH_MAX, which is now 4096.  Actually, even paths up to 32K are
  supported, which is the maximum path length of the underlying Windows,
  but usually 4K is more than enough.

- The aforementioned change required to provide a new Win32<->POSIX
  path conversion API which allows to handle paths longer than MAX_PATH.
  The old cygwin_conv_to_[full_]win32_path and cygwin_conf_to_[full_]posix
  path functions are deprecated now.  The below patch uses the new
  cygwin_conv_path API instead.

- The Windows ANSI functions have two drawbacks.

  - They return paths always in the default ANSI codepage, which is
    typically not the default codeset used in Cygwin 1.7 anymore.  UTF-8
    is now the default codeset in Cygwin.

  - They are restricted to a path length of MAX_PATH bytes.

  Since UTF-8 support and support for long paths are key changes in
  Cygwin 1.7, Cygwin now uses only Unicode Windows or native NT
  functions internally.  To overcome the restrictions of the Win32 ANSI
  functions in GDB as well, the patch changes the affected calls to use
  the Unicode variation instead, too.

The code for other Win32 targets is unaffected by this patch, except for a patch in get_image_name.  The WideCharToMultiByte function is called with an incorrect target buffer size.

Ok to apply?


Back to the top