public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Issue with GDB under Cygwin and XP
@ 2008-02-12  9:02 Ray Hurst
  2008-02-13  6:16 ` Jim Marshall
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Ray Hurst @ 2008-02-12  9:02 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-12  9:02 Issue with GDB under Cygwin and XP Ray Hurst
@ 2008-02-13  6:16 ` Jim Marshall
  2008-02-13 19:41   ` Ray Hurst
  2008-02-16  4:45 ` Ray Hurst
  2008-02-24  5:07 ` Ray Hurst
  2 siblings, 1 reply; 14+ messages in thread
From: Jim Marshall @ 2008-02-13  6:16 UTC (permalink / raw)
  To: cygwin

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
> 
> 
Works fine on my Windows XP Pro machine using the same GDB and gcc 
version 3.4.4. What gcc version do you have?

The stack trace would indicate that the crash is occurring before it 
gets to your main function, since that code doesn't have debug symbols 
you get addresses.


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-13  6:16 ` Jim Marshall
@ 2008-02-13 19:41   ` Ray Hurst
  2008-02-13 19:59     ` Marco Atzeri
  0 siblings, 1 reply; 14+ messages in thread
From: Ray Hurst @ 2008-02-13 19:41 UTC (permalink / raw)
  To: cygwin

Jim Marshall wrote:
> 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
>>
>>
> Works fine on my Windows XP Pro machine using the same GDB and gcc 
> version 3.4.4. What gcc version do you have?
> 
> The stack trace would indicate that the crash is occurring before it 
> gets to your main function, since that code doesn't have debug symbols 
> you get addresses.
> 
> 

Jim,
It's definitely crashing before getting to main and I don't know why.
The tools versions are: gcc 4.2.3, binutils 2.17.50, and gdb 6.5.50.

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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-13 19:41   ` Ray Hurst
@ 2008-02-13 19:59     ` Marco Atzeri
  2008-02-13 20:28       ` Ray Hurst
  0 siblings, 1 reply; 14+ messages in thread
From: Marco Atzeri @ 2008-02-13 19:59 UTC (permalink / raw)
  To: cygwin


--- Ray Hurst <rhurst2@cox.net> ha scritto:

> > Works fine on my Windows XP Pro machine using the
> same GDB and gcc 
> > version 3.4.4. What gcc version do you have?
> > 
> > The stack trace would indicate that the crash is
> occurring before it 
> > gets to your main function, since that code
> doesn't have debug symbols 
> > you get addresses.
> > 
> > 
> 
> Jim,
> It's definitely crashing before getting to main and
> I don't know why.
> The tools versions are: gcc 4.2.3, binutils 2.17.50,
> and gdb 6.5.50.
> 
> Ray

Hi Ray
I will bet on Gcc 4.2.3.

there are some reasons why on cygwin gcc 3.4.4
is still the default version.

Regards
Marco




      ___________________________________ 
L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-13 19:59     ` Marco Atzeri
@ 2008-02-13 20:28       ` Ray Hurst
  2008-02-14  8:16         ` Jim Marshall
  0 siblings, 1 reply; 14+ messages in thread
From: Ray Hurst @ 2008-02-13 20:28 UTC (permalink / raw)
  To: cygwin

Marco Atzeri wrote:
> --- Ray Hurst <rhurst2@cox.net> ha scritto:
> 
>>> Works fine on my Windows XP Pro machine using the
>> same GDB and gcc 
>>> version 3.4.4. What gcc version do you have?
>>>
>>> The stack trace would indicate that the crash is
>> occurring before it 
>>> gets to your main function, since that code
>> doesn't have debug symbols 
>>> you get addresses.
>>>
>>>
>> Jim,
>> It's definitely crashing before getting to main and
>> I don't know why.
>> The tools versions are: gcc 4.2.3, binutils 2.17.50,
>> and gdb 6.5.50.
>>
>> Ray
> 
> Hi Ray
> I will bet on Gcc 4.2.3.
> 
> there are some reasons why on cygwin gcc 3.4.4
> is still the default version.
> 
> Regards
> Marco
> 
> 
> 
> 
>       ___________________________________ 
> L'email della prossima generazione? Puoi averla con la nuova Yahoo! Mail: http://it.docs.yahoo.com/nowyoucan.html
> 
Actually I was incorrect. The dump I gave you was for gcc 3.4.4.

