X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: "Raymond Miller" Subject: Re: GDB problem (under cygwin) Date: Thu, 8 Mar 2007 19:12:29 +0100 Lines: 70 Message-ID: References: <45EF3A38 DOT 8030205 AT cygwin DOT com> <039501c761a3$58af5e80$2e08a8c0 AT CAM DOT ARTIMI DOT COM> X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Note-from-DJ: This may be spam int main () { printf("hello"); return 0; } Ok, I compiled the code.c with the cygwin gcc C:\Documents and Settings\Rafa\Desktop>gcc code.c -g -o program.exe I ran the cygwin gdb C:\Documents and Settings\Rafa\Desktop>gdb program.exe GNU gdb 6.5.50.20060706-cvs (cygwin-special) Copyright (C) 2006 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 "i686-pc-cygwin"... Then if I run the program (without any pause or breakpoint), the programs runs well (gdb) r Starting program: /cygdrive/c/Documents and Settings/Rafa/Desktop/program.exe Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll Loaded symbols for /usr/bin/cygwin1.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll hello Program exited normally. But if I put a breakpoint in the main function, I get the segmentation fault message, even I try to continue. (gdb) break main Breakpoint 1 at 0x401075: file code.c, line 4. (gdb) r Starting program: /cygdrive/c/Documents and Settings/Rafa/Desktop/program.exe Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll Loaded symbols for /usr/bin/cygwin1.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll Program received signal SIGSEGV, Segmentation fault. [Switching to thread 7364.0x1ad4] 0x005c004d in ?? () (gdb) c Continuing. Program received signal SIGSEGV, Segmentation fault. 0x00000000 in ?? () (gdb) Yes, I have NOD32 antivirus and Comodo firewall, but I also have NOD32 and Comodo firewall in the desktop pc and I don't have any problem with gcc or gdb. Yes, I have installed in this pc (laptop) the Logitech webcam software and this is not installed in the desktop pc (I don't have any webcam on that pc), but could be it the cause of the segmentation fault? -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/