Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFA] Re: [RFC-v2] Reenable compilation with cygwin 1.5 versions
Date: Mon, 08 Mar 2010 16:02:00 -0000	[thread overview]
Message-ID: <000601cabed8$be2c0610$3a841230$@muller@ics-cnrs.unistra.fr> (raw)
In-Reply-To: <20100306192722.GA13824@ednor.casa.cgf.cx>

  Thanks Christopher,

your patch is almost enough to 
get GDB to compile again for 1.5 version Cygwins.

  There are three little problems left:
canonicalize_file_name function seems new to the new Cygwin API
as well as CW_SET_DOS_FILE_WARNING macro.
  After fixing these two, I also got one warning about
cygallargs local that could be used un-initialized.

  The patch below fixes those three errors.

  Ideally, the cygwin_internal macro used
should rather be of the form
#ifdef __NEW_CYGWIN_API
but Christopher did not seem to like such a macro...

Are these patches OK?

Pierre
(Of course the remote-fileio.c patch also
still needs to be accepted.)


2010-03-08  Pierre Muller  <muller@ics.u-strasbg.fr>

	* windows-nat.c (canonicalize_file_name): New macro
	for old cygwin API support.
	(windows_create_inferior): Add missing cygallargs setting.
	(_initialize_windows_nat): Only call cygwin_internal
	CW_SET_DOS_FILE_WARNING for new Cygwin API.

Index: windows-nat.c
===================================================================
RCS file: /cvs/src/src/gdb/windows-nat.c,v
retrieving revision 1.205
diff -u -p -r1.205 windows-nat.c
--- windows-nat.c	6 Mar 2010 19:27:09 -0000	1.205
+++ windows-nat.c	8 Mar 2010 15:41:26 -0000
@@ -115,6 +115,7 @@ static struct target_ops windows_ops;
 #   define GetModuleFileNameEx_name "GetModuleFileNameExW"
 #   define bad_GetModuleFileNameEx bad_GetModuleFileNameExW
 # else
+#   define canonicalize_file_name(name)  alloca(PATH_MAX);
cygwin_conv_to_full_posix_path (name, rname)
 #   define cygwin_conv_path(op, from, to, size)
cygwin_conv_to_full_posix_path (from, to)
     typedef char cygwin_buf_t;
     static DWORD WINAPI (*GetModuleFileNameEx) (HANDLE, HMODULE, LPSTR,
DWORD);
@@ -1945,6 +1946,10 @@ windows_create_inferior (struct target_o
 	error (_("Error starting executable: %d"), errno);
       cygallargs = (wchar_t *) alloca (len * sizeof (wchar_t));
       mbstowcs (cygallargs, allargs, len);
+#else
+      len = strlen (allargs) + 1;
+      cygallargs = (char *) alloca (len);
+      strcpy (cygallargs, allargs);
 #endif
     }
   else
@@ -2335,8 +2340,10 @@ _initialize_windows_nat (void)
   init_windows_ops ();
 
 #ifdef __CYGWIN__
+#ifdef __USEWIDE
   cygwin_internal (CW_SET_DOS_FILE_WARNING, 0);
 #endif
+#endif
 
   c = add_com ("dll-symbols", class_files, dll_symbol_command,
 	       _("Load dll library symbols from FILE."));


  reply	other threads:[~2010-03-08 16:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-03 16:54 [RFC] " Pierre Muller
2010-03-03 17:14 ` Corinna Vinschen
2010-03-03 20:30 ` Christopher Faylor
2010-03-04 15:32   ` [RFC-v2] " Pierre Muller
2010-03-04 16:38     ` Christopher Faylor
2010-03-06 19:27       ` Christopher Faylor
2010-03-08 16:02         ` Pierre Muller [this message]
2010-03-08 22:11           ` [RFA] " Christopher Faylor
2010-03-08 23:15             ` Pierre Muller
2010-03-09 19:12               ` 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='000601cabed8$be2c0610$3a841230$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --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