Bug 7360 - g++ generates illegal debug info on Solaris that crashes gdb
Summary: g++ generates illegal debug info on Solaris that crashes gdb
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 3.1.1
: P3 normal
Target Milestone: 3.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-19 13:16 UTC by rohlfing
Modified: 2005-07-23 22:49 UTC (History)
4 users (show)

See Also:
Host: sparc-sun-solaris2.7
Target: sparc-sun-solaris2.7
Build: sparc-sun-solaris2.7
Known to work:
Known to fail:
Last reconfirmed:


Attachments
gxxbug.tgz (455 bytes, application/x-gzip )
2003-05-21 15:17 UTC, rohlfing
Details
solaris binary (5.47 KB, application/octet-stream)
2003-10-24 22:40 UTC, Dara Hazeghi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rohlfing 2002-07-19 13:16:01 UTC
        g++ generates debug information that crashes GDB when trying to 
        inspect source files. Analysis by GDB maintainer has shown that
        g++ puts N_FUN markers without matching markers at the beginning
        of a function. See GDB bug report 610 for details.

Release:
3.1 and pre3.1.1 (CVS snapshot 15-Jul-2002)

Environment:
Solaris 2.7, gdb 5.2 and gdb CVS snapshot 17-Jul-2002
System: SunOS IGL.Stanford.EDU 5.7 Generic_106541-16 sun4u sparc SUNW,Ultra-250
Architecture: sun4

	
host: sparc-sun-solaris2.7
build: sparc-sun-solaris2.7
target: sparc-sun-solaris2.7
configured with: ./configure --prefix=/usr/local --verbose --x-includes=/usr/openwin/include --x-libraries=/usr/openwin/lib --with-libiconv-path=/usr/local/lib --enable-libgcj --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld

How-To-Repeat:

        Attached is a tgz archive with four files: test.cxx,
        classes.cxx, and classes.h contain example source code
        (for minimal classes). The file "build" will run g++ and
        generate a binary file called "test".

        If "test" is read into gdb up to and including the
        latest snapshot of version 5.2, issuing "list D" to
        inspect source for class "D" will crash gdb.

        Note that if inheritance of class D from class C is
        changed to non-virtual, gdb does not crash anymore but is
        still unable to show the correct source file.

See attachments for gxxbug.tgz
Comment 1 rohlfing 2002-07-19 13:16:01 UTC
Fix:
	No workaround or fix known.
Comment 2 larue 2003-04-18 09:42:58 UTC
From: "Woody LaRue" <larue@cadence.com>
To: <rohlfing@stanford.edu>, <gcc-gnats@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>,
        <nobody@gcc.gnu.org>, <gcc-prs@gcc.gnu.org>
Cc:  
Subject: Re: debug/7360: g++ generates illegal debug info on Solaris that crashes gdb
Date: Fri, 18 Apr 2003 09:42:58 -0700

 I have been seeing the very same behavior when debugging SystemC models =
 compiled with gcc 3.2 using=20
 gdb.  This problem will soon become a great concern to the SystemC =
 community (which is currently using gcc 2.95, but
 will be upgrading to gcc 3.2) Are there any plans to fix this problem ?  =
 I'm considering undertaking a fix and would greatly appreciate
 any pointers to get me started.=20
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&database=3D=
 gcc&pr=3D7360
Comment 3 Dara Hazeghi 2003-05-25 04:50:00 UTC
Hello,

sorry to see that gcc 3.2 still has this problem. Do you know if this issue is still present in gcc 3.3? 
Thanks,

Dara
Comment 4 Andrew Pinski 2003-08-21 19:29:43 UTC
Daniel do you know if this still a problem in 3.3 or the mainline?
The reason why I am asking is that Dara asked for feedback almost three months ago and there 
has been no response and I looked at the gdb bug and your name came up in the bug, and you 
analysised the problem in that bug.
Comment 5 Daniel Jacobowitz 2003-08-28 20:34:25 UTC
No idea.  It only manifeste on Solaris targets I think, and I don't have a Solaris
toolchain set up.
Comment 6 Dara Hazeghi 2003-10-24 17:12:15 UTC
Harrumph, this is what I get with 3.3.1 and gdb 5.3:

bash-2.05b$ gdb test
GNU gdb 5.3
Copyright 2002 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 "sparc-sun-solaris2.8"...
(gdb) list D
Line number 20 out of range; classes.cxx has 5 lines.

This a gdb problem, a gcc problem, or me just being dense?
Comment 7 Daniel Jacobowitz 2003-10-24 22:13:18 UTC
Subject: Re:  g++ generates illegal debug info on Solaris that crashes gdb

On Fri, Oct 24, 2003 at 05:12:19PM -0000, dhazeghi at yahoo dot com wrote:
> (gdb) list D
> Line number 20 out of range; classes.cxx has 5 lines.
> 
> This a gdb problem, a gcc problem, or me just being dense?

Either (A) or (B).  Could you attach the binary that shows that
problem?  Then I'll take a look at it.
Comment 8 Dara Hazeghi 2003-10-24 22:40:51 UTC
Created attachment 4991 [details]
solaris binary

This is the binary that gives the error I mentioned.
Comment 9 Daniel Jacobowitz 2003-10-28 16:23:11 UTC
Hi Dara,

The out-of-range line number is a GCC bug (but a different one).
The unbalanced N_FUN markers do not appear in your binary, so I believe
the original problem is fixed; you may wish to open a new PR.
Comment 10 Andrew Pinski 2003-10-28 16:27:00 UTC
Closing as the original problem is fixed, Dara open up a new bug for the problem you found.