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
Fix: No workaround or fix known.
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
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
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.
No idea. It only manifeste on Solaris targets I think, and I don't have a Solaris toolchain set up.
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?
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.
Created attachment 4991 [details] solaris binary This is the binary that gives the error I mentioned.
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.
Closing as the original problem is fixed, Dara open up a new bug for the problem you found.