This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Debug formats on Linux


On Fri, 27 Oct 2000, Mark Mitchell wrote:

> I suspect that every new GCC platform will use DWARF2.  (I think that
> IA64-Linux uses it.)
>
> Why we can't switch on IA32-Linux is still somewhat beyond me, and I
> still find the documentation as I did years ago.

The following patch does the minimal conservative solution of making
the change on i?86-pc-linux-gnu only - it could probably be made in
the toplevel linux.h instead.

It isn't yet ready to commit, because of the following test
regressions on i686-pc-linux-gnu (though, it removes the two failures
for g++.ext/instantiate1.C):

FAIL: gcc.c-torture/unsorted/loop386.c,  -O3 -g
(ICE at dwarf2out.2:8366 (add_abstract_origin_attribute))

FAIL: g77.f-torture/compile/20000511-2.f,  -O3 -g
FAIL: g77.f-torture/compile/20000629-1.f,  -O3 -g
FAIL: g77.f-torture/compile/980310-3.f,  -O3 -g
FAIL: g77.f-torture/compile/980310-4.f,  -O3 -g
FAIL: g77.f-torture/compile/980310-7.f,  -O3 -g
FAIL: g77.f-torture/execute/19981119-0.f compilation,  -O3 -g
FAIL: g77.f-torture/execute/auto0.f compilation,  -O3 -g
FAIL: g77.f-torture/execute/auto1.f compilation,  -O3 -g
(all ICE at dwarf2out.c:8114 (add_bound_info))

These can be tested without the patch by compiling the individual
testcases with -gdwarf-2 -O3; perhaps someone understanding Fortran
and g77 could look at why those Fortran cases crash and whether the
problem is with the Fortran front end or in the DWARF2 support.
[NOTE: -gdwarf-2 not -gdwarf2, since -gdwarf2 is DWARF1, as discussed
long ago.]

(The change does increase executable sizes somewhat - by about 40% -
but of course this only affects unstripped executables compiled with
debugging.  Where the disk space is a problem a user can always use
-gstabs or -g1 and trade disk space against the reduced expressivity
of the debug information and possible difficulties debugging in the
presence of some optimisations.  In addition, -feliminate-dwarf2-dups
reduces the overhead to about 18%.)

Executable sizes before the patch (stabs debugging):

-rwxr-xr-x    1 root     root      7142838 Oct 27 23:45 cc1
-rwxr-xr-x    1 root     root      7336713 Oct 27 23:45 cc1obj
-rwxr-xr-x    1 root     root      9192466 Oct 27 23:45 cc1plus
-rwxr-xr-x    1 root     root      8396253 Oct 27 23:45 f771
-rwxr-xr-x    1 root     root      7681888 Oct 27 23:45 jc1

Executable sizes after the patch (DWARF2 debugging):

-rwxrwxr-x    1 jsm28    jsm28     9690242 Oct 28 01:09 cc1
-rwxrwxr-x    1 jsm28    jsm28     9885021 Oct 28 01:19 cc1obj
-rwxrwxr-x    1 jsm28    jsm28    12883234 Oct 28 01:13 cc1plus
-rwxrwxr-x    1 jsm28    jsm28    12549193 Oct 28 01:16 f771
-rwxrwxr-x    1 jsm28    jsm28    10504716 Oct 28 01:18 jc1

Executable sizes after the patch with -feliminate-dwarf2-dups:

-rwxrwxr-x    1 jsm28    jsm28     8365736 Oct 28 09:47 cc1
-rwxrwxr-x    1 jsm28    jsm28     8559876 Oct 28 09:57 cc1obj
-rwxrwxr-x    1 jsm28    jsm28    11157091 Oct 28 09:51 cc1plus
-rwxrwxr-x    1 jsm28    jsm28     9652617 Oct 28 09:54 f771
-rwxrwxr-x    1 jsm28    jsm28     9054916 Oct 28 09:56 jc1

2000-10-28  Joseph S. Myers  <jsm28@cam.ac.uk>

	* config/i386/linux.h (PREFERRED_DEBUGGING_TYPE): Define to
	DWARF2_DEBUG for glibc.

--- linux.h.orig	Mon Oct 23 21:55:57 2000
+++ linux.h	Sat Oct 28 00:10:39 2000
@@ -29,6 +29,12 @@
 #include <i386/att.h>	/* Use the i386 AT&T assembler syntax */
 #include <linux.h>	/* some common stuff */

+/* X86 Linux/glibc now uses DWARF2.  */
+#ifndef USE_GNULIBC_1
+#undef PREFERRED_DEBUGGING_TYPE
+#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
+#endif
+
 /* Output at beginning of assembler file.  */
 /* The .file command should always begin the output.  */
 #undef ASM_FILE_START

-- 
Joseph S. Myers
jsm28@cam.ac.uk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]