From: Andreas Schwab <schwab@suse.de>
To: gdb-patches@sourceware.org
Subject: Use DWARF CFI frame unwinder on powerpc
Date: Tue, 09 May 2006 14:16:00 -0000 [thread overview]
Message-ID: <jehd3z1dy7.fsf@sykes.suse.de> (raw)
Together with the previous patch this enables the use of the DWARF CFI
frame unwinder on powerpc. This fixes the following testsuite failures:
-FAIL: gdb.base/break.exp: next over recursive call
-FAIL: gdb.base/break.exp: backtrace from factorial(5.1)
-FAIL: gdb.base/recurse.exp: continue to recurse (a = 4)
-FAIL: gdb.base/recurse.exp: continue to recurse (a = 3)
-FAIL: gdb.base/recurse.exp: continue to recurse (a = 2)
-FAIL: gdb.base/recurse.exp: continue to recurse (a = 1)
-FAIL: gdb.base/recurse.exp: continue to second instance watchpoint, second time
-FAIL: gdb.base/recurse.exp: second instance watchpoint deleted when leaving scope
-FAIL: gdb.base/recurse.exp: continue to first instance watchpoint, second time
-FAIL: gdb.base/recurse.exp: first instance watchpoint deleted when leaving scope
-FAIL: gdb.base/sepdebug.exp: next over recursive call
-FAIL: gdb.base/sepdebug.exp: backtrace from factorial(5.1)
without any new regressions. Tested with powerpc-suse-linux.
Andreas.
2006-05-09 Andreas Schwab <schwab@suse.de>
* rs6000-tdep.c: Include "dwarf2-frame.h".
(rs6000_eh_frame_regnum): Define.
(rs6000_gdbarch_init): Enable use of DWARF CFI frame unwinder.
Register rs6000_eh_frame_regnum.
* Makefile.in (rs6000-tdep.o): Update dependencies.
Index: gdb/Makefile.in
===================================================================
RCS file: /cvs/src/src/gdb/Makefile.in,v
retrieving revision 1.812
diff -u -a -p -u -p -a -r1.812 gdb/Makefile.in
--- gdb/Makefile.in 5 May 2006 22:39:12 -0000 1.812
+++ gdb/Makefile.in 9 May 2006 14:10:40 -0000
@@ -2515,7 +2515,7 @@ rs6000-tdep.o: rs6000-tdep.c $(defs_h) $
$(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) $(rs6000_tdep_h)
+ $(frame_unwind_h) $(frame_base_h) $(rs6000_tdep_h) $(dwarf2_frame_h)
rs6000-aix-tdep.o: rs6000-aix-tdep.c $(defs_h) $(osabi_h) $(rs6000_tdep_h)
s390-nat.o: s390-nat.c $(defs_h) $(tm_h) $(regcache_h) $(inferior_h) \
$(s390_tdep_h) $(target_h) $(linux_nat_h)
Index: gdb/rs6000-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/rs6000-tdep.c,v
retrieving revision 1.258
diff -u -a -p -u -p -a -r1.258 gdb/rs6000-tdep.c
--- gdb/rs6000-tdep.c 23 Apr 2006 14:15:01 -0000 1.258
+++ gdb/rs6000-tdep.c 9 May 2006 14:10:15 -0000
@@ -40,6 +40,7 @@
#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 */
@@ -2243,6 +2244,40 @@ rs6000_dwarf2_reg_to_regnum (int num)
}
+/* Convert a .eh_frame register number to a Dwarf 2 register number. */
+static int
+rs6000_eh_frame_regnum (struct gdbarch *gdbarch, int num)
+{
+ if (0 <= num && num <= 63) /* r0-r31,fp0-fp31 */
+ return num;
+ else if (68 <= num && num <= 75) /* cr0-cr8 */
+ return num - 68 + 86;
+ else if (77 <= num && num <= 108) /* vr0-vr31 */
+ return num - 77 + 1124;
+ else
+ switch (num)
+ {
+ case 64: /* mq */
+ return 100;
+ case 65: /* lr */
+ return 108;
+ case 66: /* ctr */
+ return 109;
+ case 76: /* xer */
+ return 101;
+ case 109: /* vrsave */
+ return 356;
+ case 110: /* vscr */
+ return 67;
+ case 111: /* spe_acc */
+ return 99;
+ case 112: /* spefscr */
+ return 612;
+ default:
+ return num;
+ }
+}
+
static void
rs6000_store_return_value (struct type *type,
struct regcache *regcache,
@@ -3461,6 +3496,10 @@ rs6000_gdbarch_init (struct gdbarch_info
/* 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);
+ dwarf2_frame_set_eh_frame_regnum (gdbarch, rs6000_eh_frame_regnum);
+
/* Hook in ABI-specific overrides, if they have been registered. */
gdbarch_init_osabi (info, gdbarch);
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, MaxfeldstraÃe 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
next reply other threads:[~2006-05-09 14:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-09 14:16 Andreas Schwab [this message]
2006-05-09 17:17 ` PAUL GILLIAM
2006-05-09 17:23 ` Daniel Jacobowitz
2006-05-09 22:26 ` PAUL GILLIAM
2006-05-09 17:46 ` Andreas Schwab
2006-05-09 18:01 ` David S. Miller
2006-05-09 18:39 ` Daniel Jacobowitz
2006-05-09 21:07 ` David S. Miller
2006-05-15 16:46 ` Daniel Jacobowitz
2006-05-15 19:10 ` Mark Kettenis
2006-05-15 20:43 ` Daniel Jacobowitz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=jehd3z1dy7.fsf@sykes.suse.de \
--to=schwab@suse.de \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox