From e7daa3ed754dfaa406099aa8be9473eda959df60 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 29 Jun 2010 10:28:40 +0000 Subject: [PATCH] * exceptions.cc (dump_exception): Use %W instead of %s for printing progname. * fork.cc (frok::parent): Fix typos in debug output. * spawn.cc (spawn_guts): Copy wide Win32 filename into _pinfo::progname, rather than native NT name. --- winsup/cygwin/ChangeLog | 8 ++++++++ winsup/cygwin/exceptions.cc | 2 +- winsup/cygwin/fork.cc | 4 ++-- winsup/cygwin/spawn.cc | 6 +++--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 1b6f1247b..4959bad69 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,11 @@ +2010-06-29 Corinna Vinschen + + * exceptions.cc (dump_exception): Use %W instead of %s for printing + progname. + * fork.cc (frok::parent): Fix typos in debug output. + * spawn.cc (spawn_guts): Copy wide Win32 filename into _pinfo::progname, + rather than native NT name. + 2010-06-28 Christopher Faylor * fork.cc (frok::parent): Improve error message. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index db60e6779..ffc2ff1cb 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -193,7 +193,7 @@ dump_exception (EXCEPTION_RECORD *e, CONTEXT *in) small_printf ("Signal %d at eip=%08x\r\n", e->ExceptionCode, in->Eip); small_printf ("eax=%08x ebx=%08x ecx=%08x edx=%08x esi=%08x edi=%08x\r\n", in->Eax, in->Ebx, in->Ecx, in->Edx, in->Esi, in->Edi); - small_printf ("ebp=%08x esp=%08x program=%s, pid %u, thread %s\r\n", + small_printf ("ebp=%08x esp=%08x program=%W, pid %u, thread %s\r\n", in->Ebp, in->Esp, myself->progname, myself->pid, cygthread::name ()); small_printf ("cs=%04x ds=%04x es=%04x fs=%04x gs=%04x ss=%04x\r\n", in->SegCs, in->SegDs, in->SegEs, in->SegFs, in->SegGs, in->SegSs); diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index 75ee87688..fe977d2b6 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -342,7 +342,7 @@ frok::parent (volatile char * volatile stack_here) si.lpReserved2 = (LPBYTE) &ch; si.cbReserved2 = sizeof (ch); - syscall_printf ("CreateProcess (%W, %W, 0, 0, 1, %p, 0, 0, %p, %p)", + syscall_printf ("CreateProcessW (%W, %W, 0, 0, 1, %p, 0, 0, %p, %p)", myself->progname, myself->progname, c_flags, &si, &pi); bool locked = __malloc_lock (); time_t start_time = time (NULL); @@ -367,7 +367,7 @@ frok::parent (volatile char * volatile stack_here) if (!rc) { this_errno = geterrno_from_win_error (); - __small_sprintf (errbuf, "CreatProcessW failed for '%W'", myself->progname); + __small_sprintf (errbuf, "CreateProcessW failed for '%W'", myself->progname); error = errbuf; memset (&pi, 0, sizeof (pi)); goto cleanup; diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 7f6738976..9d11c8c22 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -692,8 +692,8 @@ loop: myself->dwProcessId = pi.dwProcessId; strace.execing = 1; myself.hProcess = hExeced = pi.hProcess; - wcscpy (myself->progname, real_path.get_nt_native_path ()->Buffer); // FIXME: race? - sigproc_printf ("new process name %S", myself->progname); + real_path.get_wide_win32_path (myself->progname); + sigproc_printf ("new process name %W", myself->progname); /* If wr_proc_pipe doesn't exist then this process was not started by a cygwin process. So, we need to wait around until the process we've just "execed" dies. Use our own wait facility to wait for our own pid to exit (there @@ -733,7 +733,7 @@ loop: child->dwProcessId = pi.dwProcessId; child.hProcess = pi.hProcess; - wcscpy (child->progname, real_path.get_nt_native_path ()->Buffer); + real_path.get_wide_win32_path (child->progname); /* FIXME: This introduces an unreferenced, open handle into the child. The purpose is to keep the pid shared memory open so that all of the fields filled out by child.remember do not disappear and so there