delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/02/23/20:09:36

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: Issue with GDB under Cygwin and XP
Date: Sat, 23 Feb 2008 17:08:31 -0800
Lines: 117
Message-ID: <fpqg28$h8t$1@ger.gmane.org>
References: <for5v0$qcr$1 AT ger DOT gmane DOT org>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
In-Reply-To: <for5v0$qcr$1@ger.gmane.org>
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 compiled the latest gcc and gdb and it now works under cygwin.
The versions I'm using are:

D:\projects\Eclipse\CDT\HelloWorld2\Debug>gcc --version
gcc (GCC) 4.2.3
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

D:\projects\Eclipse\CDT\HelloWorld2\Debug>c:\cygwin\usr\local\bin\gdb 
--version
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-cygwin".

Thanks for your help.

Ray


Ray Hurst wrote:
> I'm running under Windows XP and Cygwin.
> 
> I ran GDB on a simple C program and captured the output (below).
> I have a few questions:
> 
> Why can I run the program several times with no errors but as soon as I 
> set a breakpoint at main it gets a SIGSEGV fault?
> 
> Why does the backtrace show only addresses?
> 
> 
> C:\Documents and Settings\Ray 
> Hurst\workspace\CDT\HelloWorld-ANSIC\Debug>gdb Hel
> loWorld-ANSIC.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"...
> (gdb) list
> 5        Version     :
> 6        Copyright   : Your copyright notice
> 7        Description : Hello World in C, Ansi-style
> 8 =======================================================================
> =====
> 9        */
> 10
> 11      #include <stdio.h>
> 12      #include <stdlib.h>
> 13
> 14      int main(void) {
> (gdb) list 20
> 15              puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
> 16              return EXIT_SUCCESS;
> 17      }
> (gdb) run
> Starting program: /cygdrive/c/Documents and Settings/Ray 
> Hurst/workspace/CDT/Hel
> loWorld-ANSIC/Debug/HelloWorld-ANSIC.exe
> Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/cygwin1.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/secur32.dll
> !!!Hello World!!!
> 
> Program exited normally.
> (gdb) run
> Starting program: /cygdrive/c/Documents and Settings/Ray 
> Hurst/workspace/CDT/Hel
> loWorld-ANSIC/Debug/HelloWorld-ANSIC.exe
> Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/cygwin1.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/secur32.dll
> !!!Hello World!!!
> 
> Program exited normally.
> (gdb) b main
> Breakpoint 1 at 0x401050: file ../src/HelloWorld-ANSIC.c, line 14.
> (gdb) run
> Starting program: /cygdrive/c/Documents and Settings/Ray 
> Hurst/workspace/CDT/Hel
> loWorld-ANSIC/Debug/HelloWorld-ANSIC.exe
> Loaded symbols for /cygdrive/c/WINDOWS/system32/ntdll.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/kernel32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/cygwin1.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/advapi32.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/rpcrt4.dll
> Loaded symbols for /cygdrive/c/WINDOWS/system32/secur32.dll
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to thread 4896.0x1314]
> 0x000007f4 in ?? ()
> (gdb) bt
> #0  0x000007f4 in ?? ()
> #1  0x00000000 in ?? ()
> (gdb)
> 
> Ray
> 
> 
> 
> 


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