RFC: Use Dwarf 2 CFI on PowerPC targets

Jim Blandy jimb@redhat.com
Wed Sep 8 15:44:00 GMT 2004


This works fine on PowerPC E500 Linux; I'm still testing it on other
platforms.  Thus it's a Request for Comments, not Approval.  I'll be
back with test results on AIX, sim, and plain PowerPC Linux in a bit.

2004-09-02  Jim Blandy  <jimb@redhat.com>

	* rs6000-tdep.c: #include "dwarf2-frame.h".
	(rs6000_dwarf2_reg_to_regnum): Recognize 65 as another number for lr.
	(rs6000_gdbarch_init): Hook in dwarf2_frame_sniffer.
	* Makefile.in (rs6000-tdep.o): Update dependencies.
	
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.613
diff -c -p -r1.613 Makefile.in
*** gdb/Makefile.in	1 Sep 2004 18:00:27 -0000	1.613
--- gdb/Makefile.in	2 Sep 2004 17:11:13 -0000
*************** rs6000-tdep.o: rs6000-tdep.c $(defs_h) $
*** 2396,2402 ****
  	$(reggroups_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \
  	$(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \
  	$(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \
! 	$(frame_unwind_h) $(frame_base_h)
  s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \
  	$(s390_tdep_h)
  s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
--- 2396,2402 ----
  	$(reggroups_h) $(libbfd_h) $(coff_internal_h) $(libcoff_h) \
  	$(coff_xcoff_h) $(libxcoff_h) $(elf_bfd_h) $(solib_svr4_h) \
  	$(ppc_tdep_h) $(gdb_assert_h) $(dis_asm_h) $(trad_frame_h) \
! 	$(frame_unwind_h) $(frame_base_h) $(dwarf2_frame_h)
  s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \
  	$(s390_tdep_h)
  s390-tdep.o: s390-tdep.c $(defs_h) $(arch_utils_h) $(frame_h) $(inferior_h) \
Index: gdb/rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.229
diff -c -p -r1.229 rs6000-tdep.c
*** gdb/rs6000-tdep.c	9 Aug 2004 18:43:21 -0000	1.229
--- gdb/rs6000-tdep.c	2 Sep 2004 17:11:14 -0000
***************
*** 40,45 ****
--- 40,46 ----
  #include "sim-regno.h"
  #include "gdb/sim-ppc.h"
  #include "reggroups.h"
+ #include "dwarf2-frame.h"
  
  #include "libbfd.h"		/* for bfd_default_set_arch_mach */
  #include "coff/internal.h"	/* for libcoff.h */
*************** rs6000_dwarf2_reg_to_regnum (int num)
*** 2067,2072 ****
--- 2068,2077 ----
    else
      switch (num)
        {
+         /* FIXME: jimb/2004-09-02: I think it's a bug that GCC ever
+            emits this.  But GCC 3.4 does use it in .debug_frame.  */
+       case 65:
+         return tdep->ppc_lr_regnum;
        case 67:
          return tdep->ppc_vrsave_regnum - 1; /* vscr */
        case 99:
*************** rs6000_gdbarch_init (struct gdbarch_info
*** 3281,3286 ****
--- 3286,3294 ----
    /* Helpers for function argument information.  */
    set_gdbarch_fetch_pointer_argument (gdbarch, rs6000_fetch_pointer_argument);
  
+   /* Hook in the DWARF CFI frame unwinder.  */
+   frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer);
+ 
    /* Hook in ABI-specific overrides, if they have been registered.  */
    gdbarch_init_osabi (info, gdbarch);
  



More information about the Gdb-patches mailing list