diff options
author | Fred Fish <fnf@specifix.com> | 1997-06-21 03:50:11 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1997-06-21 03:50:11 +0000 |
commit | 4a9d4495ebbbfd98014692be93ff0fe98a44657d (patch) | |
tree | 4626d87ca2fd1fd2b0ae4e996ed9e4bb29acef25 /gdb/sh-tdep.c | |
parent | 73bb488673e071b47b349191cd38028e3ebb45b6 (diff) | |
download | gdb-4a9d4495ebbbfd98014692be93ff0fe98a44657d.zip gdb-4a9d4495ebbbfd98014692be93ff0fe98a44657d.tar.gz gdb-4a9d4495ebbbfd98014692be93ff0fe98a44657d.tar.bz2 |
* sh-tdep.c (sh_skip_prologue): Also recognize fmov insns.
(sh_frame_find_saved_regs): Recognize fmov insns and adjust
stack push count accordingly.
* sh-tdep.c (IS_FMOV, FPSCR_SZ): New defines
Diffstat (limited to 'gdb/sh-tdep.c')
-rw-r--r-- | gdb/sh-tdep.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 7c7002a..c1db88c 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -113,6 +113,10 @@ struct { #define IS_MOV_R3(x) (((x) & 0xff00) == 0x1a00) #define IS_SHLL_R3(x) ((x) == 0x4300) #define IS_ADD_R3SP(x) ((x) == 0x3f3c) +/* start-sanitize-sh4 */ +#define IS_FMOV(x) (((x) & 0xf00f) == 0xf00b) +#define FPSCR_SZ (1 << 20) +/* end-sanitize-sh4 */ /* Skip any prologue before the guts of a function */ @@ -124,6 +128,9 @@ sh_skip_prologue (start_pc) w = read_memory_integer (start_pc, 2); while (IS_STS (w) + /* start-sanitize-sh4 */ + || IS_FMOV (w) + /* end-sanitize-sh4 */ || IS_PUSH (w) || IS_MOV_SP_FP (w) || IS_MOV_R3 (w) @@ -240,9 +247,11 @@ sh_frame_find_saved_regs (fi, fsr) depth = 0; - /* Loop around examining the prologue insns, but give up - after 15 of them, since we're getting silly then */ - while (pc < opc + 15 * 2) + /* Loop around examining the prologue insns until we find something + that does not appear to be part of the prologue. But give up + after 20 of them, since we're getting silly then. */ + + while (pc < opc + 20 * 2) { /* See where the registers will be saved to */ if (IS_PUSH (insn)) @@ -286,6 +295,21 @@ sh_frame_find_saved_regs (fi, fsr) depth -= ((insn & 0xff) ^ 0x80) - 0x80; insn = read_memory_integer (pc, 2); } + /* start-sanitize-sh4 */ + else if (IS_FMOV (insn)) + { + pc += 2; + insn = read_memory_integer (pc, 2); + if (read_register (FPSCR_REGNUM) & FPSCR_SZ) + { + depth += 8; + } + else + { + depth += 4; + } + } + /* end-sanitize-sh4 */ else break; } |