From 9ca107148e888a7f7aaf3582569708684bd04690 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Sat, 11 Jun 2016 07:43:46 -0700 Subject: [PATCH] Set uses_fp for frames with a valid FP register explicitly. Since CORE_ADDR is unsigned, the saved FP register is always greater than or equal to zero. Replace the comparison by explicitly setting uses_fp to 1 for frames with a valid FP register. gdb/ChangeLog: * sh64-tdep.c (sh64_analyze_prologue): Set "uses_fp" when setting the MEDIA_FP_REGNUM register. --- gdb/ChangeLog | 5 +++++ gdb/sh64-tdep.c | 29 ++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9957227c8a5..c9ad9ccb2bf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-07-06 John Baldwin + + * sh64-tdep.c (sh64_analyze_prologue): Set "uses_fp" when setting + the MEDIA_FP_REGNUM register. + 2016-07-06 John Baldwin * score-tdep.c (score7_malloc_and_get_memblock): Remove check for diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index e6b1e270205..ee8d19ccd9e 100644 --- a/gdb/sh64-tdep.c +++ b/gdb/sh64-tdep.c @@ -901,8 +901,11 @@ sh64_analyze_prologue (struct gdbarch *gdbarch, } else if (IS_MOV_R14 (insn)) - cache->saved_regs[MEDIA_FP_REGNUM] = - cache->sp_offset - ((((insn & 0xf) ^ 0x8) - 0x8) << 2); + { + cache->saved_regs[MEDIA_FP_REGNUM] = + cache->sp_offset - ((((insn & 0xf) ^ 0x8) - 0x8) << 2); + cache->uses_fp = 1; + } else if (IS_MOV_R0 (insn)) { @@ -931,6 +934,7 @@ sh64_analyze_prologue (struct gdbarch *gdbarch, /* Store R14 at r0_val-4 from SP. Decrement r0 by 4. */ cache->saved_regs[MEDIA_FP_REGNUM] = cache->sp_offset - (r0_val - 4); + cache->uses_fp = 1; r0_val -= 4; } @@ -957,22 +961,25 @@ sh64_analyze_prologue (struct gdbarch *gdbarch, 9) << 2); else if (IS_STQ_R14_R15 (insn)) - cache->saved_regs[MEDIA_FP_REGNUM] - = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, - 9) << 3); + { + cache->saved_regs[MEDIA_FP_REGNUM] + = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, + 9) << 3); + cache->uses_fp = 1; + } else if (IS_STL_R14_R15 (insn)) - cache->saved_regs[MEDIA_FP_REGNUM] - = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, - 9) << 2); + { + cache->saved_regs[MEDIA_FP_REGNUM] + = cache->sp_offset - (sign_extend ((insn & 0xffc00) >> 10, + 9) << 2); + cache->uses_fp = 1; + } else if (IS_MOV_SP_FP_MEDIA (insn)) break; } } - - if (cache->saved_regs[MEDIA_FP_REGNUM] >= 0) - cache->uses_fp = 1; } static CORE_ADDR -- 2.30.2