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: Cc: Subject: B20.1: Thread support seems to be broken in 'gdb' Date: Thu, 21 Oct 1999 16:10:33 -0700 Message-ID: <000301bf1c19$7a2023b0$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 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Importance: Normal I could not find mention of this problem in the Cygwin FAQs or the mailing list. I can't use 'gdb' with threaded applications at all. Here's a sample program: -------------------------------------------------------------- #include #include #include void printmsg1(void *arg) { fprintf(stdout, "Msg 1\n"); } void printmsg2(void *arg) { fprintf(stdout, "Msg 2\n"); } int main(int argc, char *argv[]) { unsigned long thread1, thread2; thread1 = _beginthread(printmsg1, 0, NULL); thread2 = _beginthread(printmsg2, 0, NULL); WaitForSingleObject((HANDLE) thread1, INFINITE); WaitForSingleObject((HANDLE) thread2, INFINITE); } --------------------------------------------------------------------- I compiled using the Mingw32 support of Cygwin's gcc compiler (updated to 2.95). I have altered my gcc 'specs' file, but the basic compiler invocation would look like this: $ gcc -mno-cygwin -nostdinc -g -o xx xx.c -I/usr/mingw32/include \ -L/usr/mingw32/lib In the /usr/mingw32 hierarchy, I have installed Anders Norlander's updated Win32 API headers and libraries. Here is the 'gdb' session output: $ gdb xx GNU gdb 4.17.1 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 "i586-cygwin32"... (gdb) tb printmsg1 Breakpoint 1 at 0x4010fe: file xx.c, line 7. (gdb) tb printmsg2 Breakpoint 2 at 0x40112a: file xx.c, line 12. (gdb) run Starting program: /tmp/xx.exe [failed reading symbols from DLL] "//C/WINNT/system32/crtdll.dll": error reading line numbers [failed reading symbols from DLL] "//C/WINNT/system32/KERNEL32.dll": error reading line numbers Program received signal SIGTRAP, Trace/breakpoint trap. 0x77f6829b in ?? () ---- I always get a signal SIGTRAP message whenever I try to debug any threaded application. The rest of the 'gdb' session is completely unusable. I can run this program (outside of the debugger) with no problem. I'll point out that the version of 'gdb' provided with Mingw32's standalone package does not have this problem. --- System Information ------------------ Pentium II 400 MHz 128 MB RAM Windows NT Server 4.0 Cygwin B20.1 gcc 2.95 (core and Mingw32-extras patches applied) Anders Norlander's Win32 APIs installed 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