This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GDB problem (under cygwin)


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]