This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
Re: c++/2412: gdb crashes with complex data
- From: "Jim Blandy" <jimb at red-bean dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 7 Feb 2008 02:38:01 -0000
- Subject: Re: c++/2412: gdb crashes with complex data
- Reply-to: "Jim Blandy" <jimb at red-bean dot com>
The following reply was made to PR c++/2412; it has been noted by GNATS.
From: "Jim Blandy" <jimb@red-bean.com>
To: "jacob navia" <jacob@jacob.remcomp.fr>
Cc: gdb-gnats@sources.redhat.com
Subject: Re: c++/2412: gdb crashes with complex data
Date: Wed, 6 Feb 2008 18:34:45 -0800
If you leave the gdb-gnats@sources.redhat.com address in the CC line,
GDB's bug-tracking system will automatically include your notes in the
bug database entry, which is helpful for other people following along.
I wasn't able to find the test program you provided in your original
description --- only English descriptions of what to try.
The new test program you submitted seems to work for me as well. Have
you checked out the current GDB sources from CVS and built them?
There are instructions for doing so at
http://sourceware.org/gdb/current/.
On Feb 6, 2008 5:30 PM, jacob navia <jacob@jacob.remcomp.fr> wrote:
>
> Jim Blandy wrote:
> > This seems to be fixed in the current sources. Would you like to try
> > building from CVS and see if the problem still occurs?
> >
> > If it does, please provide a specific test program we can use.
> > There's no reason to provide hints when exact instructions are not
> > much more trouble.
> >
> > $ cat complex.c
> > cat: complex.c: No such file or directory
> > $ cd ~/play
> > $ cat complex.c
> > #include <stdio.h>
> >
> > long double _Complex foo = 4.8;
> >
> > int
> > main (int argc, char **argv)
> > {
> > puts ("Hello, world!");
> > return 0;
> > }
> > $ gcc -g complex.c -o complex
> > $ ~/gdb/pub/nat/gdb/gdb ~/play/complex
> > GNU gdb 6.7.50.20080111-cvs
> > Copyright (C) 2008 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-linux-gnu"...
> > (gdb) start
> > Breakpoint 1 at 0x8048395: file complex.c, line 8.
> > Starting program: /home/jimb/play/complex
> > main () at complex.c:8
> > 8 puts ("Hello, world!");
> > (gdb) print foo
> > $1 = 4.7999999999999998223643160599749535 + 0 * I
> > (gdb)
> >
>
> Please, I sent you a program that crashes gdb in my bug description.
> You used a GLOBAL variable. Please use a local variable:
>
> int main(void)
> {
> long double _Complex s = 1;
> long double _Complex m = 1;
> }
>
> put a breakpoint after the first assignment and in gdb type
> print s
> This will crash gdb with a segmentation fault
>
>
>