[RFC 0/9] Unify windows specifics into common/windows-hdep files

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Wed Mar 30 12:15:00 GMT 2011


   This series of patches tries to unify all windows conversion routines
and ASCII/WIDE versions of Windows API routines into two new files:

common/windows-hdep.h
and
common.windows-hdep.c

Main points are:

  Try to be able to avoid as much as possible
#ifdef __CYGWIN__
and
#ifdef __USEWIDE
in gdb sources and especially in gdb/windows-nat.c

  The new files should allow to choose between ASCII or WIDE
versions of Windows API based on
  USE_WIDE_WINAPI macro declaration.

  This macro is defined by default for newer Cygwin 1.7.X versions
only, all other hosts use ASCII by default.

  This includes:
  1) older Cygwin 1.5.X which does not support wide version of path
conversion
 routine, and for which trying to set USE_WIDE_WINAPI will generate a
compile
 time error.
  2) mingw32 and mingw64 hosts, which should with this patch
 be compilable both with ASCII (default) and WIDE (by adding
-DUSE_WIDE_WINAPI
 to CFLAGS).
 
  The patch declare two path conversion routines:
  windows_conv_path and windows_conv_path_list are 
  just adapted from 
  cygwin_conv_path and cygwin_conv_path_list.
  
  I renamed cygwin_buf_t to win_buf_t as it is now using
also for non-cygwin code.

  The first field of the two new functions is of type enum conv_type
and can have five values:
  WINDOWS_NATIVE_A_TO_POSIX = 1
 ,WINDOWS_POSIX_TO_NATIVE_A = 2
#ifdef USE_WIDE_WINAPI
  ,WINDOWS_NATIVE_W_TO_POSIX = 3
  ,WINDOWS_POSIX_TO_NATIVE_W = 4
#endif
  ,WINDOWS_NATIVE_TO_MSYS = 5

  The last one is an addition that will be useful for a latter patch to 
support MSYS shell.
  Two macros WINDOWS_NATIVE_TO_POSIX and WINDOWS_POSIX_TO_NATIVE
allow to use A or W depending on USE_WIDE_WINAPI.

  Comments on this series most welcome,
  

Pierre Muller
GDB pascal language maintainer

<<<<<<<<<<<<<<<<<<<<<<List of individual patches:>>>>>>>
  [RFC 1/9] New common/windows-hdep files
  [RFC 2/9] Rule for windows-tdep.o in Makefile.in
  [RFC 3/9] Rule for windows-tdep.o in gdbserver Makefile.in
  [RFC 4/9] Add windows-tdep.o in gdbserver configure.srv
  [RFC 5/9] Add windows-tdep.o in configure.host
  [RFC 6/9] Use new windows-tdep code in gdbserver/win32-low.c
  [RFC 7/9] Use new windows-tdep code in nto-tdep.c
  [RFC 8/9] Use new windows-tdep code in remote-fileio.c
  [RFC 9/9] Use new windows-tdep code in windows-nat.c

 gdb/Makefile.in             |    4 +
 gdb/common/windows-hdep.c   |  231 ++++++++++++++++++++++++++++++++++++++++
 gdb/common/windows-hdep.h   |  173 ++++++++++++++++++++++++++++++
 gdb/configure.host          |    8 +-
 gdb/gdbserver/Makefile.in   |    7 ++
 gdb/gdbserver/configure.srv |   10 +-
 gdb/gdbserver/win32-low.c   |   17 ++--
 gdb/nto-tdep.c              |    6 +-
 gdb/remote-fileio.c         |   21 ++---
 gdb/windows-nat.c           |  246
+++++++++++++++----------------------------
 10 files changed, 528 insertions(+), 195 deletions(-)
 create mode 100644 gdb/common/windows-hdep.c
 create mode 100644 gdb/common/windows-hdep.h  






More information about the Gdb-patches mailing list