Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: "Jon Leichter" To: Subject: Problem with Mingw32's gdb Date: Mon, 25 Oct 1999 12:19:57 -0700 Message-ID: <000101bf1f1d$ecba2cc0$a0418218@bass.we.mediaone.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 I am having a strange problem. Whenever I use 'gdb' (the standalone Mingw32 package version), 'gdb' itself generates a SEGMENTATION fault and dies whenever it receives SIGINT (Control-C). I thought that this was working fine before, but I must have been mistaken. I'm seeing this problem whether I run the program in a DOS shell or a Cygwin BASH shell. Here's a simple sample program: ------------------------------------- #include int main(int argc, char *argv[]) { printf("Started\n"); while (1) ; } ------------------------------------- Compile the program as a Mingw32 executable. This means that you should either use 'gcc' that comes with the standalone Mingw32 package, or that you should use the -mno-cygwin switch of the 'gcc' that comes with Cygwin. If you use the standalone Mingw32 package, you can compile in a DOS shell or a Cygwin BASH shell. (I've compiled in both to find the same problem). Thus, compile like this: standalone Mingw32: gcc -g -o simple simple.c Cygwin : gcc -mno-cygwin -g -o simple simple.c Now, run the standalone version of Mingw32's 'gdb'. Do not use Cygwin's 'gdb' because the problem doesn't exist there. Here's my sample output... $ /usr/gcc-2_95-mingw32/bin/gdb GNU gdb 4.18 Copyright 1998 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-mingw32". (gdb) l l 1 #include 2 3 int main(int argc, char *argv[]) 4 { 5 printf("Started\n"); 6 while (1) 7 ; 8 } (gdb) run run Starting program: e:\tmp\xx/simple.exe 77630000:C:/WINNT/system32/crtdll.dll"C:/WINNT/system32/crtdll.dll": error readi ng line numbers 77f00000:C:/WINNT/system32/KERNEL32.dll"C:/WINNT/system32/KERNEL32.dll": error r eading line numbers Started ------------------------------------------ Now I hit CTRL-C, and I see the following: [Switching to thread 168.0xb3] Program received signal SIGINT, Interrupt. 0x77f2b5c9 in ?? () (gdb) $ ------------------------------------------- And then Windows generates a Message Box with the following title and message: Title: gdb.exe - Application Error Message: The instruction at "0x004b0341" referenced memory at "0x00000004". The memory could not be "read". -------------------------------------------- And then the application (gdb) dies. Cygwin's version of 'gdb' doesn't have this problem. And most people might tell me to go ahead and use Cygwin's version of 'gdb'. The problem with that is that Cygwin's version of 'gdb' doesn't support threads, and the standalone Mingw32's version does (and usually works). What I really need is ONE debugger that both supports signal handling AND threads. Has anyone else seen this problem? Can anyone else re-produce this problem? System Information ------------------ Windows NT Server 4.0 Mingw32 gcc 2.95 Jon Leichter jon AT symas DOT com -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com