aboutsummaryrefslogtreecommitdiff
path: root/gdb/sh-tdep.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2012-03-03 01:27:47 +0000
committerKevin Buettner <kevinb@redhat.com>2012-03-03 01:27:47 +0000
commit9fc056857823ff58f0f41eb857f65f53ce43e5b5 (patch)
tree606e172aa864bf921e8748b570471a8a72d02280 /gdb/sh-tdep.c
parentd98bfeb0233c622e936bdda16ff03277077f5ca2 (diff)
downloadfsf-binutils-gdb-9fc056857823ff58f0f41eb857f65f53ce43e5b5.zip
fsf-binutils-gdb-9fc056857823ff58f0f41eb857f65f53ce43e5b5.tar.gz
fsf-binutils-gdb-9fc056857823ff58f0f41eb857f65f53ce43e5b5.tar.bz2
* sh-tdep.c (sh_frame_cache): Don't fetch the FPSCR register
unless it exists for this architecture.
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r--gdb/sh-tdep.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
index e65aeb4..3983632 100644
--- a/gdb/sh-tdep.c
+++ b/gdb/sh-tdep.c
@@ -2554,7 +2554,16 @@ sh_frame_cache (struct frame_info *this_frame, void **this_cache)
if (cache->pc != 0)
{
ULONGEST fpscr;
- fpscr = get_frame_register_unsigned (this_frame, FPSCR_REGNUM);
+
+ /* Check for the existence of the FPSCR register. If it exists,
+ fetch its value for use in prologue analysis. Passing a zero
+ value is the best choice for architecture variants upon which
+ there's no FPSCR register. */
+ if (gdbarch_register_reggroup_p (gdbarch, FPSCR_REGNUM, all_reggroup))
+ fpscr = get_frame_register_unsigned (this_frame, FPSCR_REGNUM);
+ else
+ fpscr = 0;
+
sh_analyze_prologue (gdbarch, cache->pc, current_pc, cache, fpscr);
}