From 4ae173461a7166e24f23c5d3e7ba8e9cc340f439 Mon Sep 17 00:00:00 2001 From: pgilliam Date: Mon, 13 Nov 2006 17:37:36 +0000 Subject: [PATCH] Fix sigtramp cache code so that PPC register are read only if there is H/W. --- gdb/ChangeLog | 4 ++++ gdb/ppc-linux-tdep.c | 18 ++++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3b807cbb75..dedde90ef7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2006-10-31 Paul Gilliam + * ppc-linux-tdep.c (ppc_linux_sigtramp_cache): Don't futz with + the floating point registers if there aren't any. + 2006-11-12 Ben Harris * arm-tdep.c (arm_unwind_pc): Use arm_addr_bits_remove. diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index 5e1bc003fb..e10c614178 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -916,14 +916,16 @@ ppc_linux_sigtramp_cache (struct frame_info *next_frame, trad_frame_set_reg_addr (this_cache, tdep->ppc_cr_regnum, gpregs + 38 * tdep->wordsize); - /* Floating point registers. */ - for (i = 0; i < 32; i++) - { - int regnum = i + FP0_REGNUM; - trad_frame_set_reg_addr (this_cache, regnum, fpregs + i * tdep->wordsize); - } - trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum, - fpregs + 32 * tdep->wordsize); + if (ppc_floating_point_unit_p (gdbarch)) { + /* Floating point registers. */ + for (i = 0; i < 32; i++) + { + int regnum = i + FP0_REGNUM; + trad_frame_set_reg_addr (this_cache, regnum, fpregs + i * tdep->wordsize); + } + trad_frame_set_reg_addr (this_cache, tdep->ppc_fpscr_regnum, + fpregs + 32 * tdep->wordsize); + } trad_frame_set_id (this_cache, frame_id_build (base, func)); } -- 2.11.0