This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

3.4/3.5 PATCH: Switch to DWARF-2 debugging on Solaris/x86 >= 7


Eric's patch

	http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00156.html

to default to DWARF-2 debugging on Solaris 7 and up was only applied to the
sparc-*-solaris2 configuration, although the arguments for that change
(problems with stabs support in GCC/GDB) apply to Solaris/x86 as well.

Since this is a considerable change, I'd like to apply it to that port,
too.  I think it's undesirable to make that change after the initial 3.4.0
release or let the SPARC and x86 ports diverge in this respect.

Would such a patch be acceptable for the 3.4 branch at this point?

Here's a possible (yet untested) mainline patch that does this:

Fri Apr 16 18:04:38 2004  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* config.gcc (i[34567]86-*-solaris2*): Default to DWARF-2
	debugging on Solaris 7 and up.

--- config.gcc	Tue Apr 13 14:04:04 2004
+++ config.gcc.new	Fri Apr 16 19:05:39 2004
@@ -987,6 +987,11 @@
 	else
 		tmake_file="$tmake_file t-slibgcc-sld"
 	fi
+	case ${target} in
+	*-*-solaris2.[789] | *-*-solaris2.1[0-9])
+		tm_file="$tm_file tm-dwarf2.h"
+		;;
+	esac
 	extra_parts="crt1.o crti.o crtn.o gcrt1.o gmon.o crtbegin.o crtend.o"
 	case ${enable_threads}:${have_pthread_h}:${have_thread_h} in
 	  no:*:*) ;;

What I have tested so far is bootstrapping the 3.4 branch on
i386-pc-solaris2.10 without (thus defaulting to stabs) and with
--with-dwarf2 (which has the same effect as the patch above).

There were no testsuite regressions.  Besides, I've run the gdb 6.1
testsuite against both compilers with encouraging results:

--- gdb.sum.stabs	Thu Apr 15 18:25:06 2004
+++ gdb.sum.dwarf2	Thu Apr 15 18:40:41 2004
@@ -1,4 +1,4 @@
-Test Run By ro on Thu Apr 15 18:19:56 2004
+Test Run By ro on Thu Apr 15 18:35:32 2004
 Native configuration is i386-pc-solaris2.10
 
[...]
 		=== gdb Summary ===
 
-# of expected passes		365
-# of unexpected failures	54
+# of expected passes		480
+# of unexpected failures	33
 # of unresolved testcases	1
 
On the other hand, my first test with dbx from Sun ONE Compiler Collection
8.0 on cc1 didn't give a good expression on SPARC:

% ./cc1
For information about new features see `help changes'
To remove this message, put `dbxenv suppress_startup_message 7.1' in your .dbxrc
Reading cc1
Reading ld.so.1
Reading libc.so.1
Reading libdl.so.1
Reading libc_psr.so.1
(dbx) stop in main                                                           
(2) stop in main
(dbx) run hello.i
Running: cc1 hello.i 
(process id 87)
stopped in main at line 35 in file "main.c"
   35     return toplev_main (argc, (const char **) argv);
(dbx) step       
dbx: panic: "Dwarf2::ProcessTag"(): Assertion (index <= abbrTab[0]) failed - "dwf2.cc":2144

This problem may be fixed in some dbx patch or in the upcoming Sun Studio
9.0 (haven't checked the EA2 version yet), but it might be a bug in GCC's
DWARF-2 generation as well ;-(  At least this doesn't happen on Solaris/x86.

As an aside, I think that the definition of ASM_DEBUG in
config/sparc/sol2-bi.h from the above patch can be removed completely since
this is identical to the gcc.c default.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University


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