From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16658 invoked by alias); 8 Sep 2004 15:44:30 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16646 invoked from network); 8 Sep 2004 15:44:29 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 8 Sep 2004 15:44:29 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i88FiTS0001421 for ; Wed, 8 Sep 2004 11:44:29 -0400 Received: from zenia.home.redhat.com (porkchop.devel.redhat.com [172.16.58.2]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i88FiR318731; Wed, 8 Sep 2004 11:44:27 -0400 To: gdb-patches@sources.redhat.com Subject: RFC: Use Dwarf 2 CFI on PowerPC targets From: Jim Blandy Date: Wed, 08 Sep 2004 15:44:00 -0000 Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-09/txt/msg00128.txt.bz2 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 * 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);