From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23632 invoked by alias); 15 Feb 2008 23:22:47 -0000 Received: (qmail 23623 invoked by uid 22791); 15 Feb 2008 23:22:46 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 15 Feb 2008 23:22:26 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JQ9sl-0006HI-SR for cygwin@cygwin.com; Fri, 15 Feb 2008 23:22:16 +0000 Received: from 129.253.1.86 ([129.253.1.86]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Feb 2008 23:22:15 +0000 Received: from rhurst2 by 129.253.1.86 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 15 Feb 2008 23:22:15 +0000 To: cygwin@cygwin.com From: Ray Hurst Subject: Re: Issue with GDB under Cygwin and XP Date: Sat, 16 Feb 2008 04:45:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) In-Reply-To: X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2008-02/txt/msg00389.txt.bz2 Here is a run of a HellowWorld program (listed below in gdb). Can someone tell me why the variables a, b, c are not the correct values. I dumped the local stack and the variables are correct on the stack. I'm running Windows XP under cygwin. gcc 4.2.3 The gdb run is as follows: 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 ,20 11 #include 12 #include 13 14 int main(void) { 15 int a,b,c; 16 a = 10; 17 b = 20; 18 c = 30; 19 puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ 20 printf("\na = %d, b = %d, c = %d\n", a,b,c); (gdb) b main Breakpoint 1 at 0x401050: file ../src/HelloWorld.c, line 14. (gdb) run Starting program: /cygdrive/c/projects/Eclipse/WorkSpaces/cdt/HelloWorld/Debug/H elloWorld.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 Breakpoint 1, main () at ../src/HelloWorld.c:14 14 int main(void) { (gdb) n 16 a = 10; (gdb) n 17 b = 20; (gdb) n 18 c = 30; (gdb) n 19 puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */ (gdb) print a $1 = 1627408910 (gdb) print b $2 = 1627408208 (gdb) print c $3 = 264 (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/