Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 14 Aug 2002 22:27:30 +0200 (CEST)
From:      kettenis@gnu.org
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        obrien@FreeBSD.org
Subject:   bin/41671: gcc produces bad debug info
Message-ID:  <200208142027.g7EKRUAL007402@elgar.kettenis.dyndns.org>

next in thread | raw e-mail | index | archive | help

>Number:         41671
>Category:       bin
>Synopsis:       gcc produces bad debug info
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Aug 14 13:30:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Mark Kettenis
>Release:        FreeBSD 4.6-STABLE i386
>Organization:
>Environment:
System: FreeBSD elgar.kettenis.dyndns.org 4.6-STABLE FreeBSD 4.6-STABLE #6: Mon Aug 12 21:14:48 CEST 2002 kettenis@elgar.kettenis.dyndns.org:/usr/obj/usr/src/sys/ELGAR i386

	
>Description:
The version of gcc 2.95.4 included with FreeBSD 4.6-STABLE produces
bad debug info when using the STABS debug format, which is the
default.  Basically it outputs the stabs for a function definition,
including its parameters, twice.  The impact of these duplicate stabs
is limited on older versions of GDB, but a recent change in GDB CVS
that sorts debugging symbols a little differently unveils the problem.
There are now a lot of testsuite failures, and the bug will seriously
hamper the usage of future releases of GDB on FreeBSD.

	
>How-To-Repeat:
Check out GDB from CVS and run the testsuite.  Note the massive
failures in the gdb.base/funargs.exp test.  With a fixed gcc, there
are no failures.

	
>Fix:
There's a thinko in dbxout.c:dbxout_function(), which causes
dbxout_really_begin_function() to be called twice (once before and
once after the code for the function is emitted) if DBX_FUNCTION_FIRST
isn't defined regardless whether DBX_CHECK_FUNCTION_FIRST is defined.
The following patch fixes the problem, and makes the GDB testsuite
much happier!  I'd really appreciate if this patch could be included
in FreeBSD 4.7, or perhaps even 4.6.1.  AFAICT there is no need to fix
-CURRENT, since the bug isn't present in the version of GCC 3.1 that's
used there.

--- /usr/src/contrib/gcc/dbxout.c.orig	Tue Oct 26 10:47:58 1999
+++ /usr/src/contrib/gcc/dbxout.c	Wed Aug 14 21:38:31 2002
@@ -2708,11 +2708,11 @@ dbxout_function (decl)
      tree decl;
 {
 #ifndef DBX_FUNCTION_FIRST
-  dbxout_really_begin_function (decl);
-#else
 #ifdef DBX_CHECK_FUNCTION_FIRST
   if (!(DBX_CHECK_FUNCTION_FIRST))
     dbxout_really_begin_function (decl);
+#else
+  dbxout_really_begin_function (decl);
 #endif
 #endif
   dbxout_block (DECL_INITIAL (decl), 0, DECL_ARGUMENTS (decl));

	
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200208142027.g7EKRUAL007402>