From 9fc056857823ff58f0f41eb857f65f53ce43e5b5 Mon Sep 17 00:00:00 2001 From: Kevin Buettner Date: Sat, 3 Mar 2012 01:27:47 +0000 Subject: [PATCH] * sh-tdep.c (sh_frame_cache): Don't fetch the FPSCR register unless it exists for this architecture. --- gdb/ChangeLog | 5 +++++ gdb/sh-tdep.c | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index a26e69423dd..6cf9ab4cc71 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2012-03-02 Kevin Buettner + + * sh-tdep.c (sh_frame_cache): Don't fetch the FPSCR register + unless it exists for this architecture. + 2012-03-02 Joel Brobecker * language.h (struct language_defn): New "method" la_read_var_value. diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index e65aeb4b403..3983632b6bc 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); } -- 2.30.2