From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29995 invoked by alias); 8 Mar 2010 16:02:26 -0000 Received: (qmail 29695 invoked by uid 22791); 8 Mar 2010 16:02:23 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_20,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.158) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 08 Mar 2010 16:02:18 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id o28G2FcR068728 for ; Mon, 8 Mar 2010 17:02:15 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402:d::10]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o28G2Ehd022605 for ; Mon, 8 Mar 2010 17:02:15 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o28G2E6F012902 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Mon, 8 Mar 2010 17:02:14 +0100 (CET) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: References: <002701cabaf2$39739ad0$ac5ad070$@muller@ics-cnrs.unistra.fr> <20100303203012.GA31597@ednor.casa.cgf.cx> <001901cabbaf$ebe7fa40$c3b7eec0$@muller@ics-cnrs.unistra.fr> <20100304163838.GC12505@ednor.casa.cgf.cx> <20100306192722.GA13824@ednor.casa.cgf.cx> In-Reply-To: <20100306192722.GA13824@ednor.casa.cgf.cx> Subject: [RFA] Re: [RFC-v2] Reenable compilation with cygwin 1.5 versions Date: Mon, 08 Mar 2010 16:02:00 -0000 Message-ID: <000601cabed8$be2c0610$3a841230$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00309.txt.bz2 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 * 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."));