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]

DWARF register numbers for x86-darwin


It appears the i386 backend defaults to emitting non-standard DWARF.
It also appears that just about every i386 target, except Darwin,
overrides this default.  Generally they override for both DWARF and
STABS, but for backwards compatibility Darwin probably shouldn't do
that.

Bootstrapped & tested (including gdb testsuite, which is somewhat
flakey at this point but showed a definite improvement with this
patch!) on i386-linux.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/gcc-darwin-4439051.patch==================
2006-02-10  Geoffrey Keating  <geoffk@apple.com>

	* config/i386/darwin.h (DBX_REGISTER_NUMBER): Define.

Index: config/i386/darwin.h
===================================================================
--- config/i386/darwin.h	(revision 110815)
+++ config/i386/darwin.h	(working copy)
@@ -152,3 +152,13 @@
 	}								\
       else fprintf (FILE, "\tcall mcount\n");				\
     } while (0)
+
+/* Darwin uses the standard DWARF register numbers but the default
+   register numbers for STABS.  Fortunately for 64-bit code the
+   default and the standard are the same.  */
+#undef DBX_REGISTER_NUMBER
+#define DBX_REGISTER_NUMBER(n) (TARGET_64BIT			\
+				? dbx64_register_map[n]		\
+				: write_symbols == DWARF2_DEBUG	\
+				? svr4_dbx_register_map[n]	\
+				: dbx_register_map[n])
============================================================


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