From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 99B0E38582A3 for ; Tue, 7 Jun 2022 19:30:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 99B0E38582A3 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nyeuR-0005HR-4W for gdb@sourceware.org; Tue, 07 Jun 2022 15:30:35 -0400 Received: from ip5f5a89c6.dynamic.kabel-deutschland.de ([95.90.137.198]:57919 helo=[192.168.111.41]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nyeu3-0005eF-6m for gdb@sourceware.org; Tue, 07 Jun 2022 15:30:34 -0400 Message-ID: Date: Tue, 7 Jun 2022 21:30:07 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Content-Language: en-US To: Simon Sobisch via Gdb From: Simon Sobisch Subject: Is corefile support for missing on Win32? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jun 2022 19:30:36 -0000 Testing with MSYS2 generated mingw64 gcc 12.1 + gdb 12.1 resulted in "everything working" ...until I needed to create a core file. (gdb) show arch The target architecture is set to "auto" (currently "i386:x86-64"). (gdb) gcore test.core warning: cannot close "test.core": invalid operation Can't create a corefile (with gnutarget auto, pei-x86-64 and pe-x86-64) I see that the first error message comes from gdb/gdb_bfd.c (gdb_bfd_close_warning) and the second from the default implementation gdb/exec.c (make_corefile_notes) This issue seems to exists for longer as some SO question [1] asked about this over 5 years ago. Further testing showed the same issue with same tools in MinGW x86 and with "good old MinGW" using GDB 7.6.1 / GCC 9.2. Testing with cygwin-x64 (GDB 11.2) shows the same result. Questions: * Is there something missing in the configuration / build to get it working? * Should I file a bug on https://sourceware.org/bugzilla/buglist.cgi?component=corefiles ? Thanks to share some info, Simon Background: I want to move from an "unsafe signal handler" doing a text-dump of variables in GnuCOBOL to "create a coredump, let the user inspect this"; but if this doesn't work on Win32 I may need some different approach there. I guess the system's minidump format cannot be processed with GDB, can it? Do you see other options to do post-mortem debugging on Win32? Simon [1]:https://stackoverflow.com/questions/41468614/warning-cannot-close-core-xxxxx-invalid-operation