delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/03/08/13:13:24

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: "Raymond Miller" <Neacen AT gmail DOT com>
Subject: Re: GDB problem (under cygwin)
Date: Thu, 8 Mar 2007 19:12:29 +0100
Lines: 70
Message-ID: <espjmf$me5$1@sea.gmane.org>
References: <ee84e5f30703061114q58aa0675jd4d4a69c759442a5 AT mail DOT gmail DOT com> <Pine DOT GSO DOT 4 DOT 63 DOT 0703061451230 DOT 6189 AT access1 DOT cims DOT nyu DOT edu> <esnbau$5m8$1 AT sea DOT gmane DOT org> <45EF3A38 DOT 8030205 AT cygwin DOT com> <esp7en$qqu$1 AT sea DOT gmane DOT org> <039501c761a3$58af5e80$2e08a8c0 AT CAM DOT ARTIMI DOT COM> <esphd3$6b7$1 AT sea DOT gmane DOT org>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019