aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorPierre Muller <muller@ics.u-strasbg.fr>2013-12-16 23:44:43 +0100
committerPierre Muller <muller@ics.u-strasbg.fr>2013-12-16 23:44:43 +0100
commit774f74c2206a1f9acc7dba836290076fa8779077 (patch)
tree81e8fbda7f43d3b34879a0d49aaa3e2d675cb488 /gdb
parentafc0578da2868f99075be48f4291bf13cf3c9b10 (diff)
downloadgdb-774f74c2206a1f9acc7dba836290076fa8779077.zip
gdb-774f74c2206a1f9acc7dba836290076fa8779077.tar.gz
gdb-774f74c2206a1f9acc7dba836290076fa8779077.tar.bz2
Fix compilation error for cygwin native build.
* windows-nat.c (windows_ensure_ntdll_loaded) [__USEWIDE]: Call wcstombs.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/windows-nat.c16
2 files changed, 19 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cd954e0..70edc08 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2013-12-16 Pierre Muller <muller@sourceware.org>
+
+ Fix compilation error for cygwin native build.
+ * windows-nat.c (windows_ensure_ntdll_loaded) [__USEWIDE]:
+ Call wcstombs.
+
2013-12-16 Pedro Alves <palves@redhat.com>
PR 16329
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;
}