delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/03/03/00:43:02

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Ray Hurst <rhurst2 AT cox DOT net>
Subject: Re: gcc + gdb + breakpoint => SIGSEGV
Date: Sun, 02 Mar 2008 21:41:42 -0800
Lines: 120
Message-ID: <fqg32i$r7$1@ger.gmane.org>
References: <BLU117-W5969A5253D023D9B0D18A89160 AT phx DOT gbl>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.12 (Windows/20080213)
In-Reply-To: <BLU117-W5969A5253D023D9B0D18A89160@phx.gbl>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT 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

I had the same issue a couple of weeks ago.
I never figured it out.

I ended up updating the compiler to v4.2.3 then I updated gdb to v6.7.1.
Everything started working.

You might try just updating gdb and see what happens.

The issue was only with cygwin. The same versions you have below ran 
under linux just find.
Ray


Dave Ohlsson wrote:
> Hi,
> 
> I have a problem when trying to use gdb with a program compiled with gcc in Cygwin.
> 
> I compile this program:
> 
>     
>     int main(int argc, char** argv)
>     {
>         return 0;
>     }
>     
> 
> with this command:
> 
>     gcc -g main.c
> 
> and I get this file:
> 
>     9757 Mar  1 21:27 a.exe
> 
> I then start gdb:
> 
>     gdb a.exe
> 
> and running the program in gdb works:
> 
>     (gdb) run
>     Starting program: /c/TEMP/a.exe
>     Loaded symbols for /c/WINNT/system32/ntdll.dll
>     Loaded symbols for /c/WINNT/system32/kernel32.dll
>     Loaded symbols for /usr/bin/cygwin1.dll
>     Loaded symbols for /c/WINNT/system32/advapi32.dll
>     Loaded symbols for /c/WINNT/system32/rpcrt4.dll
>     Loaded symbols for /c/WINNT/system32/secur32.dll
> 
>     Program exited normally.
> 
> but doing the same with a breakpoint yields SIGSEGV:
> 
>     gdb a.exe
>     (gdb) list
>     1       int main(int argc, char** argv)
>     2       {
>     3           return 0;
>     4       }
>     (gdb) break 3
>     Breakpoint 1 at 0x40107a: file main.c, line 3.
>     (gdb) run
>     Starting program: /c/TEMP/a.exe
>     Loaded symbols for /c/WINNT/system32/ntdll.dll
>     Loaded symbols for /c/WINNT/system32/kernel32.dll
>     Loaded symbols for /usr/bin/cygwin1.dll
>     Loaded symbols for /c/WINNT/system32/advapi32.dll
>     Loaded symbols for /c/WINNT/system32/rpcrt4.dll
>     Loaded symbols for /c/WINNT/system32/secur32.dll
> 
>     Program received signal SIGSEGV, Segmentation fault.
>     [Switching to thread 44692.0xaea4]
>     0x005c004d in ?? ()
>     (gdb)
> 
> What could be wrong?
> 
> I have completely uninstalled, then reinstalled Cygwin, without help.
> 
> -- dave
> 
> The versions I use
> ------------------
> `gcc -v' yields:
> 
> 
> Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
> Configured with: /usr/build/package/orig/test.respin/gcc-3.4.4-3/
> configure --verbose --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
> --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --
> infodir=/usr/share/info --enable-languages=c,ada,c+
> +,d,f77,pascal,java,objc --enable-nls --without-included-gettext --
> enable-version-specific-runtime-libs --without-x --enable-libgcj --
> disable-java-awt --with-system-zlib --enable-interpreter --disable-
> libgcj-debug --enable-threads=posix --enable-java-gc=boehm --disable-
> win32-registry --enable-sjlj-exceptions --enable-hash-synchronization
> --enable-libstdcxx-debug
> Thread model: posix
> gcc version 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)
> 
> 
> When starting gdb, I get:
> 
> 
> 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".
> 
> _________________________________________________________________
> Connect and share in new ways with Windows Live.
> http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
> 


--
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