From: corinna Date: Thu, 28 Feb 2008 17:09:34 +0000 (+0000) Subject: * exceptions.cc (open_stackdumpfile): Add comments. X-Git-Tag: EOL_registry_mounts~415 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=3a9ab8f830eba21c37144031006f9841051a4306;p=pf3gnuchains%2Fpf3gnuchains4x.git * exceptions.cc (open_stackdumpfile): Add comments. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index a887b9b77e..f2bf25cd40 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,9 @@ 2008-02-28 Corinna Vinschen + * exceptions.cc (open_stackdumpfile): Add comments. + +2008-02-28 Corinna Vinschen + * exceptions.cc (open_stackdumpfile): Use NtCreateFile to create stackdump file. diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc index a903852ee9..999094d305 100644 --- a/winsup/cygwin/exceptions.cc +++ b/winsup/cygwin/exceptions.cc @@ -145,18 +145,21 @@ open_stackdumpfile () WCHAR corefile[strlen (p) + sizeof (".stackdump")]; UNICODE_STRING ucore; OBJECT_ATTRIBUTES attr; + /* Create the UNICODE variation of .stackdump. */ RtlInitEmptyUnicodeString (&ucore, corefile, sizeof corefile - sizeof (WCHAR)); ucore.Length = sys_mbstowcs (ucore.Buffer, ucore.MaximumLength / sizeof (WCHAR), p, strlen (p)) * sizeof (WCHAR); RtlAppendUnicodeToString (&ucore, L".stackdump"); + /* Create an object attribute which refers to .stackdump + in Cygwin's cwd. */ InitializeObjectAttributes (&attr, &ucore, OBJ_CASE_INSENSITIVE, cygheap->cwd.get_handle (), NULL); HANDLE h; IO_STATUS_BLOCK io; NTSTATUS status; - + /* Try to open it to dump the stack in it. */ status = NtCreateFile (&h, GENERIC_WRITE | SYNCHRONIZE, &attr, &io, NULL, FILE_ATTRIBUTE_NORMAL, 0, FILE_OVERWRITE_IF, FILE_SYNCHRONOUS_IO_NONALERT