I got it to run under gcc 4.2.3 using Insight.

I modified the program as follows:
/*
 
============================================================================
  Name        : HelloWorld.c
  Author      : Ray Hurst
  Version     :
  Copyright   : Your copyright notice
  Description : Hello World in C, Ansi-style
 
============================================================================
  */

#include <stdio.h>
#include <stdlib.h>

int main(void) {
	int a,b,c;
	a = 10;
	b = 20;
	c = 30;
	puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
	printf("\na = %d,  b = %d,  c = %d\n", a,b,c);
	return EXIT_SUCCESS;
}

When I step through the program I cannot get the Local Variables window 
to update the variables when I step over the lines setting the variable.

I look at the stack area in memory they definitely are updating.
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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-13 20:28       ` Ray Hurst
@ 2008-02-14  8:16         ` Jim Marshall
  2008-02-14  9:29           ` Jim Marshall
  0 siblings, 1 reply; 14+ messages in thread
From: Jim Marshall @ 2008-02-14  8:16 UTC (permalink / raw)
  To: cygwin

Ray Hurst wrote:
> Marco Atzeri wrote:
>> --- Ray Hurst <rhurst2@cox.net> ha scritto:
>>
>>>> Works fine on my Windows XP Pro machine using the
>>> same GDB and gcc
>>>> version 3.4.4. What gcc version do you have?
>>>>
>>>> The stack trace would indicate that the crash is
>>> occurring before it
>>>> gets to your main function, since that code
>>> doesn't have debug symbols
>>>> you get addresses.
>>>>
>>>>
>>> Jim,
>>> It's definitely crashing before getting to main and
>>> I don't know why.
>>> The tools versions are: gcc 4.2.3, binutils 2.17.50,
>>> and gdb 6.5.50.
>>>
>>> Ray
>>
>> Hi Ray
>> I will bet on Gcc 4.2.3.
>>
>> there are some reasons why on cygwin gcc 3.4.4
>> is still the default version.
>>
>> Regards
>> Marco
>>
>>
>>
>>
>>       ___________________________________ L'email della prossima 
>> generazione? Puoi averla con la nuova Yahoo! Mail: 
>> http://it.docs.yahoo.com/nowyoucan.html
>>
> Actually I was incorrect. The dump I gave you was for gcc 3.4.4.
> 
> I got it to run under gcc 4.2.3 using Insight.
> 
> I modified the program as follows:
> /*
> 
> ============================================================================ 
> 
>  Name        : HelloWorld.c
>  Author      : Ray Hurst
>  Version     :
>  Copyright   : Your copyright notice
>  Description : Hello World in C, Ansi-style
> 
> ============================================================================ 
> 
>  */
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main(void) {
>     int a,b,c;
>     a = 10;
>     b = 20;
>     c = 30;
>     puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
>     printf("\na = %d,  b = %d,  c = %d\n", a,b,c);
>     return EXIT_SUCCESS;
> }
> 
> When I step through the program I cannot get the Local Variables window 
> to update the variables when I step over the lines setting the variable.
> 
> I look at the stack area in memory they definitely are updating.
> Ray
> 
> 
> 
Local variables window? Is that in insight? I've not used insight so 
can't really help you there.


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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-14  8:16         ` Jim Marshall
@ 2008-02-14  9:29           ` Jim Marshall
  0 siblings, 0 replies; 14+ messages in thread
From: Jim Marshall @ 2008-02-14  9:29 UTC (permalink / raw)
  To: cygwin

Ray Hurst wrote:
> Marco Atzeri wrote:
>> --- Ray Hurst <rhurst2@cox.net> ha scritto:
>>
>>>> Works fine on my Windows XP Pro machine using the
>>> same GDB and gcc
>>>> version 3.4.4. What gcc version do you have?
>>>>
>>>> The stack trace would indicate that the crash is
>>> occurring before it
>>>> gets to your main function, since that code
>>> doesn't have debug symbols
>>>> you get addresses.
>>>>
>>>>
>>> Jim,
>>> It's definitely crashing before getting to main and
>>> I don't know why.
>>> The tools versions are: gcc 4.2.3, binutils 2.17.50,
>>> and gdb 6.5.50.
>>>
>>> Ray
>>
>> Hi Ray
>> I will bet on Gcc 4.2.3.
>>
>> there are some reasons why on cygwin gcc 3.4.4
>> is still the default version.
>>
>> Regards
>> Marco
>>
>>
>>
>>
>>       ___________________________________ L'email della prossima 
>> generazione? Puoi averla con la nuova Yahoo! Mail: 
>> http://it.docs.yahoo.com/nowyoucan.html
>>
> Actually I was incorrect. The dump I gave you was for gcc 3.4.4.
> 
> I got it to run under gcc 4.2.3 using Insight.
> 
> I modified the program as follows:
> /*
> 
> ============================================================================ 
> 
>  Name        : HelloWorld.c
>  Author      : Ray Hurst
>  Version     :
>  Copyright   : Your copyright notice
>  Description : Hello World in C, Ansi-style
> 
> ============================================================================ 
> 
>  */
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main(void) {
>     int a,b,c;
>     a = 10;
>     b = 20;
>     c = 30;
>     puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
>     printf("\na = %d,  b = %d,  c = %d\n", a,b,c);
>     return EXIT_SUCCESS;
> }
> 
> When I step through the program I cannot get the Local Variables window 
> to update the variables when I step over the lines setting the variable.
> 
> I look at the stack area in memory they definitely are updating.
> Ray
> 
> 
> 
Local variables window? Is that in insight? I've not used insight so 
can't really help you there.

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-12  9:02 Issue with GDB under Cygwin and XP Ray Hurst
  2008-02-13  6:16 ` Jim Marshall
