From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21324 invoked by alias); 13 Dec 2013 22:41:15 -0000 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 Received: (qmail 21306 invoked by uid 89); 13 Dec 2013 22:41:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,MSGID_MULTIPLE_AT autolearn=no version=3.3.2 X-HELO: mailhost.u-strasbg.fr Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.222.216) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Dec 2013 22:41:14 +0000 Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id 5BAA1140CCF for ; Fri, 13 Dec 2013 23:40:18 +0100 (CET) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id F4169140D62 for ; Fri, 13 Dec 2013 23:39:23 +0100 (CET) Received: from md16.u-strasbg.fr (md16.u-strasbg.fr [130.79.200.206]) by mr6.u-strasbg.fr (Postfix) with ESMTP id DED4B140D7E for ; Fri, 13 Dec 2013 23:37:48 +0100 (CET) Received: from ms13.u-strasbg.fr (ms13.u-strasbg.fr [130.79.204.113]) by md16.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id rBDMbmBZ008104 for ; Fri, 13 Dec 2013 23:37:48 +0100 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (Authenticated sender: mullerp) by ms13.u-strasbg.fr (Postfix) with ESMTPSA id 533D51FD84 for ; Fri, 13 Dec 2013 23:37:49 +0100 (CET) From: "Pierre Muller" To: Subject: [RFA] Fix cygwin compilation failure due to nameless LOAD_DLL_DEBUG_EVENT causes ntdll.dll to be missing Date: Fri, 13 Dec 2013 22:41:00 -0000 Message-ID: <002f01cef853$f44500e0$dccf02a0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-SW-Source: 2013-12/txt/msg00550.txt.bz2 Following this thread https://sourceware.org/ml/gdb-patches/2013-12/msg00073.html The patch https://sourceware.org/ml/gdb-cvs/2013-12/msg00054.html introduced a failure for cygwin native build. The problem is that __USEWIDE is not considered in the patch. The patch below fixes this compilation error and should allow cygwin to work as mingw. Pierre Muller ChangeLog entry: 2013-12-13 Pierre Muller Fix compilation error for cygwin native build. * windows-nat.c (windows_ensure_ntdll_loaded): Add code using wchar_t type and conversion to char string if __USEWIDE is defined. diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c index f0545fc..dda9d8e 100644 --- a/gdb/windows-nat.c +++ b/gdb/windows-nat.c @@ -1764,17 +1764,27 @@ windows_ensure_ntdll_loaded (void) for (i = 0; i < (int) (cb_needed / sizeof (HMODULE)); i++) { MODULEINFO mi; +#ifdef __USEWIDE + wchar_t dll_name[__PMAX]; + char name[__PMAX]; +#else char dll_name[__PMAX]; - + char *name; +#endif if (GetModuleInformation (current_process_handle, hmodules[i], &mi, sizeof (mi)) == 0) continue; if (GetModuleFileNameEx (current_process_handle, hmodules[i], dll_name, sizeof (dll_name)) == 0) continue; - if (FILENAME_CMP (lbasename (dll_name), "ntdll.dll") == 0) +#ifdef __USEWIDE + wcstombs (name, dll_name, __PMAX); +#else + name = dll_name; +#endif + if (FILENAME_CMP (lbasename (name), "ntdll.dll") == 0) { - solib_end->next = windows_make_so (dll_name, mi.lpBaseOfDll); + solib_end->next = windows_make_so (name, mi.lpBaseOfDll); solib_end = solib_end->next; return; }