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]

use correct DWARF register numbers on rs6000 non-ELF ports


This patch moves two macros from sysv4.h to rs6000.h, which has the
effect of causing non-ELF ports to use the same DWARF register
numbering as ELF ports.

This only affects registers other than GPRs and FPRs, so mostly
Altivec registers.

It can't affect anything when DWARF debugging is not switched on, and
also does not affect eh_frame numbering (you'll notice that macro was
in rs6000.h already).

I'm putting it in rs6000.h rather than darwin.h because if AIX or any
other rs6000 port enables DWARF, they should use the standard
register numbers too.

Bootstrapped & tested on powerpc-darwin.  It'll need a new gdb for
full effect since the existing gdb is not consistent with either the
current or the standard register numbers.

I'd like to put this into 4.2, but I'll wait till Monday in case
anyone thinks it shouldn't go in...

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

===File ~/patches/gcc-rs6000-dwarfnumbers.patch=============
2006-10-14  Geoffrey Keating  <geoffk@apple.com>

	* config/rs6000/sysv4.h (DBX_REGISTER_NUMBER): Move to rs6000.h.
	(DWARF2_FRAME_REG_OUT): Likewise.
	* config/rs6000/rs6000.h (DBX_REGISTER_NUMBER): Move from sysv4.h.
	(DWARF2_FRAME_REG_OUT): Likewise.

Index: config/rs6000/rs6000.h
===================================================================
--- config/rs6000/rs6000.h	(revision 117675)
+++ config/rs6000/rs6000.h	(working copy)
@@ -612,9 +612,24 @@
 #define DWARF_REG_TO_UNWIND_COLUMN(r) \
   ((r) > 1200 ? ((r) - 1200 + FIRST_PSEUDO_REGISTER - 1) : (r))
 
+/* Use standard DWARF numbering for DWARF debugging information.  */
+#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO)
+
 /* Use gcc hard register numbering for eh_frame.  */
 #define DWARF_FRAME_REGNUM(REGNO) (REGNO)
 
+/* Map register numbers held in the call frame info that gcc has
+   collected using DWARF_FRAME_REGNUM to those that should be output in
+   .debug_frame and .eh_frame.  We continue to use gcc hard reg numbers
+   for .eh_frame, but use the numbers mandated by the various ABIs for
+   .debug_frame.  rs6000_emit_prologue has translated any combination of
+   CR2, CR3, CR4 saves to a save of CR2.  The actual code emitted saves
+   the whole of CR, so we map CR2_REGNO to the DWARF reg for CR.  */
+#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH)	\
+  ((FOR_EH) ? (REGNO)				\
+   : (REGNO) == CR2_REGNO ? 64			\
+   : DBX_REGISTER_NUMBER (REGNO))
+
 /* 1 for registers that have pervasive standard uses
    and are not available for the register allocator.
 
Index: config/rs6000/sysv4.h
===================================================================
--- config/rs6000/sysv4.h	(revision 117675)
+++ config/rs6000/sysv4.h	(working copy)
@@ -535,20 +535,6 @@
 /* Historically we have also supported stabs debugging.  */
 #define DBX_DEBUGGING_INFO 1
 
-#define DBX_REGISTER_NUMBER(REGNO) rs6000_dbx_register_number (REGNO)
-
-/* Map register numbers held in the call frame info that gcc has
-   collected using DWARF_FRAME_REGNUM to those that should be output in
-   .debug_frame and .eh_frame.  We continue to use gcc hard reg numbers
-   for .eh_frame, but use the numbers mandated by the various ABIs for
-   .debug_frame.  rs6000_emit_prologue has translated any combination of
-   CR2, CR3, CR4 saves to a save of CR2.  The actual code emitted saves
-   the whole of CR, so we map CR2_REGNO to the DWARF reg for CR.  */
-#define DWARF2_FRAME_REG_OUT(REGNO, FOR_EH)	\
-  ((FOR_EH) ? (REGNO)				\
-   : (REGNO) == CR2_REGNO ? 64			\
-   : DBX_REGISTER_NUMBER (REGNO))
-
 #define TARGET_ENCODE_SECTION_INFO  rs6000_elf_encode_section_info
 #define TARGET_IN_SMALL_DATA_P  rs6000_elf_in_small_data_p
 #define TARGET_SECTION_TYPE_FLAGS  rs6000_elf_section_type_flags
============================================================


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