@ 2008-02-16  4:45 ` Ray Hurst
  2008-02-17  5:52   ` Pedro Alves
  2008-02-24  5:07 ` Ray Hurst
  2 siblings, 1 reply; 14+ messages in thread
From: Ray Hurst @ 2008-02-16  4:45 UTC (permalink / raw)
  To: cygwin

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 <stdio.h>
12      #include <stdlib.h>
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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-16  4:45 ` Ray Hurst
@ 2008-02-17  5:52   ` Pedro Alves
  2008-02-17 13:30     ` Christopher Faylor
  2008-02-18 10:52     ` Ray Hurst
  0 siblings, 2 replies; 14+ messages in thread
From: Pedro Alves @ 2008-02-17  5:52 UTC (permalink / raw)
  To: cygwin

A Friday 15 February 2008 23:21:45, Ray Hurst wrote:
> 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
>

http://sourceware.org/ml/gdb-patches/2007-11/msg00567.html

-- 
Pedro Alves

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-17  5:52   ` Pedro Alves
@ 2008-02-17 13:30     ` Christopher Faylor
  2008-02-18 20:44       ` Pedro Alves
  2008-02-18 10:52     ` Ray Hurst
  1 sibling, 1 reply; 14+ messages in thread
From: Christopher Faylor @ 2008-02-17 13:30 UTC (permalink / raw)
  To: cygwin

On Sun, Feb 17, 2008 at 03:19:02AM +0000, Pedro Alves wrote:
>A Friday 15 February 2008 23:21:45, Ray Hurst wrote:
>>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
>
>http://sourceware.org/ml/gdb-patches/2007-11/msg00567.html

Was that patch applied?  AFAICT from the ChangeLog's it wasn't.

If not, have you pinged anyone about this Pedro?

cgf

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-17  5:52   ` Pedro Alves
  2008-02-17 13:30     ` Christopher Faylor
@ 2008-02-18 10:52     ` Ray Hurst
  2008-02-18 21:45       ` Pedro Alves
  1 sibling, 1 reply; 14+ messages in thread
From: Ray Hurst @ 2008-02-18 10:52 UTC (permalink / raw)
  To: cygwin

Pedro Alves wrote:
> A Friday 15 February 2008 23:21:45, Ray Hurst wrote:
>> 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
>>
> 
> http://sourceware.org/ml/gdb-patches/2007-11/msg00567.html
> 

Pedro,
Di I need to actually take the source changes from this thread and apply 
them to my build?
Or is there a patch file available?
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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-17 13:30     ` Christopher Faylor
@ 2008-02-18 20:44       ` Pedro Alves
  0 siblings, 0 replies; 14+ messages in thread
From: Pedro Alves @ 2008-02-18 20:44 UTC (permalink / raw)
  To: cygwin

A Sunday 17 February 2008 03:37:38, Christopher Faylor wrote:
> On Sun, Feb 17, 2008 at 03:19:02AM +0000, Pedro Alves wrote:
> >http://sourceware.org/ml/gdb-patches/2007-11/msg00567.html
>
> Was that patch applied?  AFAICT from the ChangeLog's it wasn't.
>
> If not, have you pinged anyone about this Pedro?
>

Sorry for the 3AM-not-saying-anything-else-but-post-a-patch-link,
and not noticing the thread was broken, so the follow-ups were
not linked from that message.

http://sourceware.org/ml/gdb-patches/2007-12/msg00049.html
http://sourceware.org/ml/gdb-patches/2007-12/msg00439.html

No, it's not appied yet.  I need to split the patch into 2 or 3
parts before it is has a chance of being checked in upstream.  I'll see
if I can find time by the end of the week.

Notice that this is a problem with stabs debug info.  With dwarf you
don't get this problem.

-- 
Pedro Alves

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-18 10:52     ` Ray Hurst
@ 2008-02-18 21:45       ` Pedro Alves
  0 siblings, 0 replies; 14+ messages in thread
From: Pedro Alves @ 2008-02-18 21:45 UTC (permalink / raw)
  To: cygwin

A Monday 18 February 2008 03:55:45, Ray Hurst wrote:

> Di I need to actually take the source changes from this thread and apply
> them to my build?
> Or is there a patch file available?

That *is* a patch file.  It's a text file with inline disposition, so you can
get at the exact file contents without html munging by clicking "Raw text"
link at the top of the page.  You could also use the mailer support for
retrieving messages but would be harder I guess.  Or, you could wait a
few days until I submit new patches upstream.

-- 
Pedro Alves

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

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: Issue with GDB under Cygwin and XP
  2008-02-12  9:02 Issue with GDB under Cygwin and XP Ray Hurst
  2008-02-13  6:16 ` Jim Marshall
  2008-02-16  4:45 ` Ray Hurst
@ 2008-02-24  5:07 ` Ray Hurst
  2 siblings, 0 replies; 14+ messages in thread
From: Ray Hurst @ 2008-02-24  5:07 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-02-24  1:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-12  9:02 Issue with GDB under Cygwin and XP Ray Hurst
2008-02-13  6:16 ` Jim Marshall
2008-02-13 19:41   ` Ray Hurst
2008-02-13 19:59     ` Marco Atzeri
2008-02-13 20:28       ` Ray Hurst
2008-02-14  8:16         ` Jim Marshall
2008-02-14  9:29           ` Jim Marshall
2008-02-16  4:45 ` Ray Hurst
2008-02-17  5:52   ` Pedro Alves
2008-02-17 13:30     ` Christopher Faylor
2008-02-18 20:44       ` Pedro Alves
2008-02-18 10:52     ` Ray Hurst
2008-02-18 21:45       ` Pedro Alves
2008-02-24  5:07 ` Ray Hurst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).