diff options
author | John Baldwin <jhb@FreeBSD.org> | 2016-06-11 07:43:46 -0700 |
---|---|---|
committer | John Baldwin <jhb@FreeBSD.org> | 2016-07-06 06:08:43 -0700 |
commit | 9ca107148e888a7f7aaf3582569708684bd04690 (patch) | |
tree | daeb1ac2f666b72c923378c1d49a7673ff38d1a0 | |
parent | d66ff635bec25bf940cc6d173a92f7796f18b310 (diff) | |
download | gdb-9ca107148e888a7f7aaf3582569708684bd04690.zip gdb-9ca107148e888a7f7aaf3582569708684bd04690.tar.gz gdb-9ca107148e888a7f7aaf3582569708684bd04690.tar.bz2 |
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.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/sh64-tdep.c | 29 |
2 files changed, 23 insertions, 11 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9957227..c9ad9cc 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-07-06 John Baldwin <jhb@FreeBSD.org> + * sh64-tdep.c (sh64_analyze_prologue): Set "uses_fp" when setting + the MEDIA_FP_REGNUM register. + +2016-07-06 John Baldwin <jhb@FreeBSD.org> + * score-tdep.c (score7_malloc_and_get_memblock): Remove check for negative size. diff --git a/gdb/sh64-tdep.c b/gdb/sh64-tdep.c index e6b1e27..ee8d19c 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